From cf9383412494964d6188fcf08a362c0c0f313afc Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Tue, 26 Nov 2019 14:11:14 +0300 Subject: Import perl (5.30.0-9) --- debian/cross/download-deb | 69 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100755 debian/cross/download-deb (limited to 'debian/cross/download-deb') diff --git a/debian/cross/download-deb b/debian/cross/download-deb new file mode 100755 index 0000000..3d0c755 --- /dev/null +++ b/debian/cross/download-deb @@ -0,0 +1,69 @@ +#!/bin/sh + +# wrapper to download a binary package from a full APT repository +# (hopefully checking the archive signatures while at it) +# +# Copyright 2016 Niko Tyni +# +# This program is free software; you can redistribute it and/or modify +# it under the same terms as Perl itself. +# +# TODO: apt-key handling? +# + +set -e + +while getopts s:p:d:v: f +do + case $f in + p) package="$OPTARG";; + s) sources="$OPTARG";; + d) debdir="$OPTARG";; + v) version="$OPTARG";; + esac +done +shift `expr $OPTIND - 1` + +if [ ! -n "$package" ] && [ -r debian/control ]; then + package=$(sed -n 's/^Package: *\(libperl5\..*\)/\1/ p' debian/control) +fi + +if [ ! -n "$package" ]; then + echo "cannot guess name of package to download, aborting" 1>&2 + exit 1 +fi + +if [ ! -n "$sources" ]; then + sources="deb http://httpredir.debian.org/debian unstable main" +fi + +if [ ! -n "$version" ]; then + version=$(dpkg-parsechangelog -Sversion) +fi + +if [ ! -n "$debdir" ]; then + debdir=. +fi + +if [ $# = 0 ]; then + echo "Usage: $0 [ -p [,,...] ] [ -d ] [ -v ] [ -s '' ] [...]" 1>&2 + exit 1 +fi + +EXITCODE=0 + +for ARCH in "$@" +do + APTTMP=$(mktemp -d) + echo "$sources" > $APTTMP/sources.list + APTOPTIONS="-o APT::Architecture=$ARCH -o Dir::State=$APTTMP \ + -o Dir::Cache=$APTTMP -o Debug::NoLocking=true \ + -o Acquire::Languages=none \ + -o Dir::Etc::Sourcelist=$APTTMP/sources.list" + apt-get $APTOPTIONS update + for p in $(echo $package | sed 's/,/ /g'); do + (cd "$debdir"; apt-get $APTOPTIONS download $p:$ARCH=$version) || EXITCODE=$? + done + rm -rf "$APTTMP" +done +exit $EXITCODE -- cgit v1.2.3