diff options
author | davidovski <david@davidovski.xyz> | 2022-05-29 01:05:33 +0100 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2022-05-29 01:05:33 +0100 |
commit | 91d36b3760828be97a27f6c1dc61e72075e1e8cd (patch) | |
tree | f907c61f13a9e0fa58a86495fbe6e6e177f23a6b /src | |
parent | d10fda9cf2cfbc4e010b455b27adc6a2d39477bd (diff) |
fixed issues with missign lines in dep graphv1.4.3
Diffstat (limited to 'src')
-rwxr-xr-x | src/sync.sh | 34 |
1 files changed, 19 insertions, 15 deletions
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 } |