add apt removing to termux

This commit is contained in:
bigeagle 2016-11-20 16:22:16 +08:00
parent 16a462abdd
commit f146cf65a2
3 changed files with 14 additions and 3 deletions

View File

@ -69,7 +69,7 @@ mkdir -p ${APT_BACKUP_PATH}
(cd ${APT_PATH}; find . -type f -iname "*.deb") | sed 's+^\./++' > ${local_filelist}
comm <(sort $remote_filelist) <(sort $local_filelist) -13 | while read file; do
echo "deleting ${file}"
mv $file ${APT_BACKUP_PATH}
mv "${APT_PATH}/$file" ${APT_BACKUP_PATH}
done
rm ${remote_filelist} ${local_filelist}

View File

@ -11,9 +11,20 @@ base_url=${TUNASYNC_UPSTREAM_URL:-"https://termux.net"}
ARCHES=("aarch64" "all" "arm" "i686")
remote_filelist="${BASE_PATH}/filelist.remote"
local_filelist="${BASE_PATH}/filelist.local"
for arch in ${ARCHES[@]}; do
echo "start syncing: ${arch}"
apt-download-binary "${base_url}" "stable" "main" "${arch}" "${BASE_PATH}" || true
apt-download-binary "${base_url}" "stable" "main" "${arch}" "${BASE_PATH}" ${remote_filelist} || true
done
BACKUP_PATH="${BASE_PATH}/backup/"
mkdir -p ${BACKUP_PATH}
(cd ${BASE_PATH}; find . -type f -iname "*.deb") | sed 's+^\./++' > ${local_filelist}
comm <(sort $remote_filelist) <(sort $local_filelist) -13 | while read file; do
echo "deleting ${file}"
mv "${BASE_PATH}/$file" ${BACKUP_PATH}
done
echo "finished"

View File

@ -33,7 +33,7 @@ mkdir -p ${APT_BACKUP_PATH}
(cd ${APT_PATH}; find . -type f -iname "*.deb") | sed 's+^\./++' > ${local_filelist}
comm <(sort $remote_filelist) <(sort $local_filelist) -13 | while read file; do
echo "deleting ${file}"
mv $file ${APT_BACKUP_PATH}
mv "${APT_PATH}/$file" ${APT_BACKUP_PATH}
done
rm ${remote_filelist} ${local_filelist}