system-config-zsh (2011B)
1 #!/usr/bin/env pthbs-build 2 #+busybox.539513a18a06a21e4660004fea30f3658959c5c7f54488b66b5fee7120b0c27c 3 #+busybox-findutils.3ba95afbbde5f39d6a3c0b17d82ff2e5350904cf19dd40acdf1c60ed126d3bda 4 #+busybox-awk.4ac003d165540d0084cd08c1386f136343851ef344ac5ff844769b058049d859 5 #+zsh.772fd1612660753e14672eca0c0b41e0c70ee5307ecffad9ceb0982872a7d569 6 #@git:6dfbe33079e2f8c64c5daed29aa1ea3e7e3f2d59:system-config-zsh 7 8 9 # - build script start - 10 11 prefix=/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/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