]> git.decadent.org.uk Git - dak.git/blobdiff - config/debian/cron.dinstall
local is nice for variables in functions
[dak.git] / config / debian / cron.dinstall
index 09e9c9b10a2844e76f8fa5fffe7ca2d3df26573b..fe546cabd2d5234aa367e5bbfaa0a347d0db7268 100755 (executable)
@@ -71,17 +71,17 @@ function stage() {
     ARGS='GO[@]'
     local "${!ARGS}"
 
-    error=${ERR:-"true"}
+    local error=${ERR:-"true"}
 
     ARGS=${ARGS:-""}
 
     log "########## DINSTALL BEGIN: ${FUNC} ${ARGS} ##########"
-    STAGEFILE="${stagedir}/${FUNC}_${ARGS}"
+    local STAGEFILE="${stagedir}/${FUNC}_${ARGS}"
     STAGEFILE=${STAGEFILE// /_}
     if [ -f "${STAGEFILE}" ]; then
-        stamptime=$(/usr/bin/stat -c %Z "${STAGEFILE}")
-        unixtime=$(date +%s)
-        difference=$(( $unixtime - $stamptime ))
+        local stamptime=$(/usr/bin/stat -c %Z "${STAGEFILE}")
+        local unixtime=$(date +%s)
+        local difference=$(( $unixtime - $stamptime ))
         if [ ${difference} -ge 14400 ]; then
             log_error "Did already run ${FUNC}, stagefile exists, but that was ${difference} seconds ago. Please check."
         else