rev |
line source |
al@20666
|
1 Using the absolute paths is safer than using the relative ones,
|
al@20666
|
2 or using no paths at all.
|
al@20666
|
3
|
al@20666
|
4 --- a/modules/pkgdb
|
al@20666
|
5 +++ b/modules/pkgdb
|
al@20666
|
6 @@ -50,8 +50,8 @@
|
al@20666
|
7 { _ 'Cook pkgdb started: %s' "$(date "$(_ '+%%F %%R')")"; newline; } | dblog
|
al@20666
|
8
|
al@20666
|
9 cd $PKGS
|
al@20666
|
10 -rm -f packages.* extra.list
|
al@20666
|
11 -touch packages.equiv
|
al@20666
|
12 +rm -f $PKGS/packages.* $PKGS/extra.list
|
al@20666
|
13 +touch $PKGS/packages.equiv
|
al@20666
|
14
|
al@20666
|
15 _n 'Creating file "%s"' 'packages.list' | dblog
|
al@20666
|
16 ls -1 *.tazpkg | sed s'/.tazpkg//' > $PKGS/packages.list
|
al@20666
|
17 @@ -62,16 +62,16 @@
|
al@20666
|
18 echo " ($(filesize $PKGS/packages.md5))" | dblog
|
al@20666
|
19 cp $PKGS/packages.md5 $PKGS/packages.toremove # list of unnecessary packages
|
al@20666
|
20
|
al@20666
|
21 -md5sum packages.md5 | cut -d' ' -f1 > ID
|
al@20666
|
22 -( cat ./ID | tr $'\n' ' '; date -ur ./ID +%s ) > IDs # md5 and timestamp
|
al@20666
|
23 +md5sum $PKGS/packages.md5 | cut -d' ' -f1 > $PKGS/ID
|
al@20666
|
24 +( cat $PKGS/ID | tr $'\n' ' '; date -ur $PKGS/ID +%s ) > $PKGS/IDs # md5 and timestamp
|
al@20666
|
25
|
al@20666
|
26 _n 'Creating file "%s"' 'descriptions.txt' | dblog
|
al@20666
|
27 rm $PKGS/descriptions.txt 2>/dev/null
|
al@20666
|
28 for i in $(ls $WOK | sort); do
|
al@20666
|
29 if [ -e "$WOK/$i/description.txt" ]; then
|
al@20666
|
30 - echo "$i" >> descriptions.txt
|
al@20666
|
31 - cat "$WOK/$i/description.txt" | sed 's|^$| |' >> descriptions.txt
|
al@20666
|
32 - echo >> descriptions.txt
|
al@20666
|
33 + echo "$i" >> $PKGS/descriptions.txt
|
al@20666
|
34 + cat "$WOK/$i/description.txt" | sed 's|^$| |' >> $PKGS/descriptions.txt
|
al@20666
|
35 + echo >> $PKGS/descriptions.txt
|
al@20666
|
36 fi
|
al@20666
|
37 done
|
al@20666
|
38 echo " ($(filesize $PKGS/descriptions.txt))" | dblog
|
al@20666
|
39 @@ -81,9 +81,9 @@
|
al@20666
|
40 cd $WOK
|
al@20666
|
41 for pkg in *; do
|
al@20666
|
42 unset_receipt
|
al@20666
|
43 - . $pkg/receipt
|
al@20666
|
44 + . $WOK/$pkg/receipt
|
al@20666
|
45 # PACKED_SIZE and UNPACKED_SIZE are only in built receipt
|
al@20666
|
46 - [ -s $pkg/taz/*/receipt ] && . $pkg/taz/*/receipt
|
al@20666
|
47 + [ -s $WOK/$pkg/taz/*/receipt ] && . $WOK/$pkg/taz/*/receipt
|
al@20666
|
48
|
al@20666
|
49 if [ -f "$PKGS/$PACKAGE-$VERSION$EXTRAVERSION.tazpkg" ] || \
|
al@20666
|
50 [ -f "$PKGS/$PACKAGE-$VERSION$EXTRAVERSION-$ARCH.tazpkg" ]; then
|
al@20666
|
51 @@ -125,7 +125,7 @@
|
al@20666
|
52 done
|
al@20666
|
53
|
al@20666
|
54 # files.list provides a list of all packages files.
|
al@20666
|
55 - cat $pkg/taz/*/files.list | sed s/^/"$pkg: \0"/ >> \
|
al@20666
|
56 + cat $WOK/$pkg/taz/*/files.list | sed s/^/"$pkg: \0"/ >> \
|
al@20666
|
57 $PKGS/files.list
|
al@20666
|
58
|
al@20666
|
59 # list of unnecessary packages
|
al@20666
|
60 @@ -167,38 +167,38 @@
|
al@20666
|
61
|
al@20666
|
62 # files.list.lzma
|
al@20666
|
63 _n 'Creating file "%s"' 'files.list.lzma' | dblog
|
al@20666
|
64 -touch files.list
|
al@20666
|
65 +touch $PKGS/files.list
|
al@20666
|
66 # pkgs.slitaz.org strongly depends on list sorted by packages names
|
al@20666
|
67 -lzma e files.list files.list.lzma
|
al@20666
|
68 +lzma e $PKGS/files.list $PKGS/files.list.lzma
|
al@20666
|
69 echo " ($(filesize $PKGS/files.list.lzma))" | dblog
|
al@20666
|
70
|
al@20666
|
71 # Pre-sorting filenames causes 10% smaller resulting lzma file
|
al@20666
|
72 _n 'Creating file "%s"' 'files-list.lzma' | dblog
|
al@20666
|
73 -cat files.list | sort -k2 -o files.list.sorted
|
al@20666
|
74 -lzma e files.list.sorted files-list.lzma
|
al@20666
|
75 -rm -f files.list files.list.sorted
|
al@20666
|
76 +cat $PKGS/files.list | sort -k2 -o $PKGS/files.list.sorted
|
al@20666
|
77 +lzma e $PKGS/files.list.sorted $PKGS/files-list.lzma
|
al@20666
|
78 +rm -f $PKGS/files.list $PKGS/files.list.sorted
|
al@20666
|
79 echo " ($(filesize $PKGS/files-list.lzma))" | dblog
|
al@20666
|
80
|
al@20666
|
81 -[ -e files.list.md5 ] && rm files.list.md5
|
al@20666
|
82 -md5sum files-list.lzma | cut -d' ' -f1 | tr -d $'\n' > files-list.md5
|
al@20666
|
83 +[ -e $PKGS/files.list.md5 ] && rm $PKGS/files.list.md5
|
al@20666
|
84 +md5sum $PKGS/files-list.lzma | cut -d' ' -f1 | tr -d $'\n' > $PKGS/files-list.md5
|
al@20666
|
85
|
al@20666
|
86 # Make bundle to fast recharge
|
al@20666
|
87 _n 'Creating file "%s"' 'bundle.tar.lzma' | dblog
|
al@20666
|
88 -[ -f bundle.tar.lzma ] && rm bundle.tar.lzma
|
al@20666
|
89 +[ -f $PKGS/bundle.tar.lzma ] && rm $PKGS/bundle.tar.lzma
|
al@20666
|
90 # Make sure to get "mirrors" file
|
al@20666
|
91 until [ -e 'mirrors' ]; do
|
al@20666
|
92 wget -q http://mirror1.slitaz.org/mirrors
|
al@20666
|
93 echo -n '.' | dblog; sleep 5
|
al@20666
|
94 done
|
al@20666
|
95 # Make sure to get "extra.list" file
|
al@20666
|
96 -until [ -e 'extra.list' ]; do
|
al@20666
|
97 - wget -q -O extra.list http://mirror1.slitaz.org/packages/get.list
|
al@20666
|
98 +until [ -e $PKGS/extra.list ]; do
|
al@20666
|
99 + wget -q -O $PKGS/extra.list http://mirror1.slitaz.org/packages/get.list
|
al@20666
|
100 echo -n '.' | dblog; sleep 5
|
al@20666
|
101 done
|
al@20666
|
102 -busybox tar -chaf bundle.tar.lzma \
|
al@20666
|
103 +busybox tar -chaf $PKGS/bundle.tar.lzma \
|
al@20666
|
104 mirrors extra.list files-list.md5 packages.info descriptions.txt \
|
al@20666
|
105 packages.desc packages.md5 packages.txt packages.list packages.equiv
|
al@20666
|
106 -rm ./mirrors
|
al@20666
|
107 +rm $PKGS/mirrors
|
al@20666
|
108 echo " ($(filesize $PKGS/bundle.tar.lzma))" | dblog
|
al@20666
|
109
|
al@20666
|
110 # Display some info.
|
al@20666
|
111 @@ -242,7 +242,7 @@
|
al@20666
|
112
|
al@20666
|
113 cd $live
|
al@20666
|
114 _ 'Starting to generate flavors...' | dblog
|
al@20666
|
115 -rm -f flavors.list *.flavor
|
al@20666
|
116 +rm -f $live/flavors.list $live/*.flavor
|
al@20666
|
117 for i in $flavors/*; do
|
al@20666
|
118 fl=$(basename $i)
|
al@20666
|
119 _ 'Packing flavor "%s"' "$fl" | dblog
|