office-gobmx/setup_native/scripts/downloadscript.sh
Michael Meeks 2b4fd2c89a re-base on ALv2 code. Includes:
Patches contributed by Pedro Giffuni:
    Avoid some uses of non portable #!/bin/bash in shell scripts.
    http://svn.apache.org/viewvc?view=revision&revision=1235297
    Reduce the dependencies on non standard GNU copy.
    http://svn.apache.org/viewvc?view=revision&revision=1238684
    Correct /usr/bin/env path.
    http://svn.apache.org/viewvc?view=revision&revision=1235619

    Complex Toolbar Controls Extension from the SDK
    Patches contributed by Ariel Constenla-Haile
    http://svn.apache.org/viewvc?view=revision&revision=1190390
    i118615 - make epm more verbose
    http://svn.apache.org/viewvc?view=revision&revision=1204288

    Patches contributed by Mathias Bauer (and others)
    gnumake4 work variously
    http://svn.apache.org/viewvc?view=revision&revision=1394707
    http://svn.apache.org/viewvc?view=revision&revision=1394326

    Patches contributed by Juergen Schmidt:
    jsc341: i117327: take care if no dependency node in current
    description exists, create one
    http://svn.apache.org/viewvc?view=revision&revision=1172101
    jsc341: i117327: add extra extension dependency check
    http://svn.apache.org/viewvc?view=revision&revision=1172098
    make initial branding changes
    http://svn.apache.org/viewvc?view=revision&revision=1231878

    Patches contributed by Ingo Schmidt
    native373: #i117733# no linux jre installation on 64 bit systems
    http://svn.apache.org/viewvc?view=revision&revision=1167536
    native373: ##164464# improve debian support
    http://svn.apache.org/viewvc?view=revision&revision=1167537

    Patch contribtued by Armin Le-Grand:
    Changed various aspects concerning usages of old vendor names
    http://svn.apache.org/viewvc?view=revision&revision=1293313

fix for neon webdav, remove coinmp bits, improve odk script,
cleanup & remove OS/2 conditionals, system ucpp fixes,
remove OS/2 conditionals, restore our license filenames.
2012-11-12 11:46:43 +00:00

104 lines
2.5 KiB
Bash

#!/bin/sh
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This file incorporates work covered by the following license notice:
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed
# with this work for additional information regarding copyright
# ownership. The ASF licenses this file to you under the Apache
# License, Version 2.0 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
linenum=LINENUMBERPLACEHOLDER
UNPACKDIR=/var/tmp/unpack_PRODUCTNAMEPLACEHOLDER
diskSpaceRequired=DISCSPACEPLACEHOLDER
checksum=CHECKSUMPLACEHOLDER
EXTRACTONLY="no"
if [ "$1" = "-x" ]
then
EXTRACTONLY=yes
fi
# Determining current platform
platform=`uname -s`
case $platform in
SunOS)
tail_prog="tail"
;;
Linux)
tail_prog="tail -n"
;;
*)
tail_prog="tail"
;;
esac
# Asking for the unpack directory
echo
echo "Select the directory in which to save the unpacked files. [$UNPACKDIR] "
read reply leftover
if [ "x$reply" != "x" ]
then
UNPACKDIR="$reply"
fi
if [ -d $UNPACKDIR ]; then
printf "Directory $UNPACKDIR already exists.\n"
printf "Please select a new directory name.\n"
exit 1
fi
# Unpacking
mkdir -m 700 $UNPACKDIR
diskSpace=`df -k $UNPACKDIR | $tail_prog -1 | awk '{if ( $4 ~ /%/) { print $3 } else { print $4 } }'`
if [ $diskSpace -lt $diskSpaceRequired ]; then
printf "The selected drive does not have enough disk space available.\n"
printf "PRODUCTNAMEPLACEHOLDER requires at least %s kByte.\n" $diskSpaceRequired
exit 1
fi
trap 'rm -rf $UNPACKDIR; exit 1' HUP INT QUIT TERM
if [ -x /usr/bin/sum ] ; then
echo "File is being checked for errors ..."
sum=`$tail_prog +$linenum $0 | /usr/bin/sum`
sum=`echo $sum | awk '{ print $1 }'`
if [ $sum != $checksum ]; then
echo "The download file appears to be corrupted. Please download PRODUCTNAMEPLACEHOLDER again."
exit 1
fi
fi
echo "Unpacking ..."
$tail_prog +$linenum $0 | (cd $UNPACKDIR; tar xf -)
echo "All files have been successfully unpacked."
if [ "$EXTRACTONLY" != "yes" ]
then
if [ -f $UNPACKDIR/setup ]
then
chmod 775 $UNPACKDIR/setup
$UNPACKDIR/setup
fi
fi
exit 0