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
6cb230c6
Commit
6cb230c6
authored
Mar 20, 2025
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm repo addkey: rewritten for alt
parent
ee131435
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
5 deletions
+44
-5
epm-repo-addkey
bin/epm-repo-addkey
+44
-5
No files found.
bin/epm-repo-addkey
View file @
6cb230c6
...
...
@@ -47,6 +47,27 @@ __epm_importgpg_altlinux()
rm
$tmpfile
return
$res
}
# gpg --with-colons --with-fingerprint 1.gpg
# pub:-:4096:1:617AB978CB849A76:2022-10-25:::-:Angie (Signing Key) <devops@tech.wbsrv.ru>:
# fpr:::::::::EB8EAF3D4EF1B1ECF34865A2617AB978CB849A76:
__epm_altgpg_get_fingerprint
()
{
__epm_altgpg
--with-colons
--with-fingerprint
"
$1
"
|
grep
fpr | rev |
cut
-d
":"
-f2
| rev
}
__epm_altgpg_get_comment
()
{
__epm_altgpg
--with-colons
--with-fingerprint
"
$1
"
|
grep
pub | rev |
cut
-d
":"
-f2
| rev
}
# args: [name] [url] [fingerprint] [comment] [name]
# actuals:
# url
# name url
# name url fingerprint comment
# fingerprint comment
__epm_addkey_altlinux
()
{
local
name
...
...
@@ -73,19 +94,34 @@ __epm_addkey_altlinux()
# compat
[
-n
"
$2
"
]
&&
name
=
"
$2
"
[
-s
/etc/apt/vendors.list.d/
$name
.list
]
&&
return
local
tmpfile
=
''
if
[
-n
"
$url
"
]
;
then
tmpfile
=
$(
__epm_get_file_from_url
"
$url
"
)
||
fatal
# __epm_importgpg_altlinux "$url"
__epm_altgpg
--import
$tmpfile
fi
if
[
!
-s
/etc/apt/vendors.list.d/
$name
.list
]
;
then
if
[
-z
"
$fingerprint
"
]
||
[
-z
"
$comment
"
]
;
then
[
-n
"
$url
"
]
||
fatal
"can't get fingerprint and comment from url, missed url"
[
-n
"
$tmpfile
"
]
||
tmpfile
=
$(
__epm_get_file_from_url
"
$url
"
)
||
fatal
fingerprint
=
"
$(
__epm_altgpg_get_fingerprint
"
$tmpfile
"
)
"
comment
=
"
$(
__epm_altgpg_get_comment
"
$tmpfile
"
)
"
fi
[
-n
"
$fingerprint
"
]
||
fatal
"missed fingerprint"
[
-n
"
$comment
"
]
||
fatal
"missed comment"
# 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
if
[
-n
"
$url
"
]
;
then
local
tmpfile
=
$(
__epm_get_file_from_url
$url
)
||
fatal
sudocmd gpg
--no-default-keyring
--keyring
/usr/lib/alt-gpgkeys/pubring.gpg
--import
$tmpfile
fi
}
...
...
@@ -111,6 +147,7 @@ __epm_addkey_alpine()
}
# [name] url gpgkeyurl comment
__epm_addkey_dnf
()
{
local
name
...
...
@@ -144,6 +181,7 @@ gpgcheck=1
enabled=1
gpgkey=
$gpgkeyurl
EOF
#epm repo add $tmpfile
chmod
644
$tmpfile
sudocmd
cp
$tmpfile
$target
}
...
...
@@ -243,3 +281,4 @@ 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