# HG changeset patch # User Christopher Rogers # Date 1316142030 0 # Node ID 35572226bde480bf43e750d5bbba2cabfeeb3acc # Parent 4ce0eb0f92a38512bd3868be6c7212402683dc2f local-mirror: Fixed cook website to not build chroot if $PKGDIR folder doesn't exist. Made sure to sed out pkgs.slitaz.org if there is no $PKGDIR folder. Add attic to local doc.slitaz.org so you can see history of it. diff -r 4ce0eb0f92a3 -r 35572226bde4 initramfs/usr/bin/local-mirror --- a/initramfs/usr/bin/local-mirror Sat Sep 10 23:47:21 2011 +0000 +++ b/initramfs/usr/bin/local-mirror Fri Sep 16 03:00:30 2011 +0000 @@ -26,12 +26,17 @@ [ -d $SLITAZ_DIR/$version ] || mkdir -p $SLITAZ_DIR/$version [ -d $SLITAZ_DIR/repos ] || ln -sf $REPOS_DIR $SLITAZ_DIR/repos -[ -d $SLITAZ_DIR/$version/packages ] || ln -sf $PKGDIR $SLITAZ_DIR/$version/packages -[ -d $SLITAZ_DIR/$version/src ] || ln -sf $SRCDIR $SLITAZ_DIR/$version/src -[ -d $SLITAZ_DIR/src ] || ln -sf $SRCDIR $SLITAZ_DIR/src -[ -d $SLITAZ_DIR/packages ] || ln -sf $PKGDIR $SLITAZ_DIR/packages [ -d $SLITAZ_DIR/repos ] && REPOS_DIR="$SLITAZ_DIR/repos" +if [ -d $PKGDIR ]; then + [ -d $SLITAZ_DIR/$version/packages ] || ln -sf $PKGDIR $SLITAZ_DIR/$version/packages + [ -d $SLITAZ_DIR/packages ] || ln -sf $PKGDIR $SLITAZ_DIR/packages +fi +if [ -d $SRCDIR ]; then + [ -d $SLITAZ_DIR/$version/src ] || ln -sf $SRCDIR $SLITAZ_DIR/$version/src + [ -d $SLITAZ_DIR/src ] || ln -sf $SRCDIR $SLITAZ_DIR/src +fi + #repos folders for website PEOPLE_WWW_DIR="$REPOS_DIR/slitaz-forge/people" DOC_WWW_DIR="$REPOS_DIR/slitaz-forge/doc" @@ -51,6 +56,10 @@ VHOST_FILE="$VHOST_MIRROR_FILE" fi +if [ ! -d $PKGDIR ]; then + WWW="${WWW/pkg/}" + ADDRESS="${ADDRESS/pkg.slitaz.org}" +fi [ -d $REPOS_DIR ] || continue INCOMING_REPOSITORY="$COOKING/packages-incoming" @@ -95,11 +104,11 @@ doc) [ -d $DOC_WWW_DIR ] && cp -a $DOC_WWW_DIR $MAIN_WWW_DIR/doc [ -d /var/www/dokuwiki ] && cp -a /var/www/dokuwiki/* $MAIN_WWW_DIR/doc - VAR="index meta media pages" + VAR="index attic meta media pages" for i in $VAR; do [ -d $REPOS_DIR/slitaz-doc-wiki-data ] && cp -a $REPOS_DIR/slitaz-doc-wiki-data/$i $MAIN_WWW_DIR/doc/data done - [ -d $REPOS_DIR/slitaz-doc-wiki-data/plugins ] && cp -a $REPOS_DIR/slitaz-doc-wiki-data/plugins $MAIN_WWW_DIR/doc/lib + #[ -d $REPOS_DIR/slitaz-doc-wiki-data/plugins ] && cp -a $REPOS_DIR/slitaz-doc-wiki-data/plugins $MAIN_WWW_DIR/doc/lib chown root.root -R $MAIN_WWW_DIR/doc chmod 777 -R $MAIN_WWW_DIR/doc ;; @@ -171,12 +180,14 @@ [ -d /var/www/cooker ] && cp -a /var/www/cooker $MAIN_WWW_DIR/cook [ -f /usr/share/cook/header.html ] && cp -a /usr/share/cook/header.html $MAIN_WWW_DIR/cook/header.html if [ "$MKCHROOT" = "yes" ]; then - tazdev gen-chroot $version - [ -d $SLITAZ_DIR/$version/chroot ] && mkdir -p $SLITAZ_DIR/$version/chroot$(dirname $CRON_FILE) - [ -d $SLITAZ_DIR/$version/chroot ] && echo "0 */2 * * * /usr/bin/cooker" > $SLITAZ_DIR/$version/chroot${CRON_FILE} - [ -d $SLITAZ_DIR/$version/chroot ] && echo "$SLITAZ_DIR/$version/packages" > $SLITAZ_DIR/$version/chroot${LOCALSTATE}/mirror - mkdir -p $SLITAZ_DIR/$version/chroot${LOCALSTATE}/undigest/incoming - echo "$SLITAZ_DIR/$version/incoming" > $SLITAZ_DIR/$version/chroot${LOCALSTATE}/undigest/incoming/mirror + if [ -d $PKGDIR ]; then + tazdev gen-chroot $version + [ -d $SLITAZ_DIR/$version/chroot ] && mkdir -p $SLITAZ_DIR/$version/chroot$(dirname $CRON_FILE) + [ -d $SLITAZ_DIR/$version/chroot ] && echo "0 */2 * * * /usr/bin/cooker" > $SLITAZ_DIR/$version/chroot${CRON_FILE} + [ -d $SLITAZ_DIR/$version/chroot ] && echo "$SLITAZ_DIR/$version/packages" > $SLITAZ_DIR/$version/chroot${LOCALSTATE}/mirror + mkdir -p $SLITAZ_DIR/$version/chroot${LOCALSTATE}/undigest/incoming + echo "$SLITAZ_DIR/$version/incoming" > $SLITAZ_DIR/$version/chroot${LOCALSTATE}/undigest/incoming/mirror + fi fi [ -d $REPOS_DIR/wok-tank ] && ln -sf $REPOS_DIR/wok-tank $SLITAZ_DIR/$version/wok-hg #[ -d $REPOS_DIR/wok-tank ] && ln -sf $REPOS_DIR/wok-tank $SLITAZ_DIR/$version/wok