confz (2449B)
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:c6aef8098d37a1773439117a5674bfc8662ef62b:confz 8 9 10 # - build script start - 11 12 prefix=/home/ccx/versions/$pthbs_package 13 dest=${pthbs_destdir%/}${prefix} 14 cd 'confz' 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 37 38 39 40 cd "$pthbs_destdir/home/ccx/versions/$pthbs_package" 41 find -type d -o -print | awk -F/ ' 42 BEGIN { 43 x["./command/confz"]=1 44 } 45 46 function r1(s) { 47 sub("^[.]/[^/]*", ".", s) 48 return s 49 } 50 function s1(repl, s) { 51 sub("^[.]/[^/]*", "./"repl, s) 52 return s 53 } 54 function link(src) { 55 x[$0]=0 56 printf "%s\t%s\n", $0, src 57 printf "genlinks >>%s\t%s<<\n", $0, src >>"/dev/stderr" 58 } 59 $1!="."{exit 1} 60 61 62 $2 == "vimfiles" { link($0); next } 63 64 $2 == "config" { link($0); next } 65 $2 == "keys" { link($0); next } 66 $2 == "zsh" { link($0); next } 67 $2 == "env" { link($0); next } 68 $2 == "command" { link($0); next } 69 $2 == "bin" { link(s1("command", $0)); next } 70 71 $2 == "library.so" { link($0); next } 72 $2 == "library" { link($0); next } 73 $2 == "lib" && $NF ~ /\.l?a$/ { link(s1("library", $0)); next } 74 $2 == "lib" && $NF ~ /\.so(\..*)?$/ { link(s1("library.so", $0)); next } 75 76 $2 == "share" && $3 ~ /^(info|man|doc|icons|terminfo)$/ { link(r1($0)); next } 77 78 $2 == "man" { link($0); next } 79 $2 == "info" { link($0); next } 80 $2 == "doc" { link($0); next } 81 $2 == "icons" { link($0); next } 82 $2 == "terminfo" { link($0); next } 83 $2 == "data" { link($0); next } 84 $2 == "include" { link($0); next } 85 86 { printf "genlinks ##%s## skipped\n", $0 >>"/dev/stderr" } 87 88 END { 89 for(fname in x) { printf "DEBUG: x[\"%s\"]=\"%s\"\n", fname, x[fname] >"/dev/stderr" } 90 for(fname in x) { 91 if(x[fname]) { 92 printf "ERROR: missing expected file \"%s\"\n", fname >"/dev/stderr" 93 exit 3 94 } 95 } 96 }' >.install-links.new 97 mv .install-links.new .install-links 98