mrrl

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

user-env (1809B)


      1 #!/usr/bin/env pthbs-build
      2 #+busybox.f4ef3d511c029095beda8d21dd48f7730bec63fb09792ca951402d6620338089
      3 #+execline.c89bee1b1207461afa2d2ab9250f0940a2a6bbca3e45bdd60037049a75f4adf9
      4 #+pthbs-banginstall.30ed98ef3fedfb6b25b3f58c27e845f123a22a756b37a5cd75764315bba23571
      5 #@sha256:664430d033e0b491a5ed90cb39cb17cddb57ac0be9f3f2bf014264f3c17d55df:user-env
      6 
      7 installdir="$pthbs_destdir//versions/$pthbs_package"
      8 mkdir -p "$installdir/command"
      9 chmod +x user-env
     10 pthbs-banginstall user-env "$installdir"
     11 
     12 cd "$pthbs_destdir/versions/$pthbs_package"
     13 find -type d -o -print | awk -F/ '
     14 BEGIN {
     15 	x["./command/user-env"]=1
     16 }
     17 
     18 function r1(s) {
     19 	sub("^[.]/[^/]*", ".", s)
     20 	return s
     21 }
     22 function s1(repl, s) {
     23 	sub("^[.]/[^/]*", "./"repl, s)
     24 	return s
     25 }
     26 function link(src) {
     27 	x[$0]=0
     28 	printf "%s\t%s\n", $0, src
     29 	printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
     30 }
     31 $1!="."{exit 1}
     32 
     33 
     34 $2 == "command" { link($0); next }
     35 $2 == "bin" { link(s1("command", $0)); next }
     36 
     37 $2 == "library.so" { link($0); next }
     38 $2 == "library" { link($0); next }
     39 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
     40 $2 == "lib" && $NF ~ /\.so(|\..*)$/ { link(s1("library.so", $0)); next }
     41 
     42 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next }
     43 
     44 $2 == "man" { link($0); next }
     45 $2 == "info" { link($0); next }
     46 $2 == "doc" { link($0); next }
     47 $2 == "icons" { link($0); next }
     48 $2 == "terminfo" { link($0); next }
     49 $2 == "data" { link($0); next }
     50 $2 == "include" { link($0); next }
     51 
     52 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
     53 
     54 END {
     55 	for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
     56 	for(fname in x) {
     57 		if(x[fname]) {
     58 			printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
     59 			exit 3
     60 		}
     61 	}
     62 }' >.install-links.new
     63 mv .install-links.new .install-links