mrrl

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

system-config-rc (2104B)


      1 #!/usr/bin/env pthbs-build
      2 #+busybox.ee3440974794767b833fd3299226771f170d3f8601cf225cb884f0a513db8ab3
      3 #+busybox-diffutils.c2ebcfcad050ad71b8e30322a463b5c009f254c7a42e95c627d32665e17134dc
      4 #+s6-rc.fecfa43aebb0615904e0e120b9ce8c0596c9b6c577611cbadc8fbaca75196ed9
      5 #+fileset.4e84d6846c9db82c5ad691b8a6b63b6364b367e84f9d1490b0942b3fa28f3737
      6 #+system-config.a07509c77688f6142e4a7335cf6938cea19acb56433c052507dcd638b4decf58
      7 
      8 def_prefix() {
      9 	prefix=/home/ccx/versions/$pthbs_package
     10 }
     11 def_dest() {
     12 	dest=${pthbs_destdir%/}//home/ccx/versions/$pthbs_package
     13 }
     14 def_dest
     15 
     16 src=/home/ccx/versions/system-config.a07509c77688f6142e4a7335cf6938cea19acb56433c052507dcd638b4decf58/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/home/ccx/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