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 --- db-functions | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'db-functions') diff --git a/db-functions b/db-functions index b3a4293..4a9a42a 100644 --- a/db-functions +++ b/db-functions @@ -15,6 +15,15 @@ restore_umask () { umask $UMASK >/dev/null } +# 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" +} + # set up general environment WORKDIR=$(mktemp -d "${TMPDIR}/${0##*/}.XXXXXXXXXX") if [ -n "${SVNUSER}" ]; then -- cgit v1.2.3-2-g168b From 0b43e8cdee1ee46ea79e4d089136e76e767b4d5b Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Wed, 23 Jan 2013 23:03:35 +0100 Subject: Add lastupdate file This allows for faster checking if an update might be needed and helps to let reporead run when something changed. Signed-off-by: Florian Pritz --- db-functions | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'db-functions') diff --git a/db-functions b/db-functions index 4a9a42a..bb49894 100644 --- a/db-functions +++ b/db-functions @@ -32,6 +32,7 @@ if [ -n "${SVNUSER}" ]; then setfacl -m d:u:"${SVNUSER}":rwx "${WORKDIR}" fi LOCKS=() +REPO_MODIFIED=0 # check if messages are to be printed using color unset ALL_OFF BOLD BLUE GREEN RED YELLOW @@ -142,6 +143,11 @@ cleanup() { script_unlock fi rm -rf "$WORKDIR" + + if (( REPO_MODIFIED )); then + date +%s > "${FTP_BASE}/lastupdate" + fi + [ "$1" ] && exit $1 } @@ -499,6 +505,8 @@ arch_repo_add() { || error "repo-add -f ${repo}${FILESEXT} ${pkgs[@]}" popd >/dev/null set_repo_permission "${repo}" "${arch}" + + REPO_MODIFIED=1 } arch_repo_remove() { @@ -517,6 +525,8 @@ arch_repo_remove() { /usr/bin/repo-remove -q "${filesfile}" ${pkgs[@]} \ || error "repo-remove ${filesfile} ${pkgs[@]}" set_repo_permission "${repo}" "${arch}" + + REPO_MODIFIED=1 } arch_svn() { -- cgit v1.2.3-2-g168b