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