summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2014-06-18 19:39:08 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2014-06-18 19:47:16 -0400
commit3c2585392d46a3726d25696882d09ec0bf11d1f5 (patch)
treeccc6ecaba90eb3296890d618caa1451e87648066
parent906544cad702b9b8816717c8ba00d40bfe10a471 (diff)
db-functions: update ${FTP_DIR}/lastupdate when we modify the repo.
Of course, this only works for things that use db-functions, so db-sync won't touch it.
-rw-r--r--db-functions10
1 files changed, 10 insertions, 0 deletions
diff --git a/db-functions b/db-functions
index a4b072b..2eeffbb 100644
--- a/db-functions
+++ b/db-functions
@@ -27,6 +27,7 @@ mv_acl() {
# set up general environment
WORKDIR=$(mktemp -dt "${0##*/}.XXXXXXXXXX")
LOCKS=()
+REPO_MODIFIED=0
# check if messages are to be printed using color
unset ALL_OFF BOLD BLUE GREEN RED YELLOW
@@ -137,6 +138,11 @@ cleanup() {
script_unlock
fi
rm -rf "$WORKDIR"
+
+ if (( REPO_MODIFIED )); then
+ date +%s > "${FTP_BASE}/lastupdate"
+ fi
+
[ "$1" ] && exit "$1"
}
@@ -510,6 +516,8 @@ arch_repo_add() {
|| error '%s' "repo-add -f ${repo}${FILESEXT} ${pkgs[*]}"
popd >/dev/null
set_repo_permission "${repo}" "${arch}"
+
+ REPO_MODIFIED=1
}
arch_repo_remove() {
@@ -528,4 +536,6 @@ arch_repo_remove() {
/usr/bin/repo-remove -q "${filesfile}" "${pkgs[@]}" \
|| error '%s' "repo-remove ${filesfile} ${pkgs[*]}"
set_repo_permission "${repo}" "${arch}"
+
+ REPO_MODIFIED=1
}