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
6f5a2e0d
Commit
6f5a2e0d
authored
Apr 26, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm repo addkey: add dnf/yum support
parent
13ca4f20
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
4 deletions
+32
-4
epm-repo-addkey
bin/epm-repo-addkey
+32
-4
No files found.
bin/epm-repo-addkey
View file @
6f5a2e0d
...
...
@@ -63,6 +63,31 @@ __epm_addkey_alpine()
sudocmd
cp
$tmpfile
$target
}
__epm_addkey_dnf
()
{
local
url
=
"
$1
"
local
gpgkeyurl
=
"
$2
"
local
nametext
=
"
$3
"
local
name
=
"
$4
"
# TODO: missed name, nametext, gpgkeyurl (disable gpgcheck=1)
local
target
=
"/etc/yum.repos.d/
$name
.repo"
[
-s
$target
]
&&
return
local
tmpfile
=
$(
mktemp
)
remove_on_exit
$tmpfile
cat
>
$tmpfile
<<
EOF
[
$name
]
name=
$nametext
baseurl=
$url
gpgcheck=1
enabled=1
gpgkey=
$gpgkeyurl
EOF
chmod
644
$tmpfile
sudocmd
cp
$tmpfile
$target
}
...
...
@@ -71,14 +96,14 @@ __epm_addkey_deb()
local
url
=
"
$1
"
local
fingerprint
=
"
$2
"
local
comment
=
"
$3
"
local
name
=
"
$(
basename
$url
.gpg
)
"
local
name
=
"
$4
"
[
-n
"
$name
"
]
||
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 -
local
tmpfile
=
$(
__epm_get_file_from_url
$url
)
||
fatal
sudocmd apt-key add
$tmpfile
#
# 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
...
...
@@ -110,6 +135,9 @@ case $PMTYPE in
apt-dpkg
)
__epm_addkey_deb
"
$@
"
;;
dnf-
*
|
yum-
*
)
__epm_addkey_dnf
"
$@
"
;;
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