mrrl

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

system-config-zsh (2029B)


      1 #!/usr/bin/env pthbs-build
      2 #+busybox.d2d7aa00eac6ec561a10d126b1866f22e226a1276307466251e80fd8a4a1ebc7
      3 #+busybox-findutils.85b2328981df683d1ae7597eebdf3a332aa4241b936c0030fe3618cec1f4841a
      4 #+busybox-awk.4c3f8cc249ba35f1206fcaf2979bcfd66d09b117eeea4e6a939024825a542496
      5 #+zsh.bed9ea9a52d1f132b02ecfc77bfb4144826360a73e4b68c2b16e943a5e22c77e
      6 #@git:6dfbe33079e2f8c64c5daed29aa1ea3e7e3f2d59:system-config-zsh
      7 
      8 
      9 # - build script start -
     10 
     11 prefix=/home/ccx/versions/$pthbs_package
     12 dest=${pthbs_destdir%/}${prefix}
     13 cd 'system-config-zsh'
     14 
     15 
     16 mkdir -p "$dest/zsh"
     17 mv -v zsh-functions "$dest/zsh/site-functions"
     18 
     19 
     20 
     21 
     22 cd "$pthbs_destdir/home/ccx/versions/$pthbs_package"
     23 find -type d -o -print | awk -F/ '
     24 BEGIN {}
     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 == "keys" { link($0); next }
     44 $2 == "zsh" { link($0); next }
     45 $2 == "env" { link($0); next }
     46 $2 == "command" { link($0); next }
     47 $2 == "bin" { link(s1("command", $0)); next }
     48 
     49 $2 == "library.so" { link($0); next }
     50 $2 == "library" { link($0); next }
     51 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next }
     52 $2 == "lib" && $NF ~ /\.so(\..*)?$/ { link(s1("library.so", $0)); next }
     53 
     54 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next }
     55 
     56 $2 == "man" { link($0); next }
     57 $2 == "info" { link($0); next }
     58 $2 == "doc" { link($0); next }
     59 $2 == "icons" { link($0); next }
     60 $2 == "terminfo" { link($0); next }
     61 $2 == "data" { link($0); next }
     62 $2 == "include" { link($0); next }
     63 
     64 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" }
     65 
     66 END {
     67 	for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" }
     68 	for(fname in x) {
     69 		if(x[fname]) {
     70 			printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr"
     71 			exit 3
     72 		}
     73 	}
     74 }' >.install-links.new
     75 mv .install-links.new .install-links
     76