cookutils rev 1042

cook: copy(): better way to copy empty folders, exclude *.la from @dev; lighttpd/index.cgi: exclude *.la from @dev
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sat Mar 31 04:22:36 2018 +0300 (2018-03-31)
parents 9ea2c08af3ef
children 8e0d6c7541ec
files cook lighttpd/index.cgi
line diff
     1.1 --- a/cook	Mon Mar 26 23:46:58 2018 +0300
     1.2 +++ b/cook	Sat Mar 31 04:22:36 2018 +0300
     1.3 @@ -1482,7 +1482,7 @@
     1.4  				;;
     1.5  			@dev)
     1.6  				# Copy "developer files"
     1.7 -				sed -n '/\.h$/p; /\.hxx$/p; /\.a$/p; /\.la$/p; /\.pc$/p; /\.pri$/p; /bin\/.*-config$/p;
     1.8 +				sed -n '/\.h$/p; /\.hxx$/p; /\.a$/p; /\.pc$/p; /\.pri$/p; /bin\/.*-config$/p;
     1.9  					/\.m4$/p; /\.gir$/p; /\.typelib$/p; /\.vapi$/p; /\.deps$/p; /\.cmake$/p;
    1.10  					/\/Makefile.*/p; /\.inc$/p; /\/include\//p;
    1.11  					/\.so\.dbg$/p;
    1.12 @@ -1520,8 +1520,7 @@
    1.13  			@std)
    1.14  				while read j; do
    1.15  					case $j in
    1.16 -						# always skip empty man & doc folders, because this will end up
    1.17 -						# copying all the man pages and docs to the package
    1.18 +						# skip empty man & doc folders
    1.19  						*/man/*|*/doc/*) continue;;
    1.20  					esac
    1.21  					[ -z "$(ls -A "$install$j")" ] || continue
    1.22 @@ -1536,8 +1535,14 @@
    1.23  					done \
    1.24  					| tac \
    1.25  					| while read k; do
    1.26 -						# copy dir with its original ownership/permissions if it does not exist
    1.27 -						[ -d "$fs$k" ] || cp -a "$install$k" "$fs$k"
    1.28 +						# make dir if it does not exist
    1.29 +						if [ ! -d "$fs$k" ]; then
    1.30 +							# It's like "copy the directory without it's underlying content".
    1.31 +							# keep original ownership/permissions, access:
    1.32 +							install -d $(stat -c'-o%u -g%g -m%a' "$install$k") "$fs$k"
    1.33 +							# keep last-modified date:
    1.34 +							touch -r "$install$k" "$fs$k"
    1.35 +						fi
    1.36  					done
    1.37  				done < $folderlist
    1.38  				;;
     2.1 --- a/lighttpd/index.cgi	Mon Mar 26 23:46:58 2018 +0300
     2.2 +++ b/lighttpd/index.cgi	Sat Mar 31 04:22:36 2018 +0300
     2.3 @@ -1641,7 +1641,7 @@
     2.4  								printf("%s\n", $0);
     2.5  							}
     2.6  							/\/perllocal.pod$/ || /\/\.packlist$/ || /\/share\/bash-completion\// ||
     2.7 -								/\/lib\/systemd\// || /\.pyc$/ || /\.pyo$/ || /\/fonts\.scale$/ || /\/fonts\.dir$/ {
     2.8 +								/\/lib\/systemd\// || /\.pyc$/ || /\.pyo$/ || /\/fonts\.scale$/ || /\/fonts\.dir$/ || /\.la$/ {
     2.9  								tag("---", 0); next }
    2.10  							/\.pod$/  { tag("pod", 5); next }
    2.11  							/\/share\/man\// { tag("man", 5); next }
    2.12 @@ -1649,7 +1649,7 @@
    2.13  								/\/share\/devhelp\// { tag("doc", 5); next }
    2.14  							/\/share\/icons\// { tag("ico", 2); next }
    2.15  							/\/share\/locale\// { tag("loc", 4); next }
    2.16 -							/\.h$/ || /\.a$/ || /\.la$/ || /\.pc$/ || /\/bin\/.*-config$/ ||
    2.17 +							/\.h$/ || /\.a$/ || /\.pc$/ || /\/bin\/.*-config$/ ||
    2.18  								/\/Makefile.*$/ { tag("dev", 3); next }
    2.19  							/\/share\/help\// || /\/share\/appdata\// { tag("gnm", 6); next }
    2.20  							{ tag("???", 1) }