mrrl

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

confz (2148B)


      1 #!/usr/bin/env pthbs-build
      2 #+busybox.3664b94c09ea6d35ce73985026762c142829e53fed4a38541af3afb00c37dd4a
      3 #+zsh.3d9297eaf146984d3769d01311c79c9bc450b0a35617f04b1e8260316348ba5a
      4 #+pthbs-banginstall.30523c8519a401f119f27afff8133facdef51d710f56d83426d446132f20f8e7
      5 #@git:c6aef8098d37a1773439117a5674bfc8662ef62b:confz
      6 
      7 : ${JOBS:=1}
      8 prefix=/versions/$pthbs_package
      9 pkgdir="$pthbs_destdir/$prefix"
     10 mkdir -p "$pkgdir/"
     11 cd 'confz'
     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/confz"]=1}
     33 
     34 function r1(s) {
     35 	sub("^[.]/[^/]*", ".", s)
     36 	return s
     37 }
     38 function s1(repl, s) {
     39 	sub("^[.]/[^/]*", "./"repl, s)
     40 	return s
     41 }
     42 function link(src) {
     43 	x[$0]=0
     44 	printf "%s\t%s\n", $0, src
     45 	printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr"
     46 }
     47 $1!="."{exit 1}
     48 
     49 
     50 $2 == "zsh" { link($0); next }
     51 $2 == "vimfiles" { link($0); next }
     52 $2 == "command" { link($0); next }
     53 $2 == "bin" { link(s1("command", $0)); next }
     54 
     55 $2 == "library.so" { link($0); next }
     56 $2 == "library" { link($0); next }
     57 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
     58 $2 == "lib" && $NF ~ /\.so(|\..*)$/ { link(s1("library.so", $0)); next }
     59 
     60 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next }
     61 
     62 $2 == "man" { link($0); next }
     63 $2 == "info" { link($0); next }
     64 $2 == "doc" { link($0); next }
     65 $2 == "icons" { link($0); next }
     66 $2 == "terminfo" { link($0); next }
     67 $2 == "data" { link($0); next }
     68 $2 == "include" { link($0); next }
     69 
     70 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
     71 
     72 END {
     73 	for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
     74 	for(fname in x) {
     75 		if(x[fname]) {
     76 			printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
     77 			exit 3
     78 		}
     79 	}
     80 }' >.install-links.new
     81 mv .install-links.new .install-links