]> git.donarmstrong.com Git - dak.git/blobdiff - config/debian/cron.dinstall
dinstall
[dak.git] / config / debian / cron.dinstall
index 0fe0b1cf6528e1a71799d0c512943bb0507ba05c..77f6ab11adbf7b07dbe07d92d101efc025c5b006 100755 (executable)
@@ -329,11 +329,39 @@ function mkmaintainers() {
     fi
 }
 
+function copyoverrides() {
+    log 'Copying override files into public view ...'
+
+    for f in $copyoverrides ; do
+           cd $overridedir
+           chmod g+w override.$f
+
+           cd $indices
+           rm -f .newover-$f.gz
+           pc="`gzip 2>&1 -9nv <$overridedir/override.$f >.newover-$f.gz`"
+           set +e
+           nf=override.$f.gz
+           cmp -s .newover-$f.gz $nf
+           rc=$?
+           set -e
+        if [ $rc = 0 ]; then
+                   rm -f .newover-$f.gz
+           elif [ $rc = 1 -o ! -f $nf ]; then
+                   echo "   installing new $nf $pc"
+                   mv -f .newover-$f.gz $nf
+                   chmod g+w $nf
+           else
+                   echo $? $pc
+                   exit 1
+           fi
+    done
+}
+
 function scripts() {
     log "Running various scripts from $scriptsdir"
     cd $scriptsdir
     mkmaintainers
-    ./copyoverrides
+    copyoverrides
     mklslar
     ./mkfilesindices
     ./mkchecksums
@@ -565,6 +593,9 @@ function stage() {
     # Make sure we are always at the same place.
     cd ${configdir}
 
+    # We always use the same umask. If a function wants to do different, fine, but we reset.
+    umask 022
+
     touch "${STAGEFILE}"
 
     if [ -n "${TIME}" ]; then
@@ -607,6 +638,13 @@ else
     MAILTO=${MAILTO:-"ftpmaster@debian.org"}
 fi
 
+# Make sure we start out with a sane umask setting
+umask 022
+
+# And use one locale, no matter what the caller has set
+export LANG=C
+export LC_ALL=C
+
 # How many logfiles to keep
 LOGROTATE=${LOGROTATE:-400}