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
8b008e1c
Commit
8b008e1c
authored
Aug 12, 2022
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm: repo addkey support (add gpg key for a repo)
parent
67995600
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
5 deletions
+58
-5
epm
bin/epm
+1
-1
epm-addrepo
bin/epm-addrepo
+53
-4
epm-repo
bin/epm-repo
+4
-0
No files found.
bin/epm
View file @
8b008e1c
...
...
@@ -263,7 +263,7 @@ check_command()
epm_cmd
=
update
direct_args
=
1
;;
addrepo|ar
)
# HELPCMD: add package repo (etersoft, autoimports, archive 2017/12/31); run with param to get list
addrepo|ar
|--add-repo
)
# HELPCMD: add package repo (etersoft, autoimports, archive 2017/12/31); run with param to get list
epm_cmd
=
addrepo
direct_args
=
1
;;
...
...
bin/epm-addrepo
View file @
8b008e1c
...
...
@@ -139,21 +139,70 @@ __epm_addrepo_altlinux()
}
# TODO: add repo addkey command
__epm_addkey_altlinux
()
{
local
url
=
"
$1
"
local
fingerprint
=
"
$2
"
local
comment
=
"
$3
"
local
name
=
"
$(
basename
"
$url
"
.gpg
)
"
[
-s
/etc/apt/vendors.list.d/
$name
.list
]
&&
return
# TODO: get this info from the gpg key
cat
<<
EOF
| sudorun tee /etc/apt/vendors.list.d/
$name
.list
simple-key "
$name
" {
FingerPrint "
$fingerprint
";
Name "
$comment
";
}
EOF
eget
-q
-O
/tmp/
$name
.gpg
$url
||
fatal
sudorun gpg
--no-default-keyring
--keyring
/usr/lib/alt-gpgkeys/pubring.gpg
--import
/tmp/
$name
.gpg
rm
-f
/tmp/
$name
.gpg
}
__epm_addkey_deb
()
{
local
url
=
"
$1
"
local
fingerprint
=
"
$2
"
local
comment
=
"
$3
"
local
name
=
"
$(
basename
$url
.gpg
)
"
[
-s
/etc/apt/trusted.gpg.d/
$name
.gpg
]
&&
return
if
[
-z
"
$fingerprint
"
]
;
then
assure_exists curl
set_sudo
showcmd
"curl -fsSL '
$url
' |
$SUDO
apt-key add -"
a
=
curl
-fsSL
"
$url
"
| sudorun apt-key add -
eget
-q
-O-
"
$url
"
| sudorun apt-key add -
#
# if [ ! -f /etc/apt/trusted.gpg.d/$name.gpg ]; then
# epm tool eget -q -O /etc/apt/trusted.gpg.d/$name.gpg https://example.com/$name.gpg > /dev/null
# chmod 0644 /etc/apt/trusted.gpg.d/$name.gpg
# fi
return
fi
sudocmd apt-key adv
--keyserver
"
$url
"
--recv
"
$fingerprint
"
}
epm_addkey
()
{
case
$DISTRNAME
in
ALTLinux|ALTServer
)
__epm_addkey_altlinux
"
$@
"
return
;;
esac
case
$PMTYPE
in
apt-dpkg
)
__epm_addkey_deb
"
$@
"
;;
esac
}
__epm_addrepo_deb
()
{
assure_exists apt-add-repository software-properties-common
...
...
bin/epm-repo
View file @
8b008e1c
...
...
@@ -79,6 +79,10 @@ EOF
epm_addrepo
"
$@
"
epm update
;;
addkey
)
# HELPCMD: add repository gpg key
load_helper epm-addrepo
epm_addkey
"
$@
"
;;
rm
|
remove
)
# HELPCMD: remove repository from the sources lists (epm repo remove all for all)
load_helper epm-removerepo
epm_removerepo
"
$@
"
...
...
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