pthbs

Packaging Through Hashed Build Scripts
git clone https://ccx.te2000.cz/git/pthbs
Log | Files | Refs | Submodules | README

system-config-rc (2068B)


      1 #!/usr/bin/env pthbs-build
      2 #+busybox.e60885fe93ee85c01831673bb29f0e62a64903f4ce3094e3dc35bc8ec8887ad9
      3 #+busybox-diffutils.4f5a07b29246414b77a7d71b103263af8f1249d75ddcbd9864e00def3d6feded
      4 #+s6-rc.456d312e5472776c96ad5765c069f6e675a30103431d58a9cc9b7fdfcd88ae74
      5 #+fileset.a274be52a358efbef7f42628a36ff98464608ab67d3bd4382323d60f9b854697
      6 #+system-config.5f52ec88f4f2f8d1c66bf4c35819c975b735d474a4141e96f2b0830c76ef3b98
      7 
      8 def_prefix() {
      9 	prefix=/versions/$pthbs_package
     10 }
     11 def_dest() {
     12 	dest=${pthbs_destdir%/}//versions/$pthbs_package
     13 }
     14 def_dest
     15 
     16 src=/versions/system-config.5f52ec88f4f2f8d1c66bf4c35819c975b735d474a4141e96f2b0830c76ef3b98/config/s6-rc-source
     17 s6-rc-compile ./s6-rc-db "$src"
     18 mkdir -p "$dest/config"
     19 mv -v s6-rc-db "$dest/config/"
     20 
     21 cd "$pthbs_destdir/versions/$pthbs_package"
     22 find -type d -o -print | awk -F/ '
     23 BEGIN {
     24 }
     25 
     26 function r1(s) {
     27 	sub("^[.]/[^/]*", ".", s)
     28 	return s
     29 }
     30 function s1(repl, s) {
     31 	sub("^[.]/[^/]*", "./"repl, s)
     32 	return s
     33 }
     34 function link(src) {
     35 	x[$0]=0
     36 	printf "%s\t%s\n", $0, src
     37 	printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
     38 }
     39 $1!="."{exit 1}
     40 
     41 
     42 $2 == "config" { link($0); next }
     43 $2 == "command" { link($0); next }
     44 $2 == "bin" { link(s1("command", $0)); next }
     45 
     46 $2 == "library.so" { link($0); next }
     47 $2 == "library" { link($0); next }
     48 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
     49 $2 == "lib" && $NF ~ /\.so(|\..*)$/ { link(s1("library.so", $0)); next }
     50 
     51 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next }
     52 
     53 $2 == "man" { link($0); next }
     54 $2 == "info" { link($0); next }
     55 $2 == "doc" { link($0); next }
     56 $2 == "icons" { link($0); next }
     57 $2 == "terminfo" { link($0); next }
     58 $2 == "data" { link($0); next }
     59 $2 == "include" { link($0); next }
     60 
     61 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
     62 
     63 END {
     64 	for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
     65 	for(fname in x) {
     66 		if(x[fname]) {
     67 			printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
     68 			exit 3
     69 		}
     70 	}
     71 }' >.install-links.new
     72 mv .install-links.new .install-links