# HG changeset patch # User Antoine Bodin # Date 1297700363 -3600 # Node ID 4798e247d453d31566290c7b52712d19b1a9864f # Parent 91fd51513c01f4e3f9ba9d50a4db48e8175620a2 Append both main: & incoming: when both packages exists; using packages.desc instead of package name to check for main package (allow to find thoses with extraversion). diff -r 91fd51513c01 -r 4798e247d453 update-repository --- a/update-repository Mon Feb 14 05:53:20 2011 +0000 +++ b/update-repository Mon Feb 14 17:19:23 2011 +0100 @@ -9,24 +9,27 @@ SOURCES_REPOSITORY=$1/src LOG_DIR=$1/log PACKAGES_REPOSITORY=$1/packages +INCOMING_REPOSITORY=$1/packages-incoming -if [ -d "$WOK" ] && [ -d "$SOURCES_REPOSITORY" ] && [ -d "$LOG_DIR" ] && [ -d "$PACKAGES_REPOSITORY" ]; then +if [ -d "$WOK" ] && [ -d "$SOURCES_REPOSITORY" ] && [ -d "$LOG_DIR" ] && \ + [ -d "$PACKAGES_REPOSITORY" ] && [ -d "$INCOMING_REPOSITORY" ]; then rm -f $SOURCES_REPOSITORY/sources.list else echo "$1 doesn't looks like a LOCAL_REPOSITORY: it doesn't contains one or several of theses directories: * $WOK * $SOURCES_REPOSITORY * $PACKAGES_REPOSITORY + * $INCOMING_REPOSITORY * $LOG_DIR" exit fi echo "Updating logs files..." cd $LOG_DIR -for i in *.html; do - sed 's~file:///usr/share/slitaz/web~web~' -i $i -done -[ -L web ] || ln -s /usr/share/slitaz/web web +#for i in *.html; do +# sed 's~file:///usr/share/slitaz/web~web~' -i $i +#done +#[ -L web ] || ln -s /usr/share/slitaz/web web echo "Update done: you can now use 'tazwok webserver on' to add you're repository to webinterface. If you use the path by default, it will be available at: http://localhost/vhosts/bb This command need lighttpd & php installed to be used." @@ -48,13 +51,23 @@ fi fi fi - if [ -f $PACKAGES_REPOSITORY/$PACKAGE-$VERSION.tazpkg ]; then + if grep -q "^$PACKAGE | $VERSION" $PACKAGES_REPOSITORY/packages.desc; then + main_version="$VERSION" if [ -f $SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma ]; then echo -e "$PACKAGE:main\t${SOURCE:-$PACKAGE}-$VERSION.tar.lzma" >> $SOURCES_REPOSITORY/sources.list elif [ -f "SOURCES_REPOSITORY/$TARBALL" ]; then echo -e "$PACKAGE:main\t$TARBALL" >> $SOURCES_REPOSITORY/sources.list fi else + # May not works if package use extraversion. + main_version=$(grep -m1 -A1 -sh ^$PACKAGE$ $PACKAGES_REPOSITORY/packages.txt | tail -1 | sed 's/ *//') + if [ -f $SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-$main_version.tar.lzma ]; then + echo -e "$PACKAGE:main\t${SOURCE:-$PACKAGE}-$main_version.tar.lzma" >> $SOURCES_REPOSITORY/sources.list + else + unset main_version + fi + fi + if [ ! "$main_version" ] || grep -q "^$PACKAGE | $VERSION" $INCOMING_REPOSITORY/packages.desc; then if [ -f $SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma ]; then echo -e "$PACKAGE:incoming\t${SOURCE:-$PACKAGE}-$VERSION.tar.lzma" >> $SOURCES_REPOSITORY/sources.list elif [ -f "SOURCES_REPOSITORY/$TARBALL" ]; then