summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRamón M. Gómez <ramongomez@us.es>2018-10-15 11:12:06 +0200
committerRamón M. Gómez <ramongomez@us.es>2018-10-15 11:12:06 +0200
commit5d718fb3927770679d4e0413c4e6914ff6c835ef (patch)
tree8d0245c4749d807db41a5d484ee232f8399512c8
parent960e1712882e27413c63e86f326329ef3f1a949c (diff)
#872: Adapting ticket #850 to the master branch.
-rwxr-xr-xrepoman/bin/checkrepo5
1 files changed, 3 insertions, 2 deletions
diff --git a/repoman/bin/checkrepo b/repoman/bin/checkrepo
index b38a689b..24bb8adb 100755
--- a/repoman/bin/checkrepo
+++ b/repoman/bin/checkrepo
@@ -3,7 +3,7 @@
#/**
# checkrepo
#@file checkrepo
-#@brief Generate repository information in a JSON file.
+#@brief Maintain repository information in a JSON file.
#@warning This script uses "jq" command.
#@version 1.1.0 - Initial version.
#@author Ramón M. Gómez - ETSII Univ. Sevilla
@@ -105,7 +105,7 @@ EOT
# Create new JSON file.
if [ -z "$OUNAME" ]; then
cat << EOT | jq . > $INFOFILE
-{"directory":"$IMAGESDIR","images":[$JSON],"ous":[]}
+{"directory":"$IMAGESDIR","images":[${IMAGENAME:+$JSON}],"ous":[]}
EOT
else
cat << EOT | jq . > $INFOFILE
@@ -221,6 +221,7 @@ function checkremoved() {
# Check dependencies.
[ ! -w "$(dirname "$INFOFILE")" ] && raiseError access "$INFOFILE"
+[ -e "$INFOFILE" ] || addToJson
JQ=$(which jq 2>/dev/null) || raiseError notfound "Need to install \"jq\"."
which sponge &>/dev/null || raiseError notfound "Need to install \"moreutils\"."