aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar mehh <mehh@suremail.info> 2012-05-09 00:12:15 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2012-05-20 20:00:41 +0100
commit077438304507127e1c454cf92c8febfd181a262a (patch)
tree33320c49636585858556342fd3c05208b0923ee7
parent1c6c441208ab6c63c11e79dcd7c2544e605a5766 (diff)
downloadpaludis-077438304507127e1c454cf92c8febfd181a262a.tar.gz
paludis-077438304507127e1c454cf92c8febfd181a262a.tar.xz
Support --gpg-signature sync option in dotar fetchers
-rw-r--r--paludis/syncers/dotar.in17
1 files changed, 17 insertions, 0 deletions
diff --git a/paludis/syncers/dotar.in b/paludis/syncers/dotar.in
index e5f2464..f292520 100644
--- a/paludis/syncers/dotar.in
+++ b/paludis/syncers/dotar.in
@@ -54,6 +54,10 @@ while [[ $# -gt 0 ]]; do
RSYNC_OPTIONS[${#RSYNC_OPTIONS[@]}]="${1#*=}"
;;
+ --gpg-signature=*)
+ GPG_SIG="${1#*=}"
+ ;;
+
--help)
PROTO="${0##*/do}"
if [[ "${PROTO}" == tar+file ]]; then
@@ -158,8 +162,17 @@ cleanup_and_exit()
TEMP="$( mktemp -d -p "${TMPDIR}" paludis-tarsync-XXXXXX )" || cleanup_and_exit $?
TARFILE="${URL##*/}"
+if [[ -n "${GPG_SIG}" ]]; then
+ GPG_SIGFILE="${GPG_SIG##*/}"
+ "${FETCHER}" "${FETCHER_OPTIONS[@]}" "${GPG_SIG}" "${TEMP}/${GPG_SIGFILE}" || cleanup_and_exit $?
+fi
+
"${FETCHER}" "${FETCHER_OPTIONS[@]}" "${URL}" "${TEMP}/${TARFILE}" || cleanup_and_exit $?
+if [[ -n "${GPG_SIG}" ]]; then
+ gpg --verify "${TEMP}/${GPG_SIGFILE}" "${TEMP}/${TARFILE}" || cleanup_and_exit $?
+fi
+
UNPACKDIR="${TEMP}/repository"
mkdir "${UNPACKDIR}"
export PALUDIS_UNPACK_SUFFIXES="tar tar.gz,tgz,tar.Z tar.bz2,tbz2,tbz zip,ZIP,jar rar,RAR lha,LHa,LHA,lzh a,deb tar.lzma 7z,7Z tar.xz"
@@ -170,6 +183,10 @@ export PALUDIS_UNPACK_FIX_PERMISSIONS=
rm "${TEMP}/${TARFILE}"
+if [[ -n "${GPG_SIG}" ]]; then
+ rm "${TEMP}/${GPG_SIGFILE}"
+fi
+
if [[ -z "$( ls -A "${UNPACKDIR}" )" ]]; then
eerror "No files were extracted (not an archive?)"
cleanup_and_exit 1