Signature files are optional and the previous behaviour
is unchanged when signatures files do not exist.

Signed-off-by: Rémy Oudompheng <[email protected]>
---
This patch was already posted with very slight differences
on the mailing-list by Allan. It needed several changes to
fit the current state of dbscripts. I hope this one will
allow to move forward.

Still nothing in the test suite: we would need to run
gpg after the extra-*-build invocation and extra checks
for the presence/absence of signature files in the repos.

 cron-jobs/ftpdir-cleanup |   10 ++++++++--
 db-move                  |    3 +++
 db-update                |    7 +++++++
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup
index 09e8a49..bb1661a 100755
--- a/cron-jobs/ftpdir-cleanup
+++ b/cron-jobs/ftpdir-cleanup
@@ -10,9 +10,12 @@ clean_pkg() {
        if ! ${CLEANUP_DRYRUN}; then
                for pkg in "$@"; do
                        if [ -h "$pkg" ]; then
-                               rm -f "$pkg"
+                               rm -f "$pkg" "$pkg.sig"
                        else
                                mv -f "$pkg" "$CLEANUP_DESTDIR"
+                               if [ -e "$pkg.sig" ]; then
+                                       mv -f "$pkg.sig" "$CLEANUP_DESTDIR"
+                               fi
                                touch "${CLEANUP_DESTDIR}/$(basename ${pkg})"
                        fi
                done
@@ -100,7 +103,10 @@ if [ ${#old_pkgs[@]} -ge 1 ]; then
        msg "Removing old packages from the cleanup directory..."
        for old_pkg in ${old_pkgs[@]}; do
                msg2 "${old_pkg}"
-               ${CLEANUP_DRYRUN} || rm -f "${CLEANUP_DESTDIR}/${old_pkg}"
+               if ! ${CLEANUP_DRYRUN}; then
+                       rm -f "${CLEANUP_DESTDIR}/${old_pkg}"
+                       rm -f "${CLEANUP_DESTDIR}/${old_pkg}.sig"
+               fi
        done
 fi
 
diff --git a/db-move b/db-move
index ced90a3..ff1b0e2 100755
--- a/db-move
+++ b/db-move
@@ -96,6 +96,9 @@ for pkgbase in ${args[@]:2}; do
                                                cp ${pkgpath} 
${FTP_BASE}/${PKGPOOL}
                                        fi
                                        ln -s "../../../${PKGPOOL}/${pkgfile}" 
${ftppath_to}/${tarch}/
+                                       if [ -f 
${FTP_BASE}/${PKGPOOL}/${pkgfile}.sig ]; then
+                                               ln -s 
"../../../${PKGPOOL}/${pkgfile}.sig" ${ftppath_to}/${tarch}/
+                                       fi
                                        
add_pkgs[${tarch}]+="${FTP_BASE}/${PKGPOOL}/${pkgfile} "
                                        remove_pkgs[${tarch}]+="${pkgname} "
                                done
diff --git a/db-update b/db-update
index 5bdce5e..4b9c78f 100755
--- a/db-update
+++ b/db-update
@@ -64,6 +64,13 @@ for repo in ${repos[@]}; do
                                mv "${pkg}" "$FTP_BASE/${PKGPOOL}"
                        fi
                        ln -s "../../../${PKGPOOL}/${pkgfile}" 
"$FTP_BASE/$repo/os/${pkgarch}"
+                       # also move signatures
+                       if [ -f "${pkg}.sig" ]; then
+                               mv "${pkg}.sig" "$FTP_BASE/${PKGPOOL}"
+                       fi
+                       if [ -f "$FTP_BASE/${PKGPOOL}/${pkgfile}.sig" ]; then
+                               ln -s "../../../${PKGPOOL}/${pkgfile}.sig" 
"$FTP_BASE/$repo/os/${pkgarch}"
+                       fi
                        add_pkgs[${#add_pkgs[*]}]=${pkgfile}
                done
                if [ ${#add_pkgs[@]} -ge 1 ]; then
-- 
1.7.4.2

Reply via email to