tazwok view update-repository @ rev 266

Fix auto-remove old sources; Add some warning messages when default behavior is not used; Add a new COOK_OPT: !repack_src (prevent repacking into tar.lzma); Add support for git/svn/mercurial into WGET_URL (syntax is WGET_URL="mercurial|ftp://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/3.1.7/linux-i686/xpi/ru.xpi"- or git| or subversion| - having the vcs package in BUILD_DEPENDS still needed), add BRANCH variable to optionaly specify a rev/tag/branch to use in this case; add better support for strange http/https/ftp URL: if WGET_URL doesn't contains TARBALL, downloaded file is named TARBALL (i.e.: WGET_URL=".../download?f=xyz&r=132" - in this case use TARBALL="pkg.tar.gz" will make things works and no more hack in receipt is needed); fs variable into genpkg_rules() is now absolute; fix a bug into source_receipt() which can cause downloading the wrong tarball (TARBALL was not unseted); Add clean-src command to remove old/unrelated-to-wok sources tarball; Fix: packages removed from wok are now deleted from repositories and files list, at check-incoming time for the ones into main repository; WARNING WARNING WARNING : this commit comes with an update-repository script which **should** be used on repositories builded with previous version of tazwok-experimental: update logs to make them compatible with new webserver command, move/remove sources and generate sources.list to make source repository consistent with new changes. usage is: update-repository LOCAL_REPOSITORY, i.e.: update-repository /home/slitaz/experimental. Even if don't use it will not leads to major problem, please do it.
author Antoine Bodin <gokhlayeh@slitaz.org>
date Sun Feb 13 23:38:35 2011 +0100 (2011-02-13)
parents
children 91fd51513c01
line source
1 #!/bin/sh
3 if ! [ "$1" ]; then
4 echo "Usage: update-repository LOCAL_REPOSITORY (i.e.: /home/slitaz/experimental)"
5 exit
6 fi
8 WOK=$1/wok
9 SOURCES_REPOSITORY=$1/src
10 LOG_DIR=$1/log
12 if [ -d "$WOK" ] && [ -d "$SOURCES_REPOSITORY" ] && [ -d "$LOG_DIR" ]; then
13 rm -f $SOURCES_REPOSITORY/sources.list
14 else
15 echo "$1 doesn't looks like a LOCAL_REPOSITORY: it doesn't contains one or several of theses directories:
16 * $WOK
17 * $SOURCES_REPOSITORY
18 * $LOG_DIR"
19 exit
20 fi
22 echo "Updating logs files..."
23 cd $LOG_DIR
24 for i in *.html; do
25 sed 's~file:///usr/share/slitaz/web~web~' -i $i
26 done
27 [ -L web ] || ln -s /usr/share/slitaz/web web
28 echo "Update done: you can now use 'tazwok webserver on' to add you're repository to webinterface.
29 If you use the path by default, it will be available at: http://localhost/vhosts/bb
30 This command need lighttpd & php installed to be used."
32 echo "
33 Changing sources pathes according new changes into tazwok-experimental and generating $SOURCES_REPOSITORY/sources.list."
34 cd $WOK
35 for i in *; do
36 unset PACKAGE SOURCE VERSION WGET_URL TARBALL
37 source $i/receipt
38 [ "$WGET_URL" ] || continue
39 # Check that source is at the good location; if not move it or remove it if it's a duplicate.
40 if [ "$SOURCE" ]; then
41 if [ -f "$SOURCES_REPOSITORY/$PACKAGE-$VERSION.tar.lzma" ]; then
42 if [ -f "$SOURCES_REPOSITORY/$SOURCE-$VERSION.tar.lzma" ]; then
43 rm $SOURCES_REPOSITORY/$PACKAGE-$VERSION.tar.lzma
44 else
45 mv $SOURCES_REPOSITORY/$PACKAGE-$VERSION.tar.lzma $SOURCES_REPOSITORY/$SOURCE-$VERSION.tar.lzma
46 fi
47 fi
48 fi
49 if [ -f $SOURCES_REPOSITORY/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma ]; then
50 echo -e "$PACKAGE:incoming\t${SOURCE:-$PACKAGE}-$VERSION.tar.lzma" >> $SOURCES_REPOSITORY/sources.list
51 elif [ -f "SOURCES_REPOSITORY/$TARBALL" ]; then
52 echo -e "$PACKAGE:incoming\t$TARBALL" >> $SOURCES_REPOSITORY/sources.list
53 fi
54 done
55 echo "Done."
56 echo "
57 You can check/purge old sources tarball and sources tarball unrelated to wok receipts using 'tazwok clean-src'"