From 91d36b3760828be97a27f6c1dc61e72075e1e8cd Mon Sep 17 00:00:00 2001 From: davidovski Date: Sun, 29 May 2022 01:05:33 +0100 Subject: fixed issues with missign lines in dep graph --- src/sync.sh | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/sync.sh b/src/sync.sh index b6cb5b1..6462a8a 100755 --- a/src/sync.sh +++ b/src/sync.sh @@ -4,20 +4,22 @@ # save each listed package in a relevant directory, based on checksum # parse_line() { - local repo=$1 - local repo_url=$2 - local package=$3 - local checksum=$4 - local size=$5 - local files=$6 - - local package_name=$(basename $package ".xipkg") - - local package_dir="$PACKAGES_DIR/$repo/$package_name.versions" - local checksum_file=$package_dir/$checksum - - [ -d $package_dir ] || mkdir -p $package_dir - printf "$repo_url/$package $checksum $size $files\n" >> $checksum_file + [ "$#" = "6" ] && { + local repo=$1 + local repo_url=$2 + local package=$3 + local checksum=$4 + local size=$5 + local files=$6 + + local package_name=$(basename $package ".xipkg") + + local package_dir="$PACKAGES_DIR/$repo/$package_name.versions" + local checksum_file=$package_dir/$checksum + + [ -d $package_dir ] || mkdir -p $package_dir + printf "$repo_url/$package $checksum $size $files\n" >> $checksum_file + } } list_source () { @@ -55,7 +57,9 @@ dep_graph () { while IFS= read -r line; do local package=$(echo $line | cut -d: -f1) local new=$(echo $line | cut -d: -f2-) - echo $new >> $DEP_DIR/$package + + [ -z "${package}" ] && + echo $new >> $DEP_DIR/$package done < "$tmp_file" fi } -- cgit v1.2.1