summaryrefslogtreecommitdiffstats
path: root/repoman
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2017-10-11 08:58:38 +0000
committerramon <ramongomez@us.es>2017-10-11 08:58:38 +0000
commit3b43d89df4ecaf682fdb4eff42d42fafc70c1857 (patch)
tree383d9b7228f55849f62aa355bc823fa11a38bd5f /repoman
parentb444fa7a93141dbca20f70ef069a783dc57109ef (diff)
#810: Generar fichero .info tras crear imagen.
git-svn-id: https://opengnsys.es/svn/branches/version1.1@5454 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'repoman')
-rwxr-xr-xrepoman/bin/checkrepo6
1 files changed, 3 insertions, 3 deletions
diff --git a/repoman/bin/checkrepo b/repoman/bin/checkrepo
index c2628ba7..40643931 100755
--- a/repoman/bin/checkrepo
+++ b/repoman/bin/checkrepo
@@ -48,7 +48,7 @@ function addToJson() {
"clonator":"${CLONATOR,,}",
"compressor":"${COMPRESSOR,,}",
"filesystem":"${FSTYPE^^}",
- "datasize":"$DATASIZE"
+ "datasize":${DATASIZE:-0}
}
EOT
)
@@ -64,7 +64,7 @@ EOT
# Check if it needs to update or insert data.
if [ -n "$IMGIND" ]; then
# Update if image data changes and info file exists.
- [ $# -gt 2 -a "$(jq ".check=$JSON | .check==.images[$IMGIND]" $INFOFILE)" == "false" ] && jq ".images[$IMGIND]=$JSON" $INFOFILE | sponge $INFOFILE
+ [ -n "$3" -a "$(jq ".check=$JSON | .check==.images[$IMGIND]" $INFOFILE)" == "false" ] && jq ".images[$IMGIND]=$JSON" $INFOFILE | sponge $INFOFILE
else
# Append a new entry.
jq ".images |= (. + [$JSON])" $INFOFILE | sponge $INFOFILE
@@ -153,7 +153,7 @@ function checkfiles() {
# Retrieve image creation data and delete temporary file.
INFO="$IMG.info"
[ -e "$INFO" -a "$INFO" -ot "$IMG" ] && rm -f "$INFO" && echo "Warning: Deleted outdated file $INFO"
- [ -r "$INFO" ] && DATA=$(tr ':' ' ' < "$INFO")
+ [ -r "$INFO" ] && DATA=$(cat "$INFO")
# Add data to configuration file (name, type and data) and remove image info file.
IMG=${IMG#$IMAGESDIR/}
addToJson "${IMG%.*}" "${IMG##*.}" "$DATA" && rm -f "$INFO"