Skip to content

Commit 0896758

Browse files
committed
Update_command_lists: don't error as long as deb exist locally
And print a message when deleting a package.
1 parent 2ee92d8 commit 0896758

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

modify_command_list.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
list_of_commands.read_list()
2626

2727
for package in packages_to_delete:
28+
print("Deleting " + package)
2829
list_of_commands.remove_package_from_list(package.replace("packages/", "").strip("/"))
2930

3031
# Read from stdin, strip away newlines and empty lines.

update_command_lists.sh

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,25 +52,24 @@ download_deb() {
5252
return
5353
fi
5454

55-
# Get path to the deb on the repo
56-
deb_path=$(get_deb_path ${packages_file} $pkg_name $dep_version $dep_arch)
57-
if [ -z "$deb_path" ]; then
58-
echo "${pkg_name}_${dep_version}_${dep_arch}.deb not found" 1>&2
59-
return
60-
fi
61-
6255
(
6356
cd "$TERMUX_TOPDIR/_cache-${dep_arch}"
6457
if [ ! -f "${pkg_name}_${dep_version}_${dep_arch}.deb" ]; then
58+
# Get path to the deb on the repo
59+
deb_path=$(get_deb_path ${packages_file} $pkg_name $dep_version $dep_arch)
60+
if [ -z "$deb_path" ]; then
61+
echo "${pkg_name}_${dep_version}_${dep_arch}.deb not found on repo" 1>&2
62+
return
63+
fi
6564
echo "Downloading ${repo_url}/${deb_path}" 1>&2
6665
temp_deb=$(mktemp $TMPDIR/$(basename ${deb_path}).XXXXXX)
6766
curl --fail -L -o "${temp_deb}" "${repo_url}/${deb_path}" || \
6867
echo "Download of ${repo_url}/${deb_path} failed" 1>&2
6968
mv ${temp_deb} $(basename ${deb_path})
7069
else
71-
printf "%-50s %s\n" "$(basename ${deb_path})" "already downloaded" 1>&2
70+
printf "%-50s %s\n" "${pkg_name}_${dep_version}_${dep_arch}.deb" "already downloaded" 1>&2
7271
fi
73-
echo "$TERMUX_TOPDIR/_cache-${dep_arch}/$(basename ${deb_path})\n"
72+
echo "$TERMUX_TOPDIR/_cache-${dep_arch}/${pkg_name}_${dep_version}_${dep_arch}.deb\n"
7473
)
7574
done
7675
}

0 commit comments

Comments
 (0)