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
65556ba7
Commit
65556ba7
authored
Apr 05, 2023
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
epm history: print rpm sessions too
parent
2eea4c64
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
13 deletions
+32
-13
epm-history
bin/epm-history
+32
-13
No files found.
bin/epm-history
View file @
65556ba7
...
@@ -17,9 +17,16 @@
...
@@ -17,9 +17,16 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#
EHOG
=
'\(apt-get\|rpm\)'
__alt_epm_history_journal
()
{
a
=
journalctl
-t
apt-get
-t
rpm
}
__alt_epm_history_uniq
()
__alt_epm_history_uniq
()
{
{
a
=
journalctl
-t
apt-get |
grep
"apt-get
\[
[0-9][0-9]*
\]
:"
|
sed
-e
"s|.*apt-get
\[\(
[0-9][0-9]*
\)\]
: .*|
\1
|
"
|
uniq
|
tac
__alt_epm_history_journal |
grep
"
$EHOG
\[
[0-9][0-9]*
\]
:"
|
sed
-e
"s@.*
$EHOG
\[\(
[0-9][0-9]*
\)\]
: .*@
\2
@
"
|
uniq
|
tac
}
}
# args: pid, removed|installed
# args: pid, removed|installed
...
@@ -27,25 +34,41 @@ __alt_epm_history_select()
...
@@ -27,25 +34,41 @@ __alt_epm_history_select()
{
{
local
pid
=
"
$1
"
local
pid
=
"
$1
"
local
verb
=
"
$2
"
local
verb
=
"
$2
"
a
=
journalctl
-t
apt-get |
grep
"apt-get
\[
$pid
\]
: .*
$verb
"
|
sed
-e
"s|.*apt-get
\[
[0-9][0-9]*
\]
: ||
"
|
cut
-d
" "
-f
1
__alt_epm_history_journal |
grep
"
$EHOG
\[
$pid
\]
: .*
$verb
"
|
sed
-e
"s@.*
$EHOG
\[
[0-9][0-9]*
\]
: @@
"
|
cut
-d
" "
-f
1
}
}
_alt_epm_history_date
()
_alt_epm_history_date
()
{
{
local
pid
=
"
$1
"
local
pid
=
"
$1
"
a
=
journalctl
-t
apt-get |
grep
"apt-get
\[
$pid
\]
: "
|
head
-n1
|
cut
-d
" "
-f
1-3
__alt_epm_history_journal |
grep
"
$EHOG
\[
$pid
\]
: "
|
head
-n1
|
cut
-d
" "
-f
1-3,5 |
sed
-e
's|:$||'
}
}
_alt_epm_history_print_group
()
{
local
i
if
[
-n
"
$2
"
]
;
then
echo
echo
"
$1
session:"
shift
else
return
fi
for
i
in
$*
;
do
echo
"
$i
"
done
}
__alt_epm_history_removed
()
__alt_epm_history_removed
()
{
{
echo
"Removed packages history:"
echo
"Removed packages history:"
__alt_epm_history_uniq |
while
read
pid
;
do
__alt_epm_history_uniq |
while
read
pid
;
do
date
=
"
$(
_alt_epm_history_date
$pid
)
"
date
=
"
$(
_alt_epm_history_date
$pid
)
"
echo
echo
"
$date
apt-get session
$pid
:"
removed
=
"
$(
epm print shortname
for
$(
__alt_epm_history_select
$pid
"removed"
)
)
"
removed
=
"
$(
epm print shortname
for
$(
__alt_epm_history_select
$pid
"removed"
)
)
"
installed
=
"
$(
epm print shortname
for
$(
__alt_epm_history_select
$pid
"installed"
)
)
"
installed
=
"
$(
epm print shortname
for
$(
__alt_epm_history_select
$pid
"installed"
)
)
"
epm tool
--quiet
estrlist exclude
"
$installed
"
"
$removed
"
| xargs
-n1
echo
|
sed
-e
"s|^| |"
_alt_epm_history_print_group
"
$date
"
$(
estrlist exclude
"
$installed
"
"
$removed
"
)
done
done
}
}
...
@@ -53,13 +76,11 @@ __alt_epm_history_installed()
...
@@ -53,13 +76,11 @@ __alt_epm_history_installed()
{
{
echo
"Installed packages history:"
echo
"Installed packages history:"
__alt_epm_history_uniq |
while
read
pid
;
do
__alt_epm_history_uniq |
while
read
pid
;
do
echo
date
=
"
$(
_alt_epm_history_date
$pid
)
"
date
=
"
$(
_alt_epm_history_date
$pid
)
"
echo
"
$date
apt-get session
$pid
:"
#epm print shortname for $(__alt_epm_history_select $pid "installed") | sed -e "s|^| |"
#epm print shortname for $(__alt_epm_history_select $pid "installed") | sed -e "s|^| |"
removed
=
"
$(
epm print shortname
for
$(
__alt_epm_history_select
$pid
"removed"
)
)
"
removed
=
"
$(
epm print shortname
for
$(
__alt_epm_history_select
$pid
"removed"
)
)
"
installed
=
"
$(
epm print shortname
for
$(
__alt_epm_history_select
$pid
"installed"
)
)
"
installed
=
"
$(
epm print shortname
for
$(
__alt_epm_history_select
$pid
"installed"
)
)
"
epm tool
--quiet
estrlist exclude
"
$removed
"
"
$installed
"
| xargs
-n1
echo
|
sed
-e
"s|^| |"
_alt_epm_history_print_group
"
$date
"
$(
estrlist exclude
"
$removed
"
"
$installed
"
)
done
done
}
}
...
@@ -67,13 +88,11 @@ __alt_epm_history_updated()
...
@@ -67,13 +88,11 @@ __alt_epm_history_updated()
{
{
echo
"Updated packages history:"
echo
"Updated packages history:"
__alt_epm_history_uniq |
while
read
pid
;
do
__alt_epm_history_uniq |
while
read
pid
;
do
echo
date
=
"
$(
_alt_epm_history_date
$pid
)
"
date
=
"
$(
_alt_epm_history_date
$pid
)
"
echo
"
$date
apt-get session
$pid
:"
#epm print shortname for $(__alt_epm_history_select $pid "installed") | sed -e "s|^| |"
#epm print shortname for $(__alt_epm_history_select $pid "installed") | sed -e "s|^| |"
removed
=
"
$(
epm print shortname
for
$(
__alt_epm_history_select
$pid
"removed"
)
)
"
removed
=
"
$(
epm print shortname
for
$(
__alt_epm_history_select
$pid
"removed"
)
)
"
installed
=
"
$(
epm print shortname
for
$(
__alt_epm_history_select
$pid
"installed"
)
)
"
installed
=
"
$(
epm print shortname
for
$(
__alt_epm_history_select
$pid
"installed"
)
)
"
epm tool
--quiet
estrlist intersection
"
$removed
"
"
$installed
"
| xargs
-n1
echo
|
sed
-e
"s|^| |"
_alt_epm_history_print_group
"
$date
"
$(
estrlist intersection
"
$removed
"
"
$installed
"
)
done
done
}
}
...
@@ -125,7 +144,7 @@ fi
...
@@ -125,7 +144,7 @@ fi
case
$PMTYPE
in
case
$PMTYPE
in
apt-rpm
)
apt-rpm
)
docmd journalctl
-t
apt-get
docmd journalctl
-t
apt-get
-t
rpm
-r
;;
;;
apt-dpkg
)
apt-dpkg
)
docmd less /var/log/dpkg.log
docmd less /var/log/dpkg.log
...
...
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