openpkg/curl.sh

changeset 428
f880f219c566
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/openpkg/curl.sh	Tue Jul 31 12:23:42 2012 +0200
     1.3 @@ -0,0 +1,43 @@
     1.4 +##
     1.5 +##  curl.sh -- OpenPKG Tools "curl" command
     1.6 +##  Copyright (c) 2000-2012 OpenPKG GmbH <http://openpkg.com/>
     1.7 +##
     1.8 +##  This software is property of the OpenPKG GmbH, DE MUC HRB 160208.
     1.9 +##  All rights reserved. Licenses which grant limited permission to use,
    1.10 +##  copy, modify and distribute this software are available from the
    1.11 +##  OpenPKG GmbH.
    1.12 +##
    1.13 +##  THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
    1.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    1.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    1.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    1.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    1.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    1.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    1.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    1.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    1.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    1.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    1.24 +##  SUCH DAMAGE.
    1.25 +##
    1.26 +
    1.27 +#   determine path to OpenPKG instance
    1.28 +PREFIX="${OPENPKG_PREFIX}"
    1.29 +
    1.30 +#   determine curl and config
    1.31 +curl="$PREFIX/lib/openpkg/curl"
    1.32 +conf="$PREFIX/etc/openpkg/curlrc"
    1.33 +
    1.34 +#   remove user supplied -q option (ignore ~/.curlrc)
    1.35 +[ ".$1" = .-q ] && shift
    1.36 +
    1.37 +#   force -q option (ignore ~/.curlrc) and -f option (error checking)
    1.38 +set -- "-q" "-f" "$@"
    1.39 +
    1.40 +#   prepend --config <file> option if conf file is readable
    1.41 +declare -a a;
    1.42 +[ -r "$conf" ] && set -- "--config" "$conf" "$@"
    1.43 +
    1.44 +#   execute underlying application
    1.45 +exec $curl "$@"
    1.46 +

mercurial