[arch-dev-public] [PATCH 0/4] dbscripts patches for dealing with package signatures
These patches should provide support for moving signatures to repos alongside their packages and cleaning them up when no longer needed. I have not added checks to the test suite for this. Allan McRae (4): Be less generic with package extension Copy packages signatures to repo if available Move signatures with packages if available Clean-up signatures from ftp directories config | 2 +- cron-jobs/ftpdir-cleanup | 4 ++++ db-move | 3 +++ db-update | 8 ++++++++ misc-scripts/ftpdir-cleanup-repo | 5 +++++ 5 files changed, 21 insertions(+), 1 deletions(-) -- 1.7.4.1
Arch only uses .gz and .xz packages so look for .pkg.tar.?z. This prevents matching potential detached signature files. Signed-off-by: Allan McRae <allan@archlinux.org> --- config | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/config b/config index f6600a6..b1bcb4f 100644 --- a/config +++ b/config @@ -15,7 +15,7 @@ STAGING="$HOME/staging" TMPDIR="/srv/tmp" ARCHES=(i686 x86_64) DBEXT=".db.tar.gz" -PKGEXT=".pkg.tar.*" +PKGEXT=".pkg.tar.?z" SRCEXT=".src.tar.gz" # Allowed licenses: get sourceballs only for licenses in this array -- 1.7.4.1
On Sat, Mar 12, 2011 at 9:27 PM, Allan McRae <allan@archlinux.org> wrote:
Arch only uses .gz and .xz packages so look for .pkg.tar.?z. This prevents matching potential detached signature files.
Signed-off-by: Allan McRae <allan@archlinux.org> Same title so it threaded it the same as the other patch, but: Signed-off-by: Dan McGee <dan@archlinux.org>
--- config | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/config b/config index f6600a6..b1bcb4f 100644 --- a/config +++ b/config @@ -15,7 +15,7 @@ STAGING="$HOME/staging" TMPDIR="/srv/tmp" ARCHES=(i686 x86_64) DBEXT=".db.tar.gz" -PKGEXT=".pkg.tar.*" +PKGEXT=".pkg.tar.?z" SRCEXT=".src.tar.gz"
# Allowed licenses: get sourceballs only for licenses in this array -- 1.7.4.1
Signed-off-by: Allan McRae <allan@archlinux.org> --- db-update | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/db-update b/db-update index 51e3cc2..754f89a 100755 --- a/db-update +++ b/db-update @@ -58,6 +58,14 @@ for repo in ${repos[@]}; do mv "${pkg}" "$FTP_BASE/$(get_pkgpool_for_host)" fi ln -s "../../../$(get_pkgpool_for_host)/${pkgfile}" "$FTP_BASE/$repo/os/${pkgarch}" + + if [ -f "${pkg}.sig" ]; then + mv "${pkg}.sig" "$FTP_BASE/$(get_pkgpool_for_host)" + fi + if [ -f "$FTP_BASE/$(get_pkgpool_for_host)/${pkgfile}.sig" ]; then + ln -s "../../../$(get_pkgpool_for_host)/${pkgfile}.sig" "$FTP_BASE/$repo/os/${pkgarch}" + fi + add_pkgs[${#add_pkgs[*]}]=${pkgfile} done pushd "$FTP_BASE/$repo/os/${pkgarch}" >/dev/null -- 1.7.4.1
On Sat, Mar 12, 2011 at 9:27 PM, Allan McRae <allan@archlinux.org> wrote:
Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
But once again this seems to have changes my checkout doesn't have (get_pkgpool_for_host).
--- db-update | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/db-update b/db-update index 51e3cc2..754f89a 100755 --- a/db-update +++ b/db-update @@ -58,6 +58,14 @@ for repo in ${repos[@]}; do mv "${pkg}" "$FTP_BASE/$(get_pkgpool_for_host)" fi ln -s "../../../$(get_pkgpool_for_host)/${pkgfile}" "$FTP_BASE/$repo/os/${pkgarch}" + + if [ -f "${pkg}.sig" ]; then + mv "${pkg}.sig" "$FTP_BASE/$(get_pkgpool_for_host)" + fi + if [ -f "$FTP_BASE/$(get_pkgpool_for_host)/${pkgfile}.sig" ]; then + ln -s "../../../$(get_pkgpool_for_host)/${pkgfile}.sig" "$FTP_BASE/$repo/os/${pkgarch}" + fi + add_pkgs[${#add_pkgs[*]}]=${pkgfile} done pushd "$FTP_BASE/$repo/os/${pkgarch}" >/dev/null -- 1.7.4.1
Signed-off-by: Allan McRae <allan@archlinux.org> --- db-move | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/db-move b/db-move index a274cd3..11f6c15 100755 --- a/db-move +++ b/db-move @@ -87,6 +87,9 @@ for pkgbase in ${args[@]:2}; do cp ${pkgpath} ${FTP_BASE}/$(get_pkgpool_for_host) fi ln -s "../../../$(get_pkgpool_for_host)/${pkgfile}" ${ftppath_to}/${tarch}/ + if [ -f "$FTP_BASE/$(get_pkgpool_for_host)/${pkgfile}.sig" ]; then + ln -s "../../../$(get_pkgpool_for_host)/${pkgfile}.sig" ${ftppath_to}/${tarch}/ + fi add_pkgs[${tarch}]+="${FTP_BASE}/$(get_pkgpool_for_host)/${pkgfile} " remove_pkgs[${tarch}]+="${pkgname} " done -- 1.7.4.1
On Sat, Mar 12, 2011 at 9:27 PM, Allan McRae <allan@archlinux.org> wrote:
Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
--- db-move | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/db-move b/db-move index a274cd3..11f6c15 100755 --- a/db-move +++ b/db-move @@ -87,6 +87,9 @@ for pkgbase in ${args[@]:2}; do cp ${pkgpath} ${FTP_BASE}/$(get_pkgpool_for_host) fi ln -s "../../../$(get_pkgpool_for_host)/${pkgfile}" ${ftppath_to}/${tarch}/ + if [ -f "$FTP_BASE/$(get_pkgpool_for_host)/${pkgfile}.sig" ]; then + ln -s "../../../$(get_pkgpool_for_host)/${pkgfile}.sig" ${ftppath_to}/${tarch}/ + fi add_pkgs[${tarch}]+="${FTP_BASE}/$(get_pkgpool_for_host)/${pkgfile} " remove_pkgs[${tarch}]+="${pkgname} " done -- 1.7.4.1
Signed-off-by: Allan McRae <allan@archlinux.org> --- cron-jobs/ftpdir-cleanup | 4 ++++ misc-scripts/ftpdir-cleanup-repo | 5 +++++ 2 files changed, 9 insertions(+), 0 deletions(-) diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup index 3456e9c..175e56c 100755 --- a/cron-jobs/ftpdir-cleanup +++ b/cron-jobs/ftpdir-cleanup @@ -24,6 +24,10 @@ for pkg in *$PKGEXT; do LINKS="$(/usr/bin/find $repopaths -type l -name "$pkg" 2>/dev/null)" if [ -z "$LINKS" ]; then to_cleanup="$to_cleanup $poolpath/$pkg" + + if [ -f "$pkg.sig" ]; then + to_cleanup="$to_cleanup $poolpath/$pkg.sig" + fi fi done popd >/dev/null diff --git a/misc-scripts/ftpdir-cleanup-repo b/misc-scripts/ftpdir-cleanup-repo index 20f297b..ac7c026 100755 --- a/misc-scripts/ftpdir-cleanup-repo +++ b/misc-scripts/ftpdir-cleanup-repo @@ -20,6 +20,11 @@ clean_pkgs () { else mv "$pkg" "$CLEANUP_DESTDIR" fi + if [ -h "$pkg.sig" ]; then + rm -f "$pkg.sig" + else + mv "$pkg.sig" "$CLEANUP_DESTDIR" + fi done fi } -- 1.7.4.1
On Sat, Mar 12, 2011 at 9:27 PM, Allan McRae <allan@archlinux.org> wrote:
Signed-off-by: Allan McRae <allan@archlinux.org> I have no idea where this one applies...dbscripts? I have cron-jobs/ftpdir-cleanup but it doesn't look at all like the diff hunks you have, and no misc-scripts/ dir at all...
--- cron-jobs/ftpdir-cleanup | 4 ++++ misc-scripts/ftpdir-cleanup-repo | 5 +++++ 2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup index 3456e9c..175e56c 100755 --- a/cron-jobs/ftpdir-cleanup +++ b/cron-jobs/ftpdir-cleanup @@ -24,6 +24,10 @@ for pkg in *$PKGEXT; do LINKS="$(/usr/bin/find $repopaths -type l -name "$pkg" 2>/dev/null)" if [ -z "$LINKS" ]; then to_cleanup="$to_cleanup $poolpath/$pkg" + + if [ -f "$pkg.sig" ]; then + to_cleanup="$to_cleanup $poolpath/$pkg.sig" + fi fi done popd >/dev/null diff --git a/misc-scripts/ftpdir-cleanup-repo b/misc-scripts/ftpdir-cleanup-repo index 20f297b..ac7c026 100755 --- a/misc-scripts/ftpdir-cleanup-repo +++ b/misc-scripts/ftpdir-cleanup-repo @@ -20,6 +20,11 @@ clean_pkgs () { else mv "$pkg" "$CLEANUP_DESTDIR" fi + if [ -h "$pkg.sig" ]; then + rm -f "$pkg.sig" + else + mv "$pkg.sig" "$CLEANUP_DESTDIR" + fi done fi } -- 1.7.4.1
On 17/03/11 11:08, Dan McGee wrote:
On Sat, Mar 12, 2011 at 9:27 PM, Allan McRae<allan@archlinux.org> wrote:
Signed-off-by: Allan McRae<allan@archlinux.org> I have no idea where this one applies...dbscripts? I have cron-jobs/ftpdir-cleanup but it doesn't look at all like the diff hunks you have, and no misc-scripts/ dir at all...
My bad... looks like I had a really, really, really old dbscripts checkout.
participants (2)
-
Allan McRae
-
Dan McGee