mrrl

Minimal Reliable Reproducible Linux
git clone https://ccx.te2000.cz/git/mrrl
Log | Files | Refs | Submodules | README

system-config-rc (2068B)


      1 #!/usr/bin/env pthbs-build
      2 #+busybox.f4ef3d511c029095beda8d21dd48f7730bec63fb09792ca951402d6620338089
      3 #+busybox-diffutils.4a0933977737282afcd82b39d435b50946a700fe13472d24e4580a41fa852123
      4 #+s6-rc.c131bb99b2054bcd9705c5a5652822938265a8587a54d2894667b8b620815c7f
      5 #+fileset.7159458f5e8c9237e1e1708cafced263dd342d5fd24ccec97ae8092d9b1c5150
      6 #+system-config.ea7a2e91fcc6d965cf7b18948463885841c13d5b64e6bee1d73bea880dbb5f37
      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.ea7a2e91fcc6d965cf7b18948463885841c13d5b64e6bee1d73bea880dbb5f37/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