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