Commit 978fe01d authored by Diego Pasqualin's avatar Diego Pasqualin
Browse files

update_mirror.sh: Fix package version fetch


Signed-off-by: default avatarDiego Pasqualin <dpasqualin@c3sl.ufpr.br>
parent 16025848
......@@ -50,8 +50,8 @@ function getPackagesAndVersions() {
local version=""
for pkg in $(grep '^Package:' $repoFile | awk '{print $2}'); do
version=$(grep -m1 -A1 "Package: ${pkg}$" $repoFile | tail -1 |
awk '{print $2}')
version=$(awk "/^Package: ${pkg}$/,/^$/" $repoFile |
grep "^Version:" | awk '{print $2}')
pkgAndVersion="$pkgAndVersion $pkg:$version"
done
echo "$pkgAndVersion"
......@@ -73,8 +73,8 @@ function askUpdate() {
function askInclude() {
local repo=$1
local pkg=$2
local version=$4
read -p "$pkg-$version doesn't exist on le5-$repo, include it (y/N)? " yn
local version=$3
read -p "$pkg:$version doesn't exist on le5-$repo, include it (y/N)? " yn
test "$yn" = "y" || test "$yn" = "s"
}
......@@ -165,7 +165,7 @@ for pkgVersionFrom in $fromPkgAndVersion; do
done
# We didn't find this package on the destionation repository, maybe the
# user wants to add it. Let's ask him
if ! $found && askInclude $TOREPO $pkgTo $versionTo; then
if ! $found && askInclude $TOREPO $pkgFrom $versionFrom; then
doUpdate $pkgTo
fi
done
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment