mrrl

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

aat (2496B)


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