michael@428: ##
michael@428: ## curl.sh -- OpenPKG Tools "curl" command
michael@428: ## Copyright (c) 2000-2012 OpenPKG GmbH
michael@428: ##
michael@428: ## This software is property of the OpenPKG GmbH, DE MUC HRB 160208.
michael@428: ## All rights reserved. Licenses which grant limited permission to use,
michael@428: ## copy, modify and distribute this software are available from the
michael@428: ## OpenPKG GmbH.
michael@428: ##
michael@428: ## THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
michael@428: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@428: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@428: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@428: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@428: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@428: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@428: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@428: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@428: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@428: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@428: ## SUCH DAMAGE.
michael@428: ##
michael@428:
michael@428: # determine path to OpenPKG instance
michael@428: PREFIX="${OPENPKG_PREFIX}"
michael@428:
michael@428: # determine curl and config
michael@428: curl="$PREFIX/lib/openpkg/curl"
michael@428: conf="$PREFIX/etc/openpkg/curlrc"
michael@428:
michael@428: # remove user supplied -q option (ignore ~/.curlrc)
michael@428: [ ".$1" = .-q ] && shift
michael@428:
michael@428: # force -q option (ignore ~/.curlrc) and -f option (error checking)
michael@428: set -- "-q" "-f" "$@"
michael@428:
michael@428: # prepend --config option if conf file is readable
michael@428: declare -a a;
michael@428: [ -r "$conf" ] && set -- "--config" "$conf" "$@"
michael@428:
michael@428: # execute underlying application
michael@428: exec $curl "$@"
michael@428: