# HG changeset patch # User Christopher Rogers # Date 1303269663 0 # Node ID 51467048ef4fdde3165776cad724478d4038410f # Parent 7259b3c242c8d489edcab5166334486fa61d40c6 Add support for my-wok repo. Fixed local.sh script up. diff -r 7259b3c242c8 -r 51467048ef4f initramfs/etc/init.d/local.sh --- a/initramfs/etc/init.d/local.sh Sat Apr 16 18:30:51 2011 +0000 +++ b/initramfs/etc/init.d/local.sh Wed Apr 20 03:21:03 2011 +0000 @@ -14,44 +14,4 @@ [ -x /usr/bin/gdk-pixbuf-query-loaders ] && /usr/bin/gdk-pixbuf-query-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders [ -x /usr/bin/update-mime-database ] && update-mime-database /usr/share/mime -list_udev_group() -{ - object=$1 - [ -n "$object" ] || object=GROUP - grep $object /etc/udev/rules.d/* | \ - sed "s/.*GROUP=\"\\([a-zA-Z0-9]*\\)\".*/\1/" | sort | uniq -} - -if [ -f $INSTALLED/udev/receipt ]; then - # Sanity check for udev+ldap boot - list_udev_group GROUP | while read x ; do - grep -q ^$x: /etc/group || addgroup -S $x - done - list_udev_group OWNER | while read x ; do - grep -q ^$x: /etc/passwd || adduser -S -D -H $x - done -fi - -if [ -f $INSTALLED/slim/receipt -o -f $INSTALLED/slim-pam/receipt ]; then - USER=$(awk -F: '/:1000:100:/ ' < /etc/passwd) - [ -n "$USER" ] && - sed -i s/"default_user .*"/"default_user $USER"/ /etc/slim.conf - unset USER -fi - -PKG_ORDER="$(find /mnt/live/mnt/* -name "packages-order.txt" -maxdepth 1)" -if [ -f $PKG_ORDER ]; then - for i in $(cat $PKG_ORDER); do - if [ -f $INSTALLED/$i/pkgmd5 ]; then - unset PACKAGE VERSION EXTRAVERSION - [ -f $INSTALLED/$i/receipt ] && source $INSTALLED/$i/receipt - if [ $(cat $LOCALSTATE/installed.md5 | grep -i " ${PACKAGE}-${VERSION}${EXTRAVERSION}.tazpkg") ]; then - sed -i "/ $PACKAGE-$VERSION${EXTRAVERSION}.tazpkg/d" $LOCALSTATE/installed.md5 - cat $INSTALLED/$i/pkgmd5 >> $LOCALSTATE/installed.md5 - else - cat $INSTALLED/$i/pkgmd5 >> $LOCALSTATE/installed.md5 - fi - fi - done -fi #[ -x /usr/bin/setup-live ] && /usr/bin/setup-live diff -r 7259b3c242c8 -r 51467048ef4f initramfs/usr/bin/local-mirror --- a/initramfs/usr/bin/local-mirror Sat Apr 16 18:30:51 2011 +0000 +++ b/initramfs/usr/bin/local-mirror Wed Apr 20 03:21:03 2011 +0000 @@ -16,6 +16,20 @@ exit 1 } +COOKORDER="$(find /mnt/live/mnt/* -name "cookorder.list" -maxdepth 1)" +CUR_PWD="$PWD" + +if [ -d $REPOS_DIR/my-wok ]; then + REPO_WOK=$REPOS_DIR/my-wok + if [ -x /usr/bin/hg ]; then + cd $REPO_WOK + hg update cooking + cd $CUR_PWD + fi +elif [ -d $REPOS_DIR/wok ]; then + REPO_WOK=$REPOS_DIR/wok +fi + if [ "$COMMAND" = "tank-only" ]; then WWW="${WWW/mirror/}" ADDRESS="${ADDRESS/mirror.slitaz.org/}" @@ -32,6 +46,8 @@ [ -d $MAIN_WWW_DIR ] || mkdir -p $MAIN_WWW_DIR [ -L /var/www/vhosts ] || ln -sf $MAIN_WWW_DIR /var/www/vhosts +INCOMING_REPOSITORY="$LOCAL_REPOSITORY/packages-incoming" + www() { b=$1 case "$b" in @@ -59,11 +75,34 @@ [ -d /usr/share/slitaz/web-bb ] && cp -a /usr/share/slitaz/web-bb $MAIN_WWW_DIR/bb #[ -d /usr/share/slitaz/web ] && cp -a /usr/share/slitaz/web $MAIN_WWW_DIR/bb/web [ -d $REPOS_DIR/website/pics ] && ln -sf $REPOS_DIR/website/pics $MAIN_WWW_DIR/bb/pics - [ -d $COOKING/wok ] || ln -sf $REPOS_DIR/wok $COOKING/clean-wok - [ -d $COOKING/wok ] || ln -sf $REPOS_DIR/wok $COOKING/wok - [ -d $STABLE/wok ] || ln -sf $REPOS_DIR/wok-stable $STABLE/clean-wok + [ -d $INCOMING_REPOSITORY ] || mkdir -p $INCOMING_REPOSITORY + [ -f $INCOMING_REPOSITORY/packages.desc ] || touch $INCOMING_REPOSITORY/packages.desc + [ -f $INCOMING_REPOSITORY/packages.equiv ] || touch $INCOMING_REPOSITORY/packages.equiv + [ -f $INCOMING_REPOSITORY/packages.list ] || touch $INCOMING_REPOSITORY/packages.list + [ -f $INCOMING_REPOSITORY/packages.md5 ] || touch $INCOMING_REPOSITORY/packages.md5 + [ -f $INCOMING_REPOSITORY/packages.txt ] || touch $INCOMING_REPOSITORY/packages.txt + tazwok gen-wok-db --WOK=$REPO_WOK + if [ -f $COOKORDER ]; then + [ -d $COOKING/wok ] || mkdir -p $COOKING/wok + [ -d $COOKING/clean-wok ] || mkdir -p $COOKING/clean-wok + cat $COOKORDER | while read pkg; do + rwanted=$(grep $'\t'$pkg$ $INCOMING_REPOSITORY/wok-wanted.txt | cut -f 1) + for i in $rwanted; do + [ -f $COOKING/clean-wok/$i/receipt ] || cp -a $REPO_WOK/$i $COOKING/clean-wok/$i + [ -f $COOKING/wok/$i/receipt ] || cp -a $REPO_WOK/$i $COOKING/wok/$i + done + [ -f $COOKING/clean-wok/$pkg/receipt ] || cp -a $REPO_WOK/$pkg $COOKING/clean-wok/$pkg + [ -f $COOKING/wok/$pkg/receipt ] || cp -a $REPO_WOK/$pkg $COOKING/wok/$pkg + done + unset i + tazwok gen-wok-db --WOK=$COOKING/clean-wok + else + [ -d $COOKING/clean-wok ] || ln -sf $REPO_WOK $COOKING/clean-wok + [ -d $COOKING/wok ] || ln -sf $REPO_WOK $COOKING/wok + fi + [ -d $STABLE/clean-wok ] || ln -sf $REPOS_DIR/wok-stable $STABLE/clean-wok [ -d $STABLE/wok ] || ln -sf $REPOS_DIR/wok-stable $STABLE/wok - [ -f $SRCDIR/sources.list ] || tazwok gen-src $SRCDIR + [ -f $SRCDIR/sources.list ] || tazwok gen-src $SRCDIR --WOK=$REPO_WOK [ -d $REPOS_DIR/slitaz-modular ] && ln -sf $REPOS_DIR/slitaz-modular $COOKING/slitaz-modular echo -e "$MAIN_WWW_DIR/bb" | tazwok webserver on ;; @@ -78,8 +117,8 @@ [ -d $STABLE ] || mkdir -p $STABLE [ -d $REPOS_DIR/flavors ] && ln -sf $REPOS_DIR/flavors $COOKING/flavors [ -d $REPOS_DIR/flavors-stable ] && ln -sf $REPOS_DIR/flavors-stable $STABLE/flavors - [ -d $COOKING/wok ] || ln -sf $REPOS_DIR/wok $COOKING/clean-wok - [ -d $STABLE/wok ] || ln -sf $REPOS_DIR/wok-stable $STABLE/clean-wok + #[ -d $COOKING/wok ] || ln -sf $REPOS_DIR/wok $COOKING/clean-wok + [ -d $STABLE/clean-wok ] || ln -sf $REPOS_DIR/wok-stable $STABLE/clean-wok [ -d $PKGDIR ] && ln -sf $PKGDIR $LOCAL_REPOSITORY/packages [ -d $SRCDIR ] && ln -sf $SRCDIR $LOCAL_REPOSITORY/src ;; @@ -93,6 +132,7 @@ [ -d $MAIN_WWW_DIR/slitaz/mirror/sources/packages/${i:0:1} ] || mkdir -p $MAIN_WWW_DIR/slitaz/mirror/sources/packages/${i:0:1} [ -f $MAIN_WWW_DIR/slitaz/mirror/sources/packages/${i:0:1}/$i ] || ln -s $SRCDIR/$i $MAIN_WWW_DIR/slitaz/mirror/sources/packages/${i:0:1}/$i done + unset i fi [ -d /var/www/slitaz ] || ln -sf $MAIN_WWW_DIR/slitaz /var/www/slitaz ;; @@ -165,7 +205,7 @@ [ "$repo" = "slitaz-tools" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc [ "$repo" = "slitaz-vz" ] && echo "contact = Eric Joseph-Alexandre" >> $REPOS_DIR/$repo/.hg/hgrc [ "$repo" = "tazlito" ] && echo "contact = Pascal Bellard" >> $REPOS_DIR/$repo/.hg/hgrc - [ "$repo" = "tazpanel" ] && echo "contact = Christophe Lincoln" >> $REPO_DIR/$repo/.hg/hgrc + [ "$repo" = "tazpanel" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc [ "$repo" = "tazpkg" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc [ "$repo" = "tazusb" ] && echo "contact = Eric Joseph-Alexandre" >> $REPOS_DIR/$repo/.hg/hgrc [ "$repo" = "tazwok" ] && echo "contact = Christophe Lincoln" >> $REPOS_DIR/$repo/.hg/hgrc diff -r 7259b3c242c8 -r 51467048ef4f mkiso.sh --- a/mkiso.sh Sat Apr 16 18:30:51 2011 +0000 +++ b/mkiso.sh Wed Apr 20 03:21:03 2011 +0000 @@ -49,7 +49,9 @@ PACKAGES_REPOSITORY="$LOCAL_REPOSITORY/packages" INCOMING_REPOSITORY="$LOCAL_REPOSITORY/packages-incoming" SOURCES_REPOSITORY="$LOCAL_REPOSITORY/src" -HG_LIST="flavors flavors-stable slitaz-base-files slitaz-boot-scripts slitaz-configs slitaz-dev-tools slitaz-doc slitaz-doc-wiki-data slitaz-forge slitaz-modular slitaz-pizza slitaz-tools tazlito tazpkg tazusb tazweb tazwok website wok wok-stable wok-tiny wok-undigest" +HG_LIST="flavors flavors-stable slitaz-base-files slitaz-boot-scripts slitaz-configs slitaz-dev-tools slitaz-doc slitaz-doc-wiki-data slitaz-forge slitaz-modular slitaz-pizza slitaz-tools tazlito tazpanel tazpkg tazusb tazweb tazwok website wok wok-stable wok-tiny wok-undigest" +MY_HG_LIST="my-wok" +MY_HG_URL="https://bitbucket.org/godane" error () { echo -e "\033[1;31;40m!!! \033[1;37;40m$@\033[1;0m"; } warn () { echo -e "\033[1;33;40m*** \033[1;37;40m$@\033[1;0m"; } @@ -310,7 +312,6 @@ if [ "${BACKUP_PACKAGES}" = "yes" ]; then [ -d $PKGISO_DIR ] && rm -r $PKGISO_DIR mkdir -p $PKGISO_DIR - WOK=${HG_DIR}/wok/home/slitaz/repos/wok info "Making cooking list based installed packages in union" # this is to filter out packages build by get- # packages that don't exist in repo or wok @@ -341,7 +342,7 @@ done for i in $(ls $WOK/$pkg/receipt); do - unset SOURCE TARBALL WANTED PACKAGE VERSION pkg_VERSION COOK_OPT + unset SOURCE TARBALL WANTED PACKAGE VERSION pkg_VERSION COOK_OPT WGET_URL source $i pkg_VERSION="$(grep -m1 -A1 ^$PACKAGE$ $PACKAGES_REPOSITORY/packages.txt | \ tail -1 | sed 's/ *//')" @@ -366,34 +367,34 @@ backup_src() { if [ "${BACKUP_PACKAGES}" = "yes" -a "${BACKUP_SOURCES}" = "yes" ]; then - [ -d $SOURCES_REPOSITORY ] || mkdir -p $SOURCES_REPOSITORY - [ -d $SRCISO_DIR ] && rm -r $SRCISO_DIR - mkdir -p $SRCISO_DIR - WOK=${HG_DIR}/wok/home/slitaz/repos/wok - cat $ISODIR/cookorder.list | grep -v "^#"| while read pkg; do - #rwanted=$(grep $'\t'$pkg$ $INCOMING_REPOSITORY/wok-wanted.txt | cut -f 1) - for i in $(ls $WOK/$pkg/receipt); do - unset SOURCE TARBALL WANTED PACKAGE VERSION COOK_OPT - source $i - { [ ! "$TARBALL" ] || [ ! "$WGET_URL" ] ; } && continue - if [ ! -f "$SOURCES_REPOSITORY/$TARBALL" ] && \ - [ ! -f "$SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma" ]; then - tazwok get-src $PACKAGE --nounpack - if [ -f "$SOURCES_REPOSITORY/$TARBALL" ]; then - ln -sf $SOURCES_REPOSITORY/$TARBALL $SRCISO_DIR/$TARBALL - elif [ -f "$SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma" ]; then - ln -sf $SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma $SRCISO_DIR/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma - fi - else - [ -f "$SOURCES_REPOSITORY/$TARBALL" ] && ln -sf $SOURCES_REPOSITORY/$TARBALL $SRCISO_DIR/$TARBALL - [ -f "$SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma" ] && ln -sf $SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma $SRCISO_DIR/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma + [ -d $SOURCES_REPOSITORY ] || mkdir -p $SOURCES_REPOSITORY + [ -d $SRCISO_DIR ] && rm -r $SRCISO_DIR + mkdir -p $SRCISO_DIR + cat $ISODIR/cookorder.list | grep -v "^#"| while read pkg; do + #rwanted=$(grep $'\t'$pkg$ $INCOMING_REPOSITORY/wok-wanted.txt | cut -f 1) + for i in $(ls $WOK/$pkg/receipt); do + unset SOURCE TARBALL WANTED PACKAGE VERSION COOK_OPT WGET_URL + source $i + #{ [ ! "$TARBALL" ] || [ ! "$WGET_URL" ] ; } && continue + [ "$WGET_URL" ] || continue + if [ ! -f "$SOURCES_REPOSITORY/$TARBALL" ] && \ + [ ! -f "$SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma" ]; then + tazwok get-src $PACKAGE --nounpack + if [ -f "$SOURCES_REPOSITORY/$TARBALL" ]; then + ln -sf $SOURCES_REPOSITORY/$TARBALL $SRCISO_DIR/$TARBALL + elif [ -f "$SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma" ]; then + ln -sf $SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma $SRCISO_DIR/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma fi - done + else + [ -f "$SOURCES_REPOSITORY/$TARBALL" ] && ln -sf $SOURCES_REPOSITORY/$TARBALL $SRCISO_DIR/$TARBALL + [ -f "$SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma" ] && ln -sf $SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma $SRCISO_DIR/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma + fi done - cd $SRCISO_DIR - info "Make md5sum file for sources" - find * -not -type d | grep -v md5sum | xargs md5sum > md5sum - cd $WORKING + done + cd $SRCISO_DIR + info "Make md5sum file for sources" + find * -not -type d | grep -v md5sum | xargs md5sum > md5sum + cd $WORKING fi } @@ -462,7 +463,7 @@ fi done fi - + if [ "$HG_LIST" != "" ]; then if [ "$COPY_HG" = "yes" ]; then for hg in $HG_LIST; do @@ -471,19 +472,30 @@ done fi fi - - if [ "${HG_LIST}" != "" ]; then - for hg in ${HG_LIST}; do - if [ -d "${MODULES_DIR}/${hg}" ]; then - squashfs_hg $hg + + if [ "$MY_HG_LIST" != "" ]; then + for my_hg in $MY_HG_LIST; do + HG_URL="$MY_HG_URL" + copy_hg $my_hg + WOK=${HG_DIR}/my-wok/home/slitaz/repos/my-wok + if [ -d $WOK/.hg ]; then + cd $WOK + hg update cooking + cd $PROFILE fi + squashfs_hg $my_hg done fi - + [ -d $SRCISO_DIR ] && rm -r $SRCISO_DIR [ -d $PKGISO_DIR ] && rm -r $PKGISO_DIR - if [ -d ${HG_DIR}/wok ]; then + if [ -d ${HG_DIR}/my-wok/home/slitaz/repos/my-wok/.hg ]; then + WOK=${HG_DIR}/my-wok/home/slitaz/repos/my-wok + backup_pkg + backup_src + elif [ -d ${HG_DIR}/wok/home/slitaz/repos/wok/.hg ]; then + WOK=${HG_DIR}/wok/home/slitaz/repos/wok backup_pkg backup_src fi