From 5c7220a4aa370d1f726eb27d99d8f9294646433d Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Mon, 19 Dec 2011 14:40:07 +0100 Subject: Avoid calls to basename --- cron-jobs/ftpdir-cleanup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cron-jobs/ftpdir-cleanup') diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup index bb1661a..7839d50 100755 --- a/cron-jobs/ftpdir-cleanup +++ b/cron-jobs/ftpdir-cleanup @@ -16,7 +16,7 @@ clean_pkg() { if [ -e "$pkg.sig" ]; then mv -f "$pkg.sig" "$CLEANUP_DESTDIR" fi - touch "${CLEANUP_DESTDIR}/$(basename ${pkg})" + touch "${CLEANUP_DESTDIR}/${pkg##*/}" fi done fi -- cgit v1.2.3-2-g168b From 33cfe12c34747bd52e2730e45566e5b21cd76153 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 29 Apr 2012 10:10:43 +0200 Subject: Source the config before the functions as the latter references the former --- cron-jobs/ftpdir-cleanup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cron-jobs/ftpdir-cleanup') diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup index 7839d50..9bc88d7 100755 --- a/cron-jobs/ftpdir-cleanup +++ b/cron-jobs/ftpdir-cleanup @@ -1,7 +1,7 @@ #!/bin/bash -. "$(dirname $0)/../db-functions" . "$(dirname $0)/../config" +. "$(dirname $0)/../db-functions" clean_pkg() { local pkg -- cgit v1.2.3-2-g168b From c639ae7d7a9fa5544d495e0b4d4f3b49611a7af9 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Sun, 10 Jun 2012 11:45:59 +0200 Subject: Remove support for packages in legacy $repo/os/any directories --- cron-jobs/ftpdir-cleanup | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'cron-jobs/ftpdir-cleanup') diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup index 9bc88d7..15eb46c 100755 --- a/cron-jobs/ftpdir-cleanup +++ b/cron-jobs/ftpdir-cleanup @@ -75,29 +75,6 @@ if [ ${#old_pkgs[@]} -ge 1 ]; then done fi -# cleanup of legacy $repo/os/any directories -for repo in ${PKGREPOS[@]}; do - if [ ! -d "${FTP_BASE}/${repo}/os/any" ]; then - continue - fi - if [ -n "$(find "${FTP_BASE}/${repo}/os/any" -type d -empty)" ]; then - msg "Removing empty legacy directory ${repo}/os/any" - ${CLEANUP_DRYRUN} || rmdir "${FTP_BASE}/${repo}/os/any" - continue - fi - find "${FTP_BASE}/${repo}/os/any" -name "*${PKGEXT}" -printf '%f\n' | sort > "${WORKDIR}/any-${repo}" - cat "${WORKDIR}/db-${repo}-"* | sort -u > "${WORKDIR}/all-${repo}" - - old_pkgs=($(comm -23 "${WORKDIR}/any-${repo}" "${WORKDIR}/all-${repo}")) - if [ ${#old_pkgs[@]} -ge 1 ]; then - msg "Removing old packages from [${repo}] (any)..." - for old_pkg in ${old_pkgs[@]}; do - msg2 "${old_pkg}" - clean_pkg "${FTP_BASE}/${repo}/os/any/${old_pkg}" - done - fi -done - old_pkgs=($(find ${CLEANUP_DESTDIR} -type f -name "*${PKGEXT}" -mtime +${CLEANUP_KEEP} -printf '%f\n')) if [ ${#old_pkgs[@]} -ge 1 ]; then msg "Removing old packages from the cleanup directory..." -- cgit v1.2.3-2-g168b From c2ad0298b74877bb2cd85f8f0e899460714bb019 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 7 Jan 2013 12:08:30 +0100 Subject: ftpdir-cleanup: fix ACL issues on nymeria Signed-off-by: Florian Pritz Signed-off-by: Pierre Schmitz --- cron-jobs/ftpdir-cleanup | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'cron-jobs/ftpdir-cleanup') diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup index 15eb46c..e1294bd 100755 --- a/cron-jobs/ftpdir-cleanup +++ b/cron-jobs/ftpdir-cleanup @@ -3,6 +3,15 @@ . "$(dirname $0)/../config" . "$(dirname $0)/../db-functions" +# just like mv -f, but we touch the file and then copy the content so +# default ACLs in the target dir will be applied +mv_acl() { + rm -f "$2" + touch "$2" + cat "$1" >"$2" || return 1 + rm -f "$1" +} + clean_pkg() { local pkg local target @@ -12,9 +21,9 @@ clean_pkg() { if [ -h "$pkg" ]; then rm -f "$pkg" "$pkg.sig" else - mv -f "$pkg" "$CLEANUP_DESTDIR" + mv_acl "$pkg" "$CLEANUP_DESTDIR/${pkg##*/}" if [ -e "$pkg.sig" ]; then - mv -f "$pkg.sig" "$CLEANUP_DESTDIR" + mv_acl "$pkg.sig" "$CLEANUP_DESTDIR/${pkg##*/}.sig" fi touch "${CLEANUP_DESTDIR}/${pkg##*/}" fi -- cgit v1.2.3-2-g168b From fbce7db101feaba0d69bf185b54270c1aa6d65ab Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Tue, 19 Mar 2013 19:53:38 +0100 Subject: sourceballs: fix ACL issues on nymeria ACLs from the WORKDIR were used, leading to problems as these weren't world-readable. Fix follows ftpdir-cleanup. Signed-off-by: Jan Alexander Steffens (heftig) Signed-off-by: Pierre Schmitz --- cron-jobs/ftpdir-cleanup | 9 --------- 1 file changed, 9 deletions(-) (limited to 'cron-jobs/ftpdir-cleanup') diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup index e1294bd..8f5cb3c 100755 --- a/cron-jobs/ftpdir-cleanup +++ b/cron-jobs/ftpdir-cleanup @@ -3,15 +3,6 @@ . "$(dirname $0)/../config" . "$(dirname $0)/../db-functions" -# just like mv -f, but we touch the file and then copy the content so -# default ACLs in the target dir will be applied -mv_acl() { - rm -f "$2" - touch "$2" - cat "$1" >"$2" || return 1 - rm -f "$1" -} - clean_pkg() { local pkg local target -- cgit v1.2.3-2-g168b From e6294556d3197b7d87f7659355d0e189fad613d6 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 8 Dec 2013 17:33:25 -0500 Subject: `readlink -e` all "$0"s --- cron-jobs/ftpdir-cleanup | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cron-jobs/ftpdir-cleanup') diff --git a/cron-jobs/ftpdir-cleanup b/cron-jobs/ftpdir-cleanup index 8f5cb3c..e42a1a8 100755 --- a/cron-jobs/ftpdir-cleanup +++ b/cron-jobs/ftpdir-cleanup @@ -1,7 +1,7 @@ #!/bin/bash -. "$(dirname $0)/../config" -. "$(dirname $0)/../db-functions" +. "$(dirname "$(readlink -e "$0")")/../config" +. "$(dirname "$(readlink -e "$0")")/../db-functions" clean_pkg() { local pkg -- cgit v1.2.3-2-g168b