summaryrefslogtreecommitdiff
path: root/db-functions
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-12-31 14:12:55 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-12-31 14:12:55 -0500
commitdf9f6b1ba47dc31f058b2c935bcfdc1afe2aef8d (patch)
tree9fb0da291e50a9ff05acea8c813b752ca50f0b99 /db-functions
parent63810122211aa60b056895989984eaccf6242c58 (diff)
parent0b43e8cdee1ee46ea79e4d089136e76e767b4d5b (diff)
Merge branch 'arch' into cleanup3
Diffstat (limited to 'db-functions')
-rw-r--r--db-functions19
1 files changed, 19 insertions, 0 deletions
diff --git a/db-functions b/db-functions
index f5e2b3d..90d2a09 100644
--- a/db-functions
+++ b/db-functions
@@ -15,9 +15,19 @@ 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 -dt "${0##*/}.XXXXXXXXXX")
LOCKS=()
+REPO_MODIFIED=0
# Used: plain, msg, msg2, warning, error, in_array, get_full_version
# Overwritten: cleanup, abort, die
@@ -70,6 +80,11 @@ cleanup() {
script_unlock
fi
rm -rf "$WORKDIR"
+
+ if (( REPO_MODIFIED )); then
+ date +%s > "${FTP_BASE}/lastupdate"
+ fi
+
[ "$1" ] && exit $1
}
@@ -413,6 +428,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() {
@@ -431,4 +448,6 @@ arch_repo_remove() {
/usr/bin/repo-remove -q "${filesfile}" ${pkgs[@]} \
|| error "repo-remove ${filesfile} ${pkgs[@]}"
set_repo_permission "${repo}" "${arch}"
+
+ REPO_MODIFIED=1
}