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
Vladislav
eepm
Commits
14ff1045
Commit
14ff1045
authored
Jan 23, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm mark hold/unhold: add support for glob symbols
parent
490013aa
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
2 deletions
+30
-2
epm-mark
bin/epm-mark
+30
-2
No files found.
bin/epm-mark
View file @
14ff1045
...
...
@@ -17,15 +17,42 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# TODO: move to a common place and use
__is_wildcard
()
{
echo
"
$1
"
|
grep
-q
"[*?]"
}
__alt_mark_hold_package
()
{
local
pkg
=
"
$1
"
showcmd
"echo
\"
RPM::Hold {
\"
^
$pkg
\"
;};
\"
> /etc/apt/apt.conf.d/hold-
$pkg
.conf"
echo
"RPM::Hold {
\"
^
$pkg
\"
;};"
| sudorun
tee
"/etc/apt/apt.conf.d/hold-
$pkg
.conf"
>
/dev/null
}
__alt_test_glob
()
{
echo
"
$*
"
|
grep
-q
"
\.
[*?]"
&&
warning
"Only glob symbols * and ? are supported. Don't use regexp here!"
}
__alt_mark_hold
()
{
# TODO: do more long checking via apt
local
pkg
local
i
__alt_test_glob
"
$*
"
for
i
in
"
$@
"
;
do
if
__is_wildcard
"
$i
"
;
then
local
pkglist
pkglist
=
"
$(
epm qp
--short
"^
$i
"
)
"
||
continue
for
pkg
in
$pkglist
;
do
__alt_mark_hold_package
$pkg
done
return
else
pkg
=
"
$(
epm query
--short
"
$i
"
)
"
||
continue
showcmd
"echo
\"
RPM::Hold {
\"
^
$pkg
\"
;};
\"
> /etc/apt/apt.conf.d/hold-
$pkg
.conf"
echo
"RPM::Hold {
\"
^
$pkg
\"
;};"
| sudorun
tee
"/etc/apt/apt.conf.d/hold-
$pkg
.conf"
>
/dev/null
fi
__alt_mark_hold_package
$pkg
done
}
...
...
@@ -34,6 +61,7 @@ __alt_mark_unhold()
# TODO: do more long checking via apt
local
pkg
local
i
__alt_test_glob
"
$*
"
for
i
in
"
$@
"
;
do
pkg
=
"
$(
epm query
--short
"
$i
"
)
"
||
pkg
=
"
$i
"
sudocmd
rm
-fv
/etc/apt/apt.conf.d/hold-
$pkg
.conf
...
...
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