Commit 1bec252b authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm repo addkey: allow missed url with gpg key

parent c670a664
...@@ -43,10 +43,18 @@ __epm_addkey_altlinux() ...@@ -43,10 +43,18 @@ __epm_addkey_altlinux()
shift shift
fi fi
local fingerprint="$1" local fingerprint
local comment="$2" if is_url "$url" ; then
fingerprint="$1"
shift
else
fingerprint="$url"
url=""
fi
local comment="$1"
# compat # compat
[ -n "$3" ] && name="$3" [ -n "$2" ] && name="$2"
[ -s /etc/apt/vendors.list.d/$name.list ] && return [ -s /etc/apt/vendors.list.d/$name.list ] && return
...@@ -57,9 +65,10 @@ simple-key "$name" { ...@@ -57,9 +65,10 @@ simple-key "$name" {
Name "$comment"; Name "$comment";
} }
EOF EOF
if [ -n "$url" ] ; then
local tmpfile=$(__epm_get_file_from_url $url) || fatal local tmpfile=$(__epm_get_file_from_url $url) || fatal
sudocmd gpg --no-default-keyring --keyring /usr/lib/alt-gpgkeys/pubring.gpg --import $tmpfile sudocmd gpg --no-default-keyring --keyring /usr/lib/alt-gpgkeys/pubring.gpg --import $tmpfile
fi
} }
...@@ -165,7 +174,7 @@ epm_addkey() ...@@ -165,7 +174,7 @@ epm_addkey()
{ {
if [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ -z "$1" ] ; then if [ "$1" = "-h" ] || [ "$1" = "--help" ] || [ -z "$1" ] ; then
echo "Usage: $ epm repo addkey [name] url [fingerprint/gpgkey] [comment/name]" echo "Usage: $ epm repo addkey [name] [url] [fingerprint/gpgkey] [comment/name]"
return return
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment