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