summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2013-12-18 14:53:27 -0500
committerOz Linden <oz@lindenlab.com>2013-12-18 14:53:27 -0500
commit05fa5e525b879f063b803198d4a7f555847d4134 (patch)
tree5630b6d8cce0cb4446431dba5560afb75b852887
parentba39f6e14fa46708bead3eff31a83c2ec2fbe2a2 (diff)
improve build.sh searches for additional package installers
-rwxr-xr-xbuild.sh60
1 files changed, 45 insertions, 15 deletions
diff --git a/build.sh b/build.sh
index ccc8476cea..1fd2cd802b 100755
--- a/build.sh
+++ b/build.sh
@@ -36,24 +36,59 @@ build_dir_CYGWIN()
echo build-vc100
}
+viewer_channel_suffix()
+{
+ local package_name="$1"
+ local suffix_var="${package_name}_viewer_channel_suffix"
+ local suffix=$(eval "echo \$${suffix_var}")
+ if [ "$suffix"x = ""x ]
+ then
+ echo ""
+ else
+ echo "_$suffix"
+ fi
+}
+
installer_Darwin()
{
- ls -1tr "$(build_dir_Darwin ${last_built_variant:-Release})/newview/"*"$additional_package_name"*.dmg 2>/dev/null | sed 1q
+ local package_name="$1"
+ local package_dir="$(build_dir_Darwin ${last_built_variant:-Release})/newview/"
+ local pattern=".*$(viewer_channel_suffix ${package_name})_[0-9]+_[0-9]+_[0-9]+_[0-9]+_i386\\.dmg\$"
+ # since the additional packages are built after the base package,
+ # sorting oldest first ensures that the unqualified package is returned
+ # even if someone makes a qualified name that duplicates the last word of the base name
+ local package=$(ls -1tr "$package_dir" 2>/dev/null | grep -E "$pattern" | head -n 1)
+ test "$package"x != ""x && echo "$package_dir/$package"
}
installer_Linux()
{
- ls -1tr "$(build_dir_Linux ${last_built_variant:-Release})/newview/"*"$additional_package_name"*.tar.bz2 2>/dev/null | grep -v symbols | sed 1q
+ local package_name="$1"
+ local package_dir="$(build_dir_Linux ${last_built_variant:-Release})/newview/"
+ local pattern=".*$(viewer_channel_suffix ${package_name})_[0-9]+_[0-9]+_[0-9]+_[0-9]+_i686\\.tar\\.bz2\$"
+ # since the additional packages are built after the base package,
+ # sorting oldest first ensures that the unqualified package is returned
+ # even if someone makes a qualified name that duplicates the last word of the base name
+ package=$(ls -1tr "$package_dir" 2>/dev/null | grep -E "$pattern" | head -n 1)
+ test "$package"x != ""x && echo "$package_dir/$package"
}
installer_CYGWIN()
{
- v=${last_built_variant:-Release}
- d=$(build_dir_CYGWIN $v)
- if [ -r "$d/newview/$additional_package_name$v/touched.bat" ]
+ local package_name="$1"
+ local variant=${last_built_variant:-Release}
+ local build_dir=$(build_dir_CYGWIN ${variant})
+ local package_dir
+ if [ "$package_name"x = ""x ]
+ then
+ package_dir="${build_dir}/newview/${variant}"
+ else
+ package_dir="${build_dir}/newview/${package_name}/${variant}"
+ fi
+ if [ -r "${package_dir}/touched.bat" ]
then
- p=$(sed 's:.*=::' "$d/newview/$additional_package_name$v/touched.bat")
- echo "$d/newview/$additional_package_name$v/$p"
+ local package_file=$(sed 's:.*=::' "${package_dir}/touched.bat")
+ echo "${package_dir}/${package_file}"
fi
}
@@ -275,7 +310,7 @@ then
if $build_viewer_deb && [ "$last_built_variant" == "Release" ]
then
begin_section "Build Viewer Debian Package"
- local have_private_repo=false
+ have_private_repo=false
# mangle the changelog
dch --force-bad-version \
--distribution unstable \
@@ -362,19 +397,14 @@ then
# Upload additional packages.
for package_id in $additional_packages
do
- case $arch in
- CYGWIN) export additional_package_name="$package_id/" ;;
- *) export additional_package_name=$package_id ;;
- esac
- package=$(installer_$arch)
+ package=$(installer_$arch "$package_id")
if [ x"$package" != x ]
then
upload_item installer "$package" binary/octet-stream
else
- record_failure "Failed to upload $package_id package ($package::$additional_package_name)."
+ record_failure "Failed to find additional package for '$package_id'."
fi
done
- export additional_package_name=""
case "$last_built_variant" in
Release)