From b06b29adf5019cf3b5b3389ad61d1f5074b7a48b Mon Sep 17 00:00:00 2001
From: plengauer
Date: Tue, 12 Sep 2023 20:00:39 +0000
Subject: [PATCH] clean old directories
---
package/DEBIAN/control | 2 +-
package/usr/bin/gitaptly_update.sh | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/package/DEBIAN/control b/package/DEBIAN/control
index 7137d5d..7f97284 100644
--- a/package/DEBIAN/control
+++ b/package/DEBIAN/control
@@ -1,5 +1,5 @@
Package: gitaptly
-Version: 1.5.1
+Version: 1.5.2
Architecture: all
Depends: debconf, bash, cron, gzip, dpkg-dev, wget, python3, python3-pip, python3-venv
Priority: extra
diff --git a/package/usr/bin/gitaptly_update.sh b/package/usr/bin/gitaptly_update.sh
index 9db15b7..4fd540b 100755
--- a/package/usr/bin/gitaptly_update.sh
+++ b/package/usr/bin/gitaptly_update.sh
@@ -5,6 +5,7 @@ cd /var/lib/gitaptly/apt-repo
mode=$(bash /usr/bin/gitaptly_mode.sh 2>&1 | sed 's/ *$//g')
if [ "$mode" = 'cache' ]; then
+ rm -rf cgi-bin/pool/main/*
while read line; do
line=$(echo "$line" | xargs)
if [ -z "$line" ]; then
@@ -18,6 +19,7 @@ if [ "$mode" = 'cache' ]; then
dpkg-scanpackages --multiversion pool/ > dists/stable/main/binary-all/Packages
elif [ "$mode" = 'proxy' ]; then
+ rm -rf pool/main/*
while read line; do
line=$(echo "$line" | xargs)
if [ -z "$line" ]; then
@@ -26,7 +28,7 @@ elif [ "$mode" = 'proxy' ]; then
owner=$(echo $line | cut -d "/" -f 1)
repo=$(echo $line | cut -d "/" -f 2)
mkdir -p pool/main/$owner/$repo cgi-bin/pool/main/$owner/$repo
- rm dists/stable/main/binary-all/Packages
+ rm -f dists/stable/main/binary-all/Packages
for url in $(bash /usr/bin/gitaptly_scan.sh $owner $repo)
do
file=$(echo $url | rev | cut -d "/" -f 1 | rev)