diff options
Diffstat (limited to 'build2/download')
-rwxr-xr-x | build2/download | 51 |
1 files changed, 30 insertions, 21 deletions
diff --git a/build2/download b/build2/download index 20081d3..be018a3 100755 --- a/build2/download +++ b/build2/download @@ -137,21 +137,6 @@ for pkg in "${!srcs[@]}"; do elif [ "$pkg" == "xsde-examples" -a -z "$examples_arch" ]; then examples_arch="$pkgf" fi - - # Make .zip archive for examples. - # - if [ -n "$(sed -rn -e 's/^.+-examples$/true/p' <<<"$pkg")" ]; then - pkgd="$pkg-$ver" - - if [ -d "$pkgd" ]; then - error "package directory $pkgd already exist" - fi - - info "repacking $pkgf" - tar -xf "$pkgf" - zip -9 -rq "$pkg-$ver.zip" "$pkgd" - rm -rf "$pkgd" - fi done done dirs["."]=true @@ -375,6 +360,13 @@ function create_arch () } if true; then +# If the xsde-<version>-rtsrc-unix.tar.xz archive is created (in the current +# directory), then also create symlinks to it in all subdirectories where the +# binary xsde packages/archives are downloaded to or created in, except for +# the Windows archives. +# +xsde_rtsrc_unix_arch= + for bk in "${!bins[@]}"; do bv="${bins[$bk]}" @@ -459,11 +451,12 @@ for bk in "${!bins[@]}"; do "" # windows # Note that we don't include the architecture into the resulting archive - # name since this is a source archive. + # name since this is a source archive. Also note that we create it in + # the current directory. # - dest_arch="$(sed -rn -e 's%^(.+/xsde-[^/]+)-x86_64-[^/]+$%\1-rtsrc-unix.tar.xz%p' <<<"$pkgf")" + xsde_rtsrc_unix_arch="$(sed -rn -e 's%^.+/(xsde-[^/]+)-x86_64-[^/]+$%\1-rtsrc-unix.tar.xz%p' <<<"$pkgf")" - create_arch "$dest_arch" "$pkgf" \ + create_arch "$xsde_rtsrc_unix_arch" "$pkgf" \ "" \ usr/local/share/doc/xsde \ usr/local/share/man/man1 \ @@ -490,14 +483,30 @@ for bk in "${!bins[@]}"; do dirs["$bv"]=true done + +# Create symlinks to xsde-<version>-rtsrc-unix.tar.xz, if present. +# +if [ -n "$xsde_rtsrc_unix_arch" ]; then + for bk in "${!bins[@]}"; do + pkg="$(sed -rn -e 's#^.+/.+/.+/(.+)/.+$#\1#p' <<<"$bk")" + win="$(sed -rn -e 's#^.+/(windows.*)/.+/.+/.+$#true#p' <<<"$bk")" + + if [ "$pkg" == "xsde" -a -z "$win" ]; then + bv="${bins[$bk]}" + + ln -s "$(sed -r -e 's/[^/]+/../g' <<<"$bv")/$xsde_rtsrc_unix_arch" \ + "$bv/$xsde_rtsrc_unix_arch" + fi + done +fi fi # Generate packages.sha256 # for d in "${!dirs[@]}"; do cd "$d" - rm -f "packages.sha256" - l="$(find . -maxdepth 1 -type f -printf '%P\n' | sort)" # Array-like. - sha256sum -b $l >"packages.sha256" + rm -f packages.sha256 + l="$(find -L . -maxdepth 1 -type f -printf '%P\n' | sort)" # Array-like. + sha256sum -b $l >packages.sha256 cd "$owd" done |