diff --git a/docker.sh b/docker.sh index 84c4f21..e64fd1f 100755 --- a/docker.sh +++ b/docker.sh @@ -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} diff --git a/termux.sh b/termux.sh index 8408462..1b25074 100755 --- a/termux.sh +++ b/termux.sh @@ -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" diff --git a/test/apt_test.sh b/test/apt_test.sh index 7d842f4..c2a67cb 100755 --- a/test/apt_test.sh +++ b/test/apt_test.sh @@ -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}