slitaz-modular rev 138
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.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Fri Sep 16 03:00:30 2011 +0000 (2011-09-16) |
parents | 4ce0eb0f92a3 |
children | fcf25c41152d |
files | initramfs/usr/bin/local-mirror |
line diff
1.1 --- a/initramfs/usr/bin/local-mirror Sat Sep 10 23:47:21 2011 +0000 1.2 +++ b/initramfs/usr/bin/local-mirror Fri Sep 16 03:00:30 2011 +0000 1.3 @@ -26,12 +26,17 @@ 1.4 1.5 [ -d $SLITAZ_DIR/$version ] || mkdir -p $SLITAZ_DIR/$version 1.6 [ -d $SLITAZ_DIR/repos ] || ln -sf $REPOS_DIR $SLITAZ_DIR/repos 1.7 -[ -d $SLITAZ_DIR/$version/packages ] || ln -sf $PKGDIR $SLITAZ_DIR/$version/packages 1.8 -[ -d $SLITAZ_DIR/$version/src ] || ln -sf $SRCDIR $SLITAZ_DIR/$version/src 1.9 -[ -d $SLITAZ_DIR/src ] || ln -sf $SRCDIR $SLITAZ_DIR/src 1.10 -[ -d $SLITAZ_DIR/packages ] || ln -sf $PKGDIR $SLITAZ_DIR/packages 1.11 [ -d $SLITAZ_DIR/repos ] && REPOS_DIR="$SLITAZ_DIR/repos" 1.12 1.13 +if [ -d $PKGDIR ]; then 1.14 + [ -d $SLITAZ_DIR/$version/packages ] || ln -sf $PKGDIR $SLITAZ_DIR/$version/packages 1.15 + [ -d $SLITAZ_DIR/packages ] || ln -sf $PKGDIR $SLITAZ_DIR/packages 1.16 +fi 1.17 +if [ -d $SRCDIR ]; then 1.18 + [ -d $SLITAZ_DIR/$version/src ] || ln -sf $SRCDIR $SLITAZ_DIR/$version/src 1.19 + [ -d $SLITAZ_DIR/src ] || ln -sf $SRCDIR $SLITAZ_DIR/src 1.20 +fi 1.21 + 1.22 #repos folders for website 1.23 PEOPLE_WWW_DIR="$REPOS_DIR/slitaz-forge/people" 1.24 DOC_WWW_DIR="$REPOS_DIR/slitaz-forge/doc" 1.25 @@ -51,6 +56,10 @@ 1.26 VHOST_FILE="$VHOST_MIRROR_FILE" 1.27 fi 1.28 1.29 +if [ ! -d $PKGDIR ]; then 1.30 + WWW="${WWW/pkg/}" 1.31 + ADDRESS="${ADDRESS/pkg.slitaz.org}" 1.32 +fi 1.33 [ -d $REPOS_DIR ] || continue 1.34 1.35 INCOMING_REPOSITORY="$COOKING/packages-incoming" 1.36 @@ -95,11 +104,11 @@ 1.37 doc) 1.38 [ -d $DOC_WWW_DIR ] && cp -a $DOC_WWW_DIR $MAIN_WWW_DIR/doc 1.39 [ -d /var/www/dokuwiki ] && cp -a /var/www/dokuwiki/* $MAIN_WWW_DIR/doc 1.40 - VAR="index meta media pages" 1.41 + VAR="index attic meta media pages" 1.42 for i in $VAR; do 1.43 [ -d $REPOS_DIR/slitaz-doc-wiki-data ] && cp -a $REPOS_DIR/slitaz-doc-wiki-data/$i $MAIN_WWW_DIR/doc/data 1.44 done 1.45 - [ -d $REPOS_DIR/slitaz-doc-wiki-data/plugins ] && cp -a $REPOS_DIR/slitaz-doc-wiki-data/plugins $MAIN_WWW_DIR/doc/lib 1.46 + #[ -d $REPOS_DIR/slitaz-doc-wiki-data/plugins ] && cp -a $REPOS_DIR/slitaz-doc-wiki-data/plugins $MAIN_WWW_DIR/doc/lib 1.47 chown root.root -R $MAIN_WWW_DIR/doc 1.48 chmod 777 -R $MAIN_WWW_DIR/doc 1.49 ;; 1.50 @@ -171,12 +180,14 @@ 1.51 [ -d /var/www/cooker ] && cp -a /var/www/cooker $MAIN_WWW_DIR/cook 1.52 [ -f /usr/share/cook/header.html ] && cp -a /usr/share/cook/header.html $MAIN_WWW_DIR/cook/header.html 1.53 if [ "$MKCHROOT" = "yes" ]; then 1.54 - tazdev gen-chroot $version 1.55 - [ -d $SLITAZ_DIR/$version/chroot ] && mkdir -p $SLITAZ_DIR/$version/chroot$(dirname $CRON_FILE) 1.56 - [ -d $SLITAZ_DIR/$version/chroot ] && echo "0 */2 * * * /usr/bin/cooker" > $SLITAZ_DIR/$version/chroot${CRON_FILE} 1.57 - [ -d $SLITAZ_DIR/$version/chroot ] && echo "$SLITAZ_DIR/$version/packages" > $SLITAZ_DIR/$version/chroot${LOCALSTATE}/mirror 1.58 - mkdir -p $SLITAZ_DIR/$version/chroot${LOCALSTATE}/undigest/incoming 1.59 - echo "$SLITAZ_DIR/$version/incoming" > $SLITAZ_DIR/$version/chroot${LOCALSTATE}/undigest/incoming/mirror 1.60 + if [ -d $PKGDIR ]; then 1.61 + tazdev gen-chroot $version 1.62 + [ -d $SLITAZ_DIR/$version/chroot ] && mkdir -p $SLITAZ_DIR/$version/chroot$(dirname $CRON_FILE) 1.63 + [ -d $SLITAZ_DIR/$version/chroot ] && echo "0 */2 * * * /usr/bin/cooker" > $SLITAZ_DIR/$version/chroot${CRON_FILE} 1.64 + [ -d $SLITAZ_DIR/$version/chroot ] && echo "$SLITAZ_DIR/$version/packages" > $SLITAZ_DIR/$version/chroot${LOCALSTATE}/mirror 1.65 + mkdir -p $SLITAZ_DIR/$version/chroot${LOCALSTATE}/undigest/incoming 1.66 + echo "$SLITAZ_DIR/$version/incoming" > $SLITAZ_DIR/$version/chroot${LOCALSTATE}/undigest/incoming/mirror 1.67 + fi 1.68 fi 1.69 [ -d $REPOS_DIR/wok-tank ] && ln -sf $REPOS_DIR/wok-tank $SLITAZ_DIR/$version/wok-hg 1.70 #[ -d $REPOS_DIR/wok-tank ] && ln -sf $REPOS_DIR/wok-tank $SLITAZ_DIR/$version/wok