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
cf87f1a9
Commit
cf87f1a9
authored
Jan 23, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm-mark: big refactoring, add support for deb and dnf based systems
parent
a57f6efb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
201 additions
and
22 deletions
+201
-22
epm-mark
bin/epm-mark
+201
-22
No files found.
bin/epm-mark
View file @
cf87f1a9
#!/bin/sh
#
# Copyright (C) 2020, 2022 Etersoft
# Copyright (C) 2020, 2022 Vitaly Lipatov <lav@etersoft.ru>
# Copyright (C) 2020, 2022
, 2023
Etersoft
# Copyright (C) 2020, 2022
, 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
...
...
@@ -73,40 +73,219 @@ __alt_mark_showhold()
grep
-h
"RPM::Hold"
/etc/apt/apt.conf.d/hold-
*
.conf 2>/dev/null |
sed
-e
's|RPM::Hold {"^\(.*\)";};|\1|'
}
epm_mark
()
epm_mark_hold
()
{
case
$PMTYPE
in
apt-rpm
)
if
[
"
$1
"
=
"hold"
]
;
then
shift
case
$DISTRNAME
in
ALTLinux|ALTServer
)
__alt_mark_hold
"
$@
"
exit
fi
if
[
"
$1
"
=
"unhold"
]
;
then
shift
;;
esac
case
$PMTYPE
in
apt-dpkg
)
sudocmd apt-mark hold
"
$@
"
;;
yum-rpm|dnf-rpm
)
fatal
"Improve me"
;;
*
)
fatal
"Have no suitable command for
$PMTYPE
"
;;
esac
}
epm_mark_unhold
()
{
case
$DISTRNAME
in
ALTLinux|ALTServer
)
__alt_mark_unhold
"
$@
"
exit
fi
if
[
"
$1
"
=
"showhold"
]
;
then
shift
;;
esac
case
$PMTYPE
in
apt-dpkg
)
sudocmd apt-mark unhold
"
$@
"
;;
yum-rpm|dnf-rpm
)
fatal
"Improve me"
;;
*
)
fatal
"Have no suitable command for
$PMTYPE
"
;;
esac
}
epm_mark_showhold
()
{
case
$DISTRNAME
in
ALTLinux|ALTServer
)
__alt_mark_showhold
"
$@
"
exit
fi
sudocmd apt-mark
"
$@
"
if
[
"
$1
"
=
""
]
||
[
"
$1
"
=
"--help"
]
||
[
"
$1
"
=
"-h"
]
;
then
echo
echo
"EPM additionals: "
echo
" hold pkg1 [pkg2 ...] - hold the given package(s)"
echo
" unhold pkg1 [pkg2 ...] - unhold the given package(s)"
fi
;;
esac
case
$PMTYPE
in
apt-dpkg
)
sudocmd apt-mark showhold
"
$@
"
;;
# yum-rpm|dnf-rpm)
# fatal "Improve me"
# ;;
*
)
fatal
"Have no suitable command for
$PMTYPE
"
;;
esac
}
epm_mark_auto
()
{
case
$DISTRNAME
in
ALTLinux|ALTServer
)
sudocmd apt-mark auto
"
$@
"
exit
;;
esac
case
$PMTYPE
in
apt-dpkg
)
sudocmd apt-mark auto
"
$@
"
;;
# yum-rpm|dnf-rpm)
# sudocmd dnf mark remove "$@"
# ;;
*
)
fatal
"Have no suitable command for
$PMTYPE
"
;;
esac
}
epm_mark_manual
()
{
case
$DISTRNAME
in
ALTLinux|ALTServer
)
sudocmd apt-mark manual
"
$@
"
exit
;;
esac
case
$PMTYPE
in
apt-dpkg
)
sudocmd apt-mark manual
"
$@
"
;;
# yum-rpm|dnf-rpm)
# sudocmd dnf mark install "$@"
# ;;
*
)
fatal
"Have no suitable command for
$PMTYPE
"
;;
esac
}
epm_mark_showauto
()
{
case
$DISTRNAME
in
ALTLinux|ALTServer
)
sudocmd apt-mark showauto
"
$@
"
exit
;;
esac
case
$PMTYPE
in
apt-dpkg
)
sudocmd apt-mark showauto
"
$@
"
;;
# yum-rpm|dnf-rpm)
# sudocmd dnf mark remove "$@"
# ;;
*
)
fatal
"Have no suitable command for
$PMTYPE
"
;;
esac
}
epm_mark_showmanual
()
{
case
$DISTRNAME
in
ALTLinux|ALTServer
)
sudocmd apt-mark showmanual
"
$@
"
exit
;;
esac
case
$PMTYPE
in
apt-dpkg
)
sudocmd apt-mark
"
$@
"
sudocmd apt-mark
showmanual
"
$@
"
;;
# yum-rpm|dnf-rpm)
# sudocmd dnf mark install "$@"
# ;;
*
)
fatal
"Have no suitable command for
$PMTYPE
"
;;
esac
}
epm_mark
()
{
local
CMD
=
"
$1
"
[
-n
"
$CMD
"
]
&&
shift
case
"
$CMD
"
in
""
|
"-h"
|
"--help"
|
help
)
# HELPCMD: help
echo
"mark is the interface for marking packages"
get_help HELPCMD
$SHAREDIR
/epm-mark
cat
<<
EOF
Examples:
epm mark hold mc
epm manual mc
EOF
;;
hold
)
# HELPCMD: mark the given package(s) as held back
epm_mark_hold
"
$@
"
;;
unhold
)
# HELPCMD: unset the given package(s) as held back
epm_mark_unhold
"
$@
"
;;
showhold
)
# HELPCMD: print the list of packages on hold
epm_mark_showhold
"
$@
"
;;
auto
)
# HELPCMD: mark the given package(s) as automatically installed
epm_mark_auto
"
$@
"
;;
manual
)
# HELPCMD: mark the given package(s) as manually installed
epm_mark_manual
"
$@
"
;;
showauto
)
# HELPCMD: print the list of automatically installed packages
epm_mark_showauto
"
$@
"
;;
showmanual
)
# HELPCMD: print the list of manually installed packages
epm_mark_showmanual
"
$@
"
;;
*
)
fatal
"Unknown command
$
epm repo '
$CMD
'"
;;
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