# HG changeset patch # User Aleksej Bobylev # Date 1501151917 -10800 # Node ID 4802158453e16ee1acc125904bcbd12ed630cdb2 # Parent 8d3e8fb0dbf3f438a3b913c47f26f77679890f49 Minor bug fixes due to the change in the behavior of the dot command in Busybox-1.27; support "release checksum" in modules/mkdb. diff -r 8d3e8fb0dbf3 -r 4802158453e1 modules/bugs --- a/modules/bugs Thu Jul 20 22:40:46 2017 +0300 +++ b/modules/bugs Thu Jul 27 13:38:37 2017 +0300 @@ -24,7 +24,7 @@ for pkg in $LIST; do unset BUGS EXTRAVERSION - . "$pkg/receipt" + . ./$pkg/receipt if [ -n "$BUGS" ]; then MSG=$(_n 'Bug list completed') diff -r 8d3e8fb0dbf3 -r 4802158453e1 modules/check --- a/modules/check Thu Jul 20 22:40:46 2017 +0300 +++ b/modules/check Thu Jul 27 13:38:37 2017 +0300 @@ -68,7 +68,7 @@ ALL_DEPS="$ALL_DEPS$list " for i in $list; do [ -f "$i/receipt" ] || continue - deps="$(unset DEPENDS; . "$i/receipt"; echo $DEPENDS)" + deps="$(unset DEPENDS; . ./$i/receipt; echo $DEPENDS)" case " $deps " in *\ $pkg\ *) print_pkgname @@ -98,7 +98,7 @@ fi unset DEPENDS EXTRAVERSION - . "$PACKAGE/receipt" + . ./$PACKAGE/receipt if [ -s "$PACKAGE/modifiers" ]; then print_pkgname _ 'The package has been modified by:' @@ -143,7 +143,7 @@ for PACKAGE in $PACKAGES; do file="$PACKAGE/$CHECKSUM" CONFIG_FILES='' - . "$PACKAGE/receipt" + . ./$PACKAGE/receipt [ -s "$file" ] || continue while read md5 f; do [ -f "$f" ] || continue diff -r 8d3e8fb0dbf3 -r 4802158453e1 modules/get --- a/modules/get Thu Jul 20 22:40:46 2017 +0300 +++ b/modules/get Thu Jul 27 13:38:37 2017 +0300 @@ -254,7 +254,7 @@ fi # Add dependencies which was found to already defined dependencies - DEPENDS="$(unset DEPENDS; . "$PACKAGE-$VERSION/receipt"; echo $DEPENDS)" + DEPENDS="$(unset DEPENDS; . ./$PACKAGE-$VERSION/receipt; echo $DEPENDS)" TMP_DIR="$tmp_dir" for i in $(find_depends "$PACKAGE-$VERSION/fs"); do case " $DEPENDS " in @@ -425,7 +425,7 @@ # ROOT NOT USED local PKGS='/home/slitaz/packages' found='0' - [ -e "/etc/slitaz/cook.conf" ] && . "/etc/slitaz/cook.conf" + [ -e "/etc/slitaz/cook.conf" ] && . /etc/slitaz/cook.conf # Find local package pkgfile="$(awk -F$'\t' -vpkg="$1" -vbase="$PKGS" '{ diff -r 8d3e8fb0dbf3 -r 4802158453e1 modules/info --- a/modules/info Thu Jul 20 22:40:46 2017 +0300 +++ b/modules/info Thu Jul 27 13:38:37 2017 +0300 @@ -24,7 +24,7 @@ TMP_DIR=$(mktemp -d); cd "$TMP_DIR" cpio -F "$PKG" -i receipt >/dev/null 2>&1 - . receipt; rm -r "$TMP_DIR" + . ./receipt; rm -r "$TMP_DIR" STATE=$(_ 'local package') elif [ -d "$INSTALLED/$1" ]; then diff -r 8d3e8fb0dbf3 -r 4802158453e1 modules/install --- a/modules/install Thu Jul 20 22:40:46 2017 +0300 +++ b/modules/install Thu Jul 27 13:38:37 2017 +0300 @@ -113,7 +113,7 @@ DEPENDS=$( TMP_DIR=$(mktemp -d); cd "$TMP_DIR" cpio --quiet -i receipt >/dev/null 2>&1 - . receipt; echo $DEPENDS + . ./receipt; echo $DEPENDS rm -rf "$TMP_DIR" ) < "$1" @@ -200,7 +200,7 @@ [ -e "$pkgfile" ] || continue # Extract receipt from each matched package cpio -F "$pkgfile" -i receipt >/dev/null 2>&1 - name=$(. receipt; echo $PACKAGE) + name=$(. ./receipt; echo $PACKAGE) [ "$name" == "$pkg" ] && found='1' && break # Install the first matched package: normally there is only one package # with the $PACKAGE matched in the receipt @@ -663,7 +663,7 @@ PACKAGE=$( tmp_dir=$(mktemp -d); cd "$tmp_dir" cpio --quiet -i receipt >/dev/null 2>&1 - . receipt; echo $PACKAGE + . ./receipt; echo $PACKAGE rm -rf "$tmp_dir" ) < "$1" diff -r 8d3e8fb0dbf3 -r 4802158453e1 modules/mkdb --- a/modules/mkdb Thu Jul 20 22:40:46 2017 +0300 +++ b/modules/mkdb Thu Jul 27 13:38:37 2017 +0300 @@ -27,7 +27,8 @@ # 6: tags (space-separated) # 7: packed and unpacked sizes (space-separated) in human readable format # 8: depends -# 9: checksum +# 9: "release checksum" +#10: provide # packages.equiv # -------------- @@ -60,6 +61,12 @@ # First field is package name, second field is file path. # There are DB records for all files installed with the package. +# packages.md5 +#------------- +# Record is line; field separator is " ". +# First field is md5sum of the package file; second field is package file name. +# Actually, the type of checksum defined in variable $SUM and defaults to "md5". + # Connect function libraries . /lib/libtaz.sh @@ -87,6 +94,7 @@ # DB file names DBi="$folder/packages.info" DBe="$folder/packages.equiv" +DBm="$folder/packages.$SUM" DBd="$folder/descriptions.txt" DBf="$folder/files.list" @@ -94,6 +102,7 @@ if [ -n "$forced" ]; then [ -e "$DBi" ] && rm "$DBi" [ -e "$DBe" ] && rm "$DBe" + [ -e "$DBm" ] && rm "$DBm" [ -e "$DBd" ] && rm "$DBd" [ -e "$DBf.lzma" ] && rm "$DBf.lzma" fi @@ -108,7 +117,7 @@ # Make temporary list of packages checksum (usually md5sum) _n 'Calculate %s...' "$CHECKSUM" -cd "$folder"; $CHECKSUM *.tazpkg > "$tempd/$SUM" +cd "$folder"; $CHECKSUM *.tazpkg | tee "$tempd/$SUM" > "$DBm" status cd "$tempd" @@ -118,21 +127,30 @@ # Current processed package echo -n "$pkgfile" - # Extract receipt from package - cpio -F "$folder/$pkgfile" -i receipt >/dev/null 2>&1 + # Extract $CHECKSUM, receipt, description.txt from package + # (description.txt may absent, no error produced) + cpio -F "$folder/$pkgfile" -i $CHECKSUM receipt description.txt >/dev/null 2>&1 + + # Make "release checksum" + cp $CHECKSUM rsum_file + md5sum receipt >> rsum_file + [ -e "description.txt" ] && md5sum description.txt >> rsum_file + rsum=$(md5sum rsum_file | awk '{print $1}') # Unset variables that may absent in the receipt unset EXTRAVERSION TAGS DEPENDS PROVIDE # Get values - . receipt; rm receipt + . ./receipt + # Clean + rm -f $CHECKSUM receipt description.txt rsum_file 2>/dev/null # Make packages.info echo -en "$PACKAGE\t$VERSION$EXTRAVERSION\t$CATEGORY\t" >> "$DBi" echo -en "$SHORT_DESC\t$WEB_SITE\t$TAGS\t" >> "$DBi" echo -en "$PACKED_SIZE $UNPACKED_SIZE\t" | sed 's|\.0||g' >> "$DBi" - echo -n $DEPENDS$'\t' >> "$DBi" - echo $pkgsum >> "$DBi" + echo -n $DEPENDS$'\t' >> "$DBi" + echo -e "$rsum\t$PROVIDE" >> "$DBi" # Make packages.equiv diff -r 8d3e8fb0dbf3 -r 4802158453e1 modules/pack --- a/modules/pack Thu Jul 20 22:40:46 2017 +0300 +++ b/modules/pack Thu Jul 27 13:38:37 2017 +0300 @@ -28,7 +28,7 @@ # Create files.list with redirecting find output. action 'Creating the list of files...' cd fs -find . -type f -print > ../files.list +find . -type f -print > ../files.list find . -type l -print >> ../files.list cd ..; sed -i s/'^.'/''/ files.list status