]> err.no Git - dak/commitdiff
scripts
authorJoerg Jaspert <joerg@debian.org>
Sun, 1 Nov 2009 20:49:04 +0000 (21:49 +0100)
committerJoerg Jaspert <joerg@debian.org>
Sun, 1 Nov 2009 20:49:04 +0000 (21:49 +0100)
move two scripts into functions of dinstall

Signed-off-by: Joerg Jaspert <joerg@debian.org>
config/debian/cron.dinstall
scripts/debian/mklslar [deleted file]
scripts/debian/mkmaintainers [deleted file]

index 200c7a646986cbf7b189a1d28a7c2dee3be5773a..384bf2433b4566ceaa2c2d6cb3cd6a55a4bcae10 100755 (executable)
@@ -285,12 +285,70 @@ function buildd_dir() {
     make_buildd_dir
 }
 
+function mklslar() {
+    cd $ftpdir
+
+    FILENAME=ls-lR
+
+    log "Removing any core files ..."
+    find -type f -name core -print0 | xargs -0r rm -v
+
+    log "Checking permissions on files in the FTP tree ..."
+    find -type f \( \! -perm -444 -o -perm +002 \) -ls
+    find -type d \( \! -perm -555 -o -perm +002 \) -ls
+
+    log "Checking symlinks ..."
+    symlinks -rd .
+
+    log "Creating recursive directory listing ... "
+    rm -f .${FILENAME}.new
+    TZ=UTC ls -lR > .${FILENAME}.new
+
+    if [ -r ${FILENAME}.gz ] ; then
+        mv -f ${FILENAME}.gz ${FILENAME}.old.gz
+        mv -f .${FILENAME}.new ${FILENAME}
+        rm -f ${FILENAME}.patch.gz
+        zcat ${FILENAME}.old.gz | diff -u - ${FILENAME} | gzip --rsyncable -9cfn - >${FILENAME}.patch.gz
+        rm -f ${FILENAME}.old.gz
+    else
+        mv -f .${FILENAME}.new ${FILENAME}
+    fi
+
+    gzip --rsyncable -9cfN ${FILENAME} >${FILENAME}.gz
+    rm -f ${FILENAME}
+}
+
+function mkmaintainers() {
+    log -n 'Creating Maintainers index ... '
+
+    cd $indices
+    dak make-maintainers ${scriptdir}/masterfiles/pseudo-packages.maintainers | \
+        sed -e "s/~[^  ]*\([   ]\)/\1/"  | awk '{printf "%-20s ", $1; for (i=2; i<=NF; i++) printf "%s ", $i; printf "\n";}' > .new-maintainers
+
+    set +e
+    cmp .new-maintainers Maintainers >/dev/null
+    rc=$?
+    set -e
+    if [ $rc = 1 ] || [ ! -f Maintainers ] ; then
+           log -n "installing Maintainers ... "
+           mv -f .new-maintainers Maintainers
+           gzip --rsyncable -9v <Maintainers >.new-maintainers.gz
+           mv -f .new-maintainers.gz Maintainers.gz
+    elif [ $rc = 0 ] ; then
+           log '(same as before)'
+           rm -f .new-maintainers
+    else
+           log cmp returned $rc
+           false
+    fi
+}
+
 function scripts() {
     log "Running various scripts from $scriptsdir"
     cd $scriptsdir
-    ./mkmaintainers
+    mkmaintainers
     ./copyoverrides
-    ./mklslar
+    mklslar
     ./mkfilesindices
     ./mkchecksums
 }
diff --git a/scripts/debian/mklslar b/scripts/debian/mklslar
deleted file mode 100755 (executable)
index 231f7f8..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/sh
-# Update the ls-lR.
-
-set -e
-. $SCRIPTVARS
-
-cd $ftpdir
-
-filename=ls-lR
-
-echo "Removing any core files ..."
-find -type f -name core -print0 | xargs -0r rm -v
-
-echo "Checking permissions on files in the FTP tree ..."
-find -type f \( \! -perm -444 -o -perm +002 \) -ls
-find -type d \( \! -perm -555 -o -perm +002 \) -ls
-
-echo "Checking symlinks ..."
-symlinks -rd .
-
-echo "Creating recursive directory listing ... "
-rm -f .$filename.new
-TZ=UTC ls -lR | grep -v Archive_Maintenance_In_Progress > .$filename.new
-
-if [ -r ${filename}.gz ] ; then
-  mv -f ${filename}.gz $filename.old.gz
-  mv -f .$filename.new $filename
-  rm -f $filename.patch.gz
-  zcat $filename.old.gz | diff -u - $filename | gzip --rsyncable -9cfn - >$filename.patch.gz
-  rm -f $filename.old.gz
-else
-  mv -f .$filename.new $filename
-fi
-
-gzip --rsyncable -9cfN $filename >$filename.gz
-rm -f $filename
diff --git a/scripts/debian/mkmaintainers b/scripts/debian/mkmaintainers
deleted file mode 100755 (executable)
index 41e8727..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-#! /bin/sh
-
-echo
-echo -n 'Creating Maintainers index ... '
-
-set -e
-. $SCRIPTVARS
-cd $base/misc/
-
-cd $indices
-dak make-maintainers ${scriptdir}/masterfiles/pseudo-packages.maintainers | sed -e "s/~[^  ]*\([   ]\)/\1/"  | awk '{printf "%-20s ", $1; for (i=2; i<=NF; i++) printf "%s ", $i; printf "\n";}' > .new-maintainers
-
-set +e
-cmp .new-maintainers Maintainers >/dev/null
-rc=$?
-set -e
-if [ $rc = 1 ] || [ ! -f Maintainers ] ; then
-       echo -n "installing Maintainers ... "
-       mv -f .new-maintainers Maintainers
-       gzip --rsyncable -9v <Maintainers >.new-maintainers.gz
-       mv -f .new-maintainers.gz Maintainers.gz
-elif [ $rc = 0 ] ; then
-       echo '(same as before)'
-       rm -f .new-maintainers
-else
-       echo cmp returned $rc
-       false
-fi