Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eepm
Commits
e9514c56
Commit
e9514c56
authored
Apr 27, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm repo addkey: allow key name as first arg
parent
2afd0f9c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
14 deletions
+58
-14
epm-repo-addkey
bin/epm-repo-addkey
+58
-14
No files found.
bin/epm-repo-addkey
View file @
e9514c56
...
...
@@ -31,11 +31,21 @@ __epm_get_file_from_url()
__epm_addkey_altlinux
()
{
local
name
local
url
=
"
$1
"
local
fingerprint
=
"
$2
"
local
comment
=
"
$3
"
local
name
=
"
$4
"
[
-n
"
$name
"
]
||
name
=
"
$(
basename
"
$url
"
.gpg
)
"
shift
if
is_url
"
$url
"
;
then
name
=
"
$(
basename
"
$url
"
.gpg
)
"
else
name
=
"
$url
"
url
=
"
$1
"
shift
fi
local
fingerprint
=
"
$1
"
local
comment
=
"
$2
"
# compat
[
-n
"
$3
"
]
&&
name
=
"
$3
"
[
-s
/etc/apt/vendors.list.d/
$name
.list
]
&&
return
...
...
@@ -54,9 +64,16 @@ EOF
__epm_addkey_alpine
()
{
local
name
local
url
=
"
$1
"
local
name
=
"
$(
basename
$url
.rsa
)
"
shift
if
is_url
"
$url
"
;
then
name
=
"
$(
basename
"
$url
"
.rsa
)
"
else
name
=
"
$url
"
url
=
"
$1
"
shift
fi
local
target
=
"/etc/apk/keys/
$name
.rsa"
...
...
@@ -69,10 +86,20 @@ __epm_addkey_alpine()
__epm_addkey_dnf
()
{
local
name
local
url
=
"
$1
"
local
gpgkeyurl
=
"
$2
"
local
nametext
=
"
$3
"
local
name
=
"
$4
"
shift
if
is_url
"
$url
"
;
then
name
=
"
$(
basename
"
$url
"
.gpg
)
"
else
name
=
"
$url
"
url
=
"
$1
"
shift
fi
local
gpgkeyurl
=
"
$1
"
local
nametext
=
"
$2
"
# compat
[
-n
"
$3
"
]
&&
name
=
"
$3
"
# TODO: missed name, nametext, gpgkeyurl (disable gpgcheck=1)
...
...
@@ -96,16 +123,29 @@ EOF
__epm_addkey_deb
()
{
local
name
local
url
=
"
$1
"
local
fingerprint
=
"
$2
"
local
comment
=
"
$3
"
local
name
=
"
$4
"
[
-n
"
$name
"
]
||
name
=
"
$(
basename
"
$url
"
.gpg
)
"
shift
if
is_url
"
$url
"
;
then
name
=
"
$(
basename
"
$url
"
.gpg
)
"
else
name
=
"
$url
"
url
=
"
$1
"
shift
fi
local
fingerprint
=
"
$1
"
local
comment
=
"
$2
"
# compat
[
-n
"
$3
"
]
&&
name
=
"
$3
"
[
-s
/etc/apt/trusted.gpg.d/
$name
.gpg
]
&&
return
if
[
-z
"
$fingerprint
"
]
;
then
local
tmpfile
=
$(
__epm_get_file_from_url
$url
)
||
fatal
if
cat
$tmpfile
|
head
-n3
|
grep
--
"-----BEGIN PGP PUBLIC KEY BLOCK-----"
;
then
# This is a GnuPG extension to OpenPGP
cat
$tmpfile
| gpg
--dearmor
>
$tmpfile
fi
sudocmd apt-key add
$tmpfile
#
# if [ ! -f /etc/apt/trusted.gpg.d/$name.gpg ]; then
...
...
@@ -119,10 +159,14 @@ __epm_addkey_deb()
}
epm_addkey
()
{
if
[
"
$1
"
=
"-h"
]
||
[
"
$1
"
=
"--help"
]
||
[
-z
"
$1
"
]
;
then
echo
"Usage:
$
epm repo addkey [name] url [fingerprint/gpgkey] [comment/name]"
return
fi
case
$BASEDISTRNAME
in
"alt"
)
__epm_addkey_altlinux
"
$@
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment