wok rev 20666
cookutils: patch to make correct packages database.
All packages.* and SliTaz Cooking on the Repology are affected.
All packages.* and SliTaz Cooking on the Repology are affected.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Sat Jan 19 13:41:36 2019 +0200 (2019-01-19) |
parents | 1a5b7ae238cf |
children | a18d2c96de51 |
files | cookutils/receipt cookutils/stuff/pkgdb-absolute.patch |
line diff
1.1 --- a/cookutils/receipt Wed Jan 16 13:39:16 2019 +0100 1.2 +++ b/cookutils/receipt Sat Jan 19 13:41:36 2019 +0200 1.3 @@ -20,6 +20,7 @@ 1.4 compile_rules() 1.5 { 1.6 sed -i 's|\. receipt|. ./receipt|' cook 1.7 + patch -p1 -i $stuff/pkgdb-absolute.patch 1.8 mkdir -p $DESTDIR/usr/bin $DESTDIR/etc/slitaz 1.9 make DESTDIR=$DESTDIR install 1.10 }
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/cookutils/stuff/pkgdb-absolute.patch Sat Jan 19 13:41:36 2019 +0200 2.3 @@ -0,0 +1,119 @@ 2.4 +Using the absolute paths is safer than using the relative ones, 2.5 +or using no paths at all. 2.6 + 2.7 +--- a/modules/pkgdb 2.8 ++++ b/modules/pkgdb 2.9 +@@ -50,8 +50,8 @@ 2.10 + { _ 'Cook pkgdb started: %s' "$(date "$(_ '+%%F %%R')")"; newline; } | dblog 2.11 + 2.12 + cd $PKGS 2.13 +-rm -f packages.* extra.list 2.14 +-touch packages.equiv 2.15 ++rm -f $PKGS/packages.* $PKGS/extra.list 2.16 ++touch $PKGS/packages.equiv 2.17 + 2.18 + _n 'Creating file "%s"' 'packages.list' | dblog 2.19 + ls -1 *.tazpkg | sed s'/.tazpkg//' > $PKGS/packages.list 2.20 +@@ -62,16 +62,16 @@ 2.21 + echo " ($(filesize $PKGS/packages.md5))" | dblog 2.22 + cp $PKGS/packages.md5 $PKGS/packages.toremove # list of unnecessary packages 2.23 + 2.24 +-md5sum packages.md5 | cut -d' ' -f1 > ID 2.25 +-( cat ./ID | tr $'\n' ' '; date -ur ./ID +%s ) > IDs # md5 and timestamp 2.26 ++md5sum $PKGS/packages.md5 | cut -d' ' -f1 > $PKGS/ID 2.27 ++( cat $PKGS/ID | tr $'\n' ' '; date -ur $PKGS/ID +%s ) > $PKGS/IDs # md5 and timestamp 2.28 + 2.29 + _n 'Creating file "%s"' 'descriptions.txt' | dblog 2.30 + rm $PKGS/descriptions.txt 2>/dev/null 2.31 + for i in $(ls $WOK | sort); do 2.32 + if [ -e "$WOK/$i/description.txt" ]; then 2.33 +- echo "$i" >> descriptions.txt 2.34 +- cat "$WOK/$i/description.txt" | sed 's|^$| |' >> descriptions.txt 2.35 +- echo >> descriptions.txt 2.36 ++ echo "$i" >> $PKGS/descriptions.txt 2.37 ++ cat "$WOK/$i/description.txt" | sed 's|^$| |' >> $PKGS/descriptions.txt 2.38 ++ echo >> $PKGS/descriptions.txt 2.39 + fi 2.40 + done 2.41 + echo " ($(filesize $PKGS/descriptions.txt))" | dblog 2.42 +@@ -81,9 +81,9 @@ 2.43 + cd $WOK 2.44 + for pkg in *; do 2.45 + unset_receipt 2.46 +- . $pkg/receipt 2.47 ++ . $WOK/$pkg/receipt 2.48 + # PACKED_SIZE and UNPACKED_SIZE are only in built receipt 2.49 +- [ -s $pkg/taz/*/receipt ] && . $pkg/taz/*/receipt 2.50 ++ [ -s $WOK/$pkg/taz/*/receipt ] && . $WOK/$pkg/taz/*/receipt 2.51 + 2.52 + if [ -f "$PKGS/$PACKAGE-$VERSION$EXTRAVERSION.tazpkg" ] || \ 2.53 + [ -f "$PKGS/$PACKAGE-$VERSION$EXTRAVERSION-$ARCH.tazpkg" ]; then 2.54 +@@ -125,7 +125,7 @@ 2.55 + done 2.56 + 2.57 + # files.list provides a list of all packages files. 2.58 +- cat $pkg/taz/*/files.list | sed s/^/"$pkg: \0"/ >> \ 2.59 ++ cat $WOK/$pkg/taz/*/files.list | sed s/^/"$pkg: \0"/ >> \ 2.60 + $PKGS/files.list 2.61 + 2.62 + # list of unnecessary packages 2.63 +@@ -167,38 +167,38 @@ 2.64 + 2.65 + # files.list.lzma 2.66 + _n 'Creating file "%s"' 'files.list.lzma' | dblog 2.67 +-touch files.list 2.68 ++touch $PKGS/files.list 2.69 + # pkgs.slitaz.org strongly depends on list sorted by packages names 2.70 +-lzma e files.list files.list.lzma 2.71 ++lzma e $PKGS/files.list $PKGS/files.list.lzma 2.72 + echo " ($(filesize $PKGS/files.list.lzma))" | dblog 2.73 + 2.74 + # Pre-sorting filenames causes 10% smaller resulting lzma file 2.75 + _n 'Creating file "%s"' 'files-list.lzma' | dblog 2.76 +-cat files.list | sort -k2 -o files.list.sorted 2.77 +-lzma e files.list.sorted files-list.lzma 2.78 +-rm -f files.list files.list.sorted 2.79 ++cat $PKGS/files.list | sort -k2 -o $PKGS/files.list.sorted 2.80 ++lzma e $PKGS/files.list.sorted $PKGS/files-list.lzma 2.81 ++rm -f $PKGS/files.list $PKGS/files.list.sorted 2.82 + echo " ($(filesize $PKGS/files-list.lzma))" | dblog 2.83 + 2.84 +-[ -e files.list.md5 ] && rm files.list.md5 2.85 +-md5sum files-list.lzma | cut -d' ' -f1 | tr -d $'\n' > files-list.md5 2.86 ++[ -e $PKGS/files.list.md5 ] && rm $PKGS/files.list.md5 2.87 ++md5sum $PKGS/files-list.lzma | cut -d' ' -f1 | tr -d $'\n' > $PKGS/files-list.md5 2.88 + 2.89 + # Make bundle to fast recharge 2.90 + _n 'Creating file "%s"' 'bundle.tar.lzma' | dblog 2.91 +-[ -f bundle.tar.lzma ] && rm bundle.tar.lzma 2.92 ++[ -f $PKGS/bundle.tar.lzma ] && rm $PKGS/bundle.tar.lzma 2.93 + # Make sure to get "mirrors" file 2.94 + until [ -e 'mirrors' ]; do 2.95 + wget -q http://mirror1.slitaz.org/mirrors 2.96 + echo -n '.' | dblog; sleep 5 2.97 + done 2.98 + # Make sure to get "extra.list" file 2.99 +-until [ -e 'extra.list' ]; do 2.100 +- wget -q -O extra.list http://mirror1.slitaz.org/packages/get.list 2.101 ++until [ -e $PKGS/extra.list ]; do 2.102 ++ wget -q -O $PKGS/extra.list http://mirror1.slitaz.org/packages/get.list 2.103 + echo -n '.' | dblog; sleep 5 2.104 + done 2.105 +-busybox tar -chaf bundle.tar.lzma \ 2.106 ++busybox tar -chaf $PKGS/bundle.tar.lzma \ 2.107 + mirrors extra.list files-list.md5 packages.info descriptions.txt \ 2.108 + packages.desc packages.md5 packages.txt packages.list packages.equiv 2.109 +-rm ./mirrors 2.110 ++rm $PKGS/mirrors 2.111 + echo " ($(filesize $PKGS/bundle.tar.lzma))" | dblog 2.112 + 2.113 + # Display some info. 2.114 +@@ -242,7 +242,7 @@ 2.115 + 2.116 + cd $live 2.117 + _ 'Starting to generate flavors...' | dblog 2.118 +-rm -f flavors.list *.flavor 2.119 ++rm -f $live/flavors.list $live/*.flavor 2.120 + for i in $flavors/*; do 2.121 + fl=$(basename $i) 2.122 + _ 'Packing flavor "%s"' "$fl" | dblog