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
60b48241
Commit
60b48241
authored
Apr 26, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm-addrepo: move addkey code to epm-repo-addkey module
parent
4bcd29f6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
91 additions
and
65 deletions
+91
-65
epm-addrepo
bin/epm-addrepo
+0
-63
epm-repo
bin/epm-repo
+2
-2
epm-repo-addkey
bin/epm-repo-addkey
+89
-0
No files found.
bin/epm-addrepo
View file @
60b48241
...
...
@@ -290,69 +290,6 @@ __epm_addrepo_altlinux()
}
__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
set_sudo
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
$BASEDISTRNAME
in
"alt"
)
__epm_addkey_altlinux
"
$@
"
return
;;
esac
case
$PMTYPE
in
apt-dpkg
)
__epm_addkey_deb
"
$@
"
;;
esac
}
__epm_addrepo_astra
()
{
...
...
bin/epm-repo
View file @
60b48241
...
...
@@ -68,8 +68,8 @@ epm_repo()
load_helper epm-repodisable
epm_repodisable
"
$@
"
;;
addkey
)
# HELPCMD: add repository gpg key
load_helper epm-
addrepo
addkey
)
# HELPCMD: add repository gpg key
(by URL or file)
load_helper epm-
repo-addkey
epm_addkey
"
$@
"
;;
clean
)
# HELPCMD: remove temp. repos (tasks and CD-ROMs)
...
...
bin/epm-repo-addkey
0 → 100644
View file @
60b48241
#!/bin/sh
#
# Copyright (C) 2023 Etersoft
# Copyright (C) 2023 Vitaly Lipatov <lav@etersoft.ru>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
load_helper epm-sh-altlinux
__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
set_sudo
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
$BASEDISTRNAME
in
"alt"
)
__epm_addkey_altlinux
"
$@
"
return
;;
esac
case
$PMTYPE
in
apt-dpkg
)
__epm_addkey_deb
"
$@
"
;;
esac
}
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