summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2013-01-23 23:03:35 +0100
committerFlorian Pritz <bluewind@xinu.at>2013-11-02 10:25:14 +0100
commit607199690c2a8939b92fc351797605477d8374f7 (patch)
treefe684e636d0037c30ab2adcb6ec107a47f8e55e7
parentfbce7db101feaba0d69bf185b54270c1aa6d65ab (diff)
downloaddbscripts-607199690c2a8939b92fc351797605477d8374f7.tar.gz
dbscripts-607199690c2a8939b92fc351797605477d8374f7.tar.xz
Add lastupdate fileworking
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 <bluewind@xinu.at>
-rw-r--r--db-functions10
1 files changed, 10 insertions, 0 deletions
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() {