Ticket #1242: 0001-Support-gpg-signature-sync-option-in-dotar-fetchers.patch

File 0001-Support-gpg-signature-sync-option-in-dotar-fetchers.patch, 1.8 KB (added by mehh, 3 years ago)
  • paludis/syncers/dotar.in

    From 6d6ce542c1979fb2f20e80c1f65761a3cbb54658 Mon Sep 17 00:00:00 2001
    From: mehh <mehh@suremail.info>
    Date: Wed, 9 May 2012 00:12:15 +0000
    Subject: [PATCH] Support --gpg-signature sync option in dotar fetchers
    
    ---
     paludis/syncers/dotar.in |   17 +++++++++++++++++
     1 files changed, 17 insertions(+), 0 deletions(-)
    
    diff --git a/paludis/syncers/dotar.in b/paludis/syncers/dotar.in
    index e5f2464..f292520 100644
    a b while [[ $# -gt 0 ]]; do 
    5454            RSYNC_OPTIONS[${#RSYNC_OPTIONS[@]}]="${1#*=}" 
    5555            ;; 
    5656 
     57        --gpg-signature=*) 
     58            GPG_SIG="${1#*=}" 
     59            ;; 
     60 
    5761        --help) 
    5862            PROTO="${0##*/do}" 
    5963            if [[ "${PROTO}" == tar+file ]]; then 
    cleanup_and_exit() 
    158162TEMP="$( mktemp -d -p "${TMPDIR}" paludis-tarsync-XXXXXX )" || cleanup_and_exit $? 
    159163TARFILE="${URL##*/}" 
    160164 
     165if [[ -n "${GPG_SIG}" ]]; then 
     166    GPG_SIGFILE="${GPG_SIG##*/}" 
     167    "${FETCHER}" "${FETCHER_OPTIONS[@]}" "${GPG_SIG}" "${TEMP}/${GPG_SIGFILE}" || cleanup_and_exit $? 
     168fi 
     169 
    161170"${FETCHER}" "${FETCHER_OPTIONS[@]}" "${URL}" "${TEMP}/${TARFILE}" || cleanup_and_exit $? 
    162171 
     172if [[ -n "${GPG_SIG}" ]]; then 
     173    gpg --verify "${TEMP}/${GPG_SIGFILE}" "${TEMP}/${TARFILE}" || cleanup_and_exit $? 
     174fi 
     175 
    163176UNPACKDIR="${TEMP}/repository" 
    164177mkdir "${UNPACKDIR}" 
    165178export 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" 
    export PALUDIS_UNPACK_FIX_PERMISSIONS= 
    170183 
    171184rm "${TEMP}/${TARFILE}" 
    172185 
     186if [[ -n "${GPG_SIG}" ]]; then 
     187    rm "${TEMP}/${GPG_SIGFILE}" 
     188fi 
     189 
    173190if [[ -z "$( ls -A "${UNPACKDIR}" )" ]]; then 
    174191    eerror "No files were extracted (not an archive?)" 
    175192    cleanup_and_exit 1