cookutils rev 1003

Properly handle EXTRAVERSION
author Aleksej Bobylev <al.bobylev@gmail.com>
date Tue Nov 07 10:38:12 2017 +0200 (2017-11-07)
parents 8190be7ad294
children abb9bcf54d48
files cook lighttpd/index.cgi modules/deps modules/mk_pkg_receipt
line diff
     1.1 --- a/cook	Mon Nov 06 02:53:05 2017 +0200
     1.2 +++ b/cook	Tue Nov 07 10:38:12 2017 +0200
     1.3 @@ -131,6 +131,20 @@
     1.4  # Paths used in receipt and by cook itself.
     1.5  
     1.6  set_paths() {
     1.7 +	# Kernel version is set from wok/linux or installed/linux-api-headers(wok-undigest)
     1.8 +	if [ -f "$WOK/linux/receipt" ]; then
     1.9 +		kvers=$(. $WOK/linux/receipt; echo $VERSION)
    1.10 +		kbasevers=$(echo $kvers | cut -d. -f1,2)
    1.11 +	elif [ -f "$INSTALLED/linux-api-headers/receipt" ]; then
    1.12 +		kvers=$(. $INSTALLED/linux-api-headers/receipt; echo $VERSION)
    1.13 +		kbasevers=$(echo $kvers | cut -d. -f1,2)
    1.14 +	fi
    1.15 +
    1.16 +	# Python version
    1.17 +	[ -f "$WOK/python/receipt" ] && pyvers=$(. $WOK/python/receipt; echo $VERSION)
    1.18 +	# Perl version for some packages needed it
    1.19 +	[ -f "$WOK/perl/receipt" ] && perlvers=$(. $WOK/perl/receipt; echo $VERSION)
    1.20 +
    1.21  	pkgdir="$WOK/$pkg"
    1.22  	. "$pkgdir/receipt"
    1.23  	basesrc="$pkgdir/source"
    1.24 @@ -156,20 +170,6 @@
    1.25  
    1.26  	[ -n "$SOURCE" ] && source_stuff="$WOK/$SOURCE/stuff"
    1.27  
    1.28 -	# Kernel version is set from wok/linux or installed/linux-api-headers(wok-undigest)
    1.29 -	if [ -f "$WOK/linux/receipt" ]; then
    1.30 -		kvers=$(. $WOK/linux/receipt; echo $VERSION)
    1.31 -		kbasevers=$(echo $kvers | cut -d. -f1,2)
    1.32 -	elif [ -f "$INSTALLED/linux-api-headers/receipt" ]; then
    1.33 -		kvers=$(. $INSTALLED/linux-api-headers/receipt; echo $VERSION)
    1.34 -		kbasevers=$(echo $kvers | cut -d. -f1,2)
    1.35 -	fi
    1.36 -
    1.37 -	# Python version
    1.38 -	[ -f "$WOK/python/receipt" ] && pyvers=$(. $WOK/python/receipt; echo $VERSION)
    1.39 -	# Perl version for some packages needed it
    1.40 -	[ -f "$WOK/perl/receipt" ] && perlvers=$(. $WOK/perl/receipt; echo $VERSION)
    1.41 -
    1.42  	# Old way compatibility.
    1.43  	_pkg="$install"
    1.44  }
    1.45 @@ -341,7 +341,7 @@
    1.46  	[ -d $WOK/$pkg/source ] && srcdir=$(du -sh $WOK/$pkg/source | awk '{print $1}' 2>/dev/null)
    1.47  	[ -n "$TARBALL" ] && srcsize=$(du -sh $SRC/$TARBALL | awk '{print $1}')
    1.48  
    1.49 -	_ 'Summary for: %s' "$PACKAGE $VERSION"
    1.50 +	_ 'Summary for: %s' "$PACKAGE $VERSION$EXTRAVERSION"
    1.51  	separator
    1.52  
    1.53  	# L10n: keep the same width of translations to get a consistent view
    1.54 @@ -358,10 +358,10 @@
    1.55  	separator -
    1.56  	pkgi=1
    1.57  	for i in $(all_names); do
    1.58 -		fs=$(du -sh $WOK/$pkg/taz/$i-$VERSION | awk '{print $1}')
    1.59 -		pkgname="$i-$VERSION.tazpkg"
    1.60 +		fs=$(du -sh $WOK/$pkg/taz/$i-$VERSION$EXTRAVERSION | awk '{print $1}')
    1.61 +		pkgname="$i-$VERSION$EXTRAVERSION.tazpkg"
    1.62  		size=$(ls -lh $PKGS/$pkgname | awk '{print $5}')
    1.63 -		files=$(wc -l < $WOK/$pkg/taz/$i-$VERSION/files.list)
    1.64 +		files=$(wc -l < $WOK/$pkg/taz/$i-$VERSION$EXTRAVERSION/files.list)
    1.65  		printf "%2d : %7s : %10s : %5s : %s\n" "$pkgi" "$fs" "$size" "$files" "$pkgname"
    1.66  		pkgi=$((pkgi + 1))
    1.67  	done
    1.68 @@ -1356,7 +1356,7 @@
    1.69  					/\/share\/bash-completion\//d; /\/lib\/systemd\//d;
    1.70  					/\/fonts\.scale$/d; /\/fonts\.dir$/d;
    1.71  					/\/share\/appdata\//d; /\/share\/help\//d;
    1.72 -					/\/share\/icons\/hicolor\/[1236][245][68]*x[1236][245][68]*\//d;	# 22, 24, 32, 64, 128, 256
    1.73 +					/\/share\/icons\/hicolor\/[12356][1245][268]*x[12356][1245][268]*\//d;	# 22, 24, 32, 64, 128, 256, 512
    1.74  					' $filelist
    1.75  				;;
    1.76  			@dev)
    1.77 @@ -1392,9 +1392,9 @@
    1.78  			@std)
    1.79  				while read j; do
    1.80  					case $j in
    1.81 -						# always skip empty man folders, because this will end up
    1.82 -						# copying all the man pages to the package
    1.83 -						*/man/*) continue;;
    1.84 +						# always skip empty man & doc folders, because this will end up
    1.85 +						# copying all the man pages and docs to the package
    1.86 +						*/man/*|*/doc/*) continue;;
    1.87  					esac
    1.88  					[ -z "$(ls -A "$install$j")" ] || continue
    1.89  					# directory $j is empty
     2.1 --- a/lighttpd/index.cgi	Mon Nov 06 02:53:05 2017 +0200
     2.2 +++ b/lighttpd/index.cgi	Tue Nov 07 10:38:12 2017 +0200
     2.3 @@ -684,13 +684,22 @@
     2.4  	echo '<div id="info">'
     2.5  	echo "<a class='button icon receipt$(active receipt stuff)' href='$base/$pkg/receipt'>receipt &amp; stuff</a>"
     2.6  
     2.7 +	# In the receipts $EXTRAVERSION is defined using $kvers, get it here [copy from 'cook' set_paths()]
     2.8 +	if [ -f "$wok/linux/receipt" ]; then
     2.9 +		kvers=$(. $wok/linux/receipt; echo $VERSION)
    2.10 +		kbasevers=$(echo $kvers | cut -d. -f1,2)
    2.11 +	elif [ -f "$INSTALLED/linux-api-headers/receipt" ]; then
    2.12 +		kvers=$(. $INSTALLED/linux-api-headers/receipt; echo $VERSION)
    2.13 +		kbasevers=$(echo $kvers | cut -d. -f1,2)
    2.14 +	fi
    2.15 +
    2.16  	unset WEB_SITE WANTED
    2.17  	. $wok/$pkg/receipt
    2.18  
    2.19  	[ -n "$WEB_SITE" ] &&
    2.20  		echo "<a class='button icon website' href='$WEB_SITE' target='_blank' rel='noopener noreferrer'>web site</a>"
    2.21  
    2.22 -	[ -f "$wok/$pkg/taz/$PACKAGE-$VERSION/receipt" ] &&
    2.23 +	[ -f "$wok/$pkg/taz/$PACKAGE-$VERSION$EXTRAVERSION/receipt" ] &&
    2.24  		echo "<a class='button icon files$(active files)' href='$base/$pkg/files'>files</a>"
    2.25  
    2.26  	[ -n "$(ls $wok/$pkg/description*.txt)" ] &&
     3.1 --- a/modules/deps	Mon Nov 06 02:53:05 2017 +0200
     3.2 +++ b/modules/deps	Tue Nov 07 10:38:12 2017 +0200
     3.3 @@ -173,6 +173,7 @@
     3.4  				s("xfconf", "libxfconf"); s("xfconf-dev", "libxfconf-dev");
     3.5  				s("exo",    "libexo");    s("exo-dev",    "libexo-dev");
     3.6  				s("gconf",  "GConf");     s("gconf-dev",  "GConf-dev");
     3.7 +				s("pulseaudio", "apulse");
     3.8  
     3.9  				# if called with "--incl": show all deps including glibc-base,
    3.10  				# gcc-lib-base, glibc-dev and gcc; otherwise hide them
     4.1 --- a/modules/mk_pkg_receipt	Mon Nov 06 02:53:05 2017 +0200
     4.2 +++ b/modules/mk_pkg_receipt	Tue Nov 07 10:38:12 2017 +0200
     4.3 @@ -17,10 +17,11 @@
     4.4  [ "${signature:0:1}" == '#' ] || signature='# SliTaz package receipt.'
     4.5  
     4.6  save="$(mktemp)"
     4.7 +# `$(echo ...)`: normalize whitespace (space, tab, newline and they combinations and repeats)
     4.8  cat > $save <<EOT
     4.9 -PACKAGE="$PACKAGE"; DEPENDS="$DEPENDS"; PROVIDE="$PROVIDE"
    4.10 -SUGGESTED="$SUGGESTED"; TAZPANEL_DAEMON="$TAZPANEL_DAEMON"
    4.11 -TAGS="$TAGS"
    4.12 +PACKAGE="$PACKAGE"; DEPENDS="$(echo $DEPENDS)"; PROVIDE="$(echo $PROVIDE)"
    4.13 +SUGGESTED="$(echo $SUGGESTED)"; TAZPANEL_DAEMON="$TAZPANEL_DAEMON"
    4.14 +TAGS="$(echo $TAGS)"
    4.15  EOT
    4.16  unset_receipt
    4.17  . "$orig_receipt"