]> git.deb.at Git - deb/packages.git/commitdiff
Create a directory suitable for mirroring the site
authorFrank Lichtenheld <frank@lichtenheld.de>
Fri, 28 Nov 2008 10:34:05 +0000 (10:34 +0000)
committerFrank Lichtenheld <frank@lichtenheld.de>
Fri, 28 Nov 2008 10:34:05 +0000 (10:34 +0000)
This only includes all the data and code needed to run the
site, not to update it.

.gitignore
README.Mirror [new file with mode: 0644]
bin/create_mirror [new file with mode: 0755]
bin/daily.sed.in
conf/apache.conf.sed.in

index 87f52c229abbcd9dc4e952404657f91cd00c7ad5..ec4651513360637d2baa394a824d47a645563fea 100644 (file)
@@ -5,5 +5,6 @@ archive
 config.sh
 cache
 tmp
+mirror
 *~
 *.ttc
diff --git a/README.Mirror b/README.Mirror
new file mode 100644 (file)
index 0000000..479f459
--- /dev/null
@@ -0,0 +1,29 @@
+
+To only operate a mirror of packages.d.o, the following packages
+need to be installed:
+
+ liblocale-maketext-lexicon-perl
+ libi18n-acceptlanguage-perl
+ libnumber-format-perl
+ libcompress-zlib-perl
+ libhtml-parser-perl
+ libmldbm-perl
+ libtext-iconv-perl
+ libclass-accessor-perl
+ liburi-perl
+ libtemplate-perl
+ liblingua-stem-perl
+ libsearch-xapian-perl (bpo)
+
+ apache2-mpm-worker
+ libapache2-mod-perl2
+
+The following apache modules need to be active
+
+  rewrite
+  expires
+  perl
+  setenvif
+  alias
+  negotiation
+
diff --git a/bin/create_mirror b/bin/create_mirror
new file mode 100755 (executable)
index 0000000..da17e90
--- /dev/null
@@ -0,0 +1,58 @@
+#!/bin/bash
+
+set -e
+
+topdir="$1"
+[ -n "$topdir" -a -d "$topdir" ] || exit 1
+mirror="$topdir/mirror"
+
+mkdir -p "$mirror"
+
+STAMP=$(date "+%Y%m%d%H%M")
+new="$mirror/$STAMP"
+mkdir $new
+
+if lockfile -! -r2 -300 "$mirror/mirror.lock"
+then
+    echo "couldn't aquire mirror.lock in due time"
+    exit 1;
+fi
+
+mkdir -p "$new/cache"
+chmod 777 "$new/cache"
+
+cd "$new"
+ln -f "$topdir/config.sh"
+ln -f "$topdir/README.Mirror"
+
+mkdir -p "$new/bin"
+cd "$new/bin"
+ln -f "$topdir/bin/mod_perl-startup"
+
+mkdir -p "$new/conf"
+cd "$new/conf"
+ln -f "$topdir/conf/apache.conf"
+
+mkdir -p "$new/cgi-bin"
+cd "$new/cgi-bin"
+ln -f "$topdir/cgi-bin/dispatcher.pl"
+
+for d in lib files templates po www
+do
+  mkdir -p "$new/$d"
+  rsync -avH --link-dest "$topdir/$d" \
+      --exclude '*.new' --exclude '*.sed.in' \
+      --exclude '*.slices' --exclude '*~' \
+      --exclude '*.lock' --exclude '*.ttc' --exclude 'logs/' \
+      --exclude 'packages/*/' --exclude 'changelogs.*' \
+      --exclude 'changelogs/**/log' \
+      --exclude "/auto" --exclude "/Search" --exclude "/perl" \
+      --delete-excluded --delete-after \
+      "$topdir/$d/" "$new/$d/"
+done
+
+ln -sfT $new $mirror/current
+find $mirror -mindepth 1 -maxdepth 1 -not -name "${STAMP}" -type d -print0 \
+       | xargs --no-run-if-empty -0 rm -rf
+
+rm -f "$mirror/mirror.lock"
index 28c8333c24368fa295056d3fabefead8f2744da3..7207bfbd90bf16bf90aee43c4a8e46d2ec653ddd 100755 (executable)
@@ -53,3 +53,6 @@ else
     echo "couldn't aquire changelogs lock file in due time"
 fi
 date
+
+$topdir/bin/create_mirror $topdir
+date
index bb6c21fbe386515eda54f5559660a4a2200a1c49..a40858b549f8054198854d8bb0b13bcfea9268e2 100644 (file)
@@ -69,7 +69,7 @@
    ServerAdmin webmaster@debian.org
    DocumentRoot %TOPDIR%/www/
    ServerName %SITE%
-   ServerAlias newpackages.debian.org
+   ServerAlias packages-piatti.debian.org packages-powell.debian.org
    ErrorLog /var/log/apache2/%SITE%-error.log
    CustomLog /var/log/apache2/%SITE%-access.log combined