summaryrefslogtreecommitdiffstats
path: root/repoman
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2017-10-10 16:18:05 +0000
committerramon <ramongomez@us.es>2017-10-10 16:18:05 +0000
commitb444fa7a93141dbca20f70ef069a783dc57109ef (patch)
treef2ee3ea9e5c4d07d2040be3cefd31109c80d3a14 /repoman
parent338b30e41416a980d67b017bd114ce14d1ad76ac (diff)
#810: Corregir errata al tratar información de imágenes en subdirectorios.
git-svn-id: https://opengnsys.es/svn/branches/version1.1@5453 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'repoman')
-rwxr-xr-xrepoman/bin/checkrepo11
1 files changed, 6 insertions, 5 deletions
diff --git a/repoman/bin/checkrepo b/repoman/bin/checkrepo
index b0ac1922..c2628ba7 100755
--- a/repoman/bin/checkrepo
+++ b/repoman/bin/checkrepo
@@ -195,18 +195,19 @@ function checkremoved() {
m=$(jq ".ous | length" $INFOFILE)
for ((j=0; j<m; j++)); do
# OU subdir.
- OU="$(jq -r ".ous[$i].subdir" $INFOFILE)"
+ OU="$(jq -r ".ous[$j].subdir" $INFOFILE)"
# Delete OU's entries if its subdir does not exist.
if [ ! -e "$IMAGESDIR/$OU" ]; then
- jq "del(.ous[[$j])" $INFOFILE | sponge $INFOFILE
+ jq "del(.ous[$j])" $INFOFILE | sponge $INFOFILE
else
n=$(jq ".images | length" $INFOFILE)
for ((i=0; i<n; i++)); do
# Image name and type.
- IMG="$(jq -r ".images[$i].name" $INFOFILE)"
- TYPE="$(jq -r ".images[$i].type" $INFOFILE)"
+ IMG="$(jq -r ".ous[$j].images[$i].name" $INFOFILE)"
+ TYPE="$(jq -r ".ous[$j].images[$i].type" $INFOFILE)"
+ [ "$TYPE" != "dir" ] && IMG="$IMG.$TYPE"
# Delete entry if image does not exist and it's not locked.
- [ ! -e "$IMAGESDIR/$OU/$IMG" -a ! -e "$IMAGESDIR/$OU/$IMG.lock" ] && jq "del(.ous[[$j].images[$i])" $INFOFILE | sponge $INFOFILE
+ [ ! -e "$IMAGESDIR/$OU/$IMG" -a ! -e "$IMAGESDIR/$OU/$IMG.lock" ] && jq "del(.ous[$j].images[$i])" $INFOFILE | sponge $INFOFILE
done
fi
done