mrrl

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

system-config-scripts (2204B)


      1 #!/usr/bin/env pthbs-build
      2 #+busybox.3664b94c09ea6d35ce73985026762c142829e53fed4a38541af3afb00c37dd4a
      3 #+zsh.3d9297eaf146984d3769d01311c79c9bc450b0a35617f04b1e8260316348ba5a
      4 #+pthbs-banginstall.30523c8519a401f119f27afff8133facdef51d710f56d83426d446132f20f8e7
      5 #@git:dc793695cc0632a808af9d4415f3b0cf0f4dfba2:system-config-scripts
      6 
      7 : ${JOBS:=1}
      8 prefix=/versions/$pthbs_package
      9 pkgdir="$pthbs_destdir/$prefix"
     10 mkdir -p "$pkgdir/"
     11 cd 'system-config-scripts'
     12 
     13 for d in bin sbin command; do
     14 	if test -d "$d"; then
     15 		pthbs-banginstall "$d"/* "$pkgdir"
     16 	fi
     17 done
     18 
     19 if test -d vim; then
     20 	mkdir -p "$pkgdir/vimfiles/pack/plugins/start"
     21 	mv -v vim "$pkgdir/vimfiles/pack/plugins/start/$pthbs_package"
     22 fi
     23 
     24 if test -d zsh-functions; then
     25 	mkdir -p "$pkgdir/zsh"
     26 	mv -v zsh-functions "$pkgdir/zsh/site-functions"
     27 fi
     28 
     29 cd "$pthbs_destdir/versions/$pthbs_package"
     30 find -type d -o -print | awk -F/ '
     31 BEGIN {
     32 	x["./command/s"]=1
     33 	x["./command/issue-gen"]=1}
     34 
     35 function r1(s) {
     36 	sub("^[.]/[^/]*", ".", s)
     37 	return s
     38 }
     39 function s1(repl, s) {
     40 	sub("^[.]/[^/]*", "./"repl, s)
     41 	return s
     42 }
     43 function link(src) {
     44 	x[$0]=0
     45 	printf "%s\t%s\n", $0, src
     46 	printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
     47 }
     48 $1!="."{exit 1}
     49 
     50 
     51 $2 == "zsh" { link($0); next }
     52 $2 == "vimfiles" { link($0); next }
     53 $2 == "command" { link($0); next }
     54 $2 == "bin" { link(s1("command", $0)); next }
     55 
     56 $2 == "library.so" { link($0); next }
     57 $2 == "library" { link($0); next }
     58 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
     59 $2 == "lib" && $NF ~ /\.so(|\..*)$/ { link(s1("library.so", $0)); next }
     60 
     61 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next }
     62 
     63 $2 == "man" { link($0); next }
     64 $2 == "info" { link($0); next }
     65 $2 == "doc" { link($0); next }
     66 $2 == "icons" { link($0); next }
     67 $2 == "terminfo" { link($0); next }
     68 $2 == "data" { link($0); next }
     69 $2 == "include" { link($0); next }
     70 
     71 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
     72 
     73 END {
     74 	for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
     75 	for(fname in x) {
     76 		if(x[fname]) {
     77 			printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
     78 			exit 3
     79 		}
     80 	}
     81 }' >.install-links.new
     82 mv .install-links.new .install-links