* [gentoo-user] A Gentoo Enema
@ 2005-12-17 5:24 Tom Eastman
2005-12-17 5:45 ` [gentoo-user] " Tom Eastman
` (5 more replies)
0 siblings, 6 replies; 26+ messages in thread
From: Tom Eastman @ 2005-12-17 5:24 UTC (permalink / raw
To: gentoo-user
Hey all,
Sorry about any imagery conjured up by the subject line... I've been
running the same gentoo system on my computer for several years now...
keeping it relativey updated, but over time there's always cruft that
builds up, stuff that gets left behind during upgrades, or re-installs.
Packages that don't change version for a long time, and don't get
recompiled with the latest compiler, etc etc and so on and so forth.
So what I want to do is give my computer a complete clean-out. What I
really CAN'T be bothered doing is a complete format and re-install!
One idea I've had is to delete almost every entry in my 'world' file,
and then do an 'emerge depclean'. That would be pretty cool, empty out
a huge amount of stuff, and then start re-installing at my leisure.
But what that *wouldn't* do is delete all the files in random places
that aren't owned by any particular package. This would be a good thing
to do when spring cleaning, as it were.
Is there a tool that will allow me to find *all* files that aren't owned
by any package, so that I can then decide what to do with them?
Obviously skipping directories such as /home/. Then I can delete
everything that doesn't look critical, hopefully without losing my stuff
in places like /boot or /etc either :-)
Then I think I would do an emerge -e system, and then start re-adding
applications I wanted.
What do you think? Does anyone have any ideas about good ways of
'refreshing' my gentoo system? All suggestions appreciated :-)
Thanks!
Tom
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 26+ messages in thread
* [gentoo-user] Re: A Gentoo Enema
2005-12-17 5:24 [gentoo-user] A Gentoo Enema Tom Eastman
@ 2005-12-17 5:45 ` Tom Eastman
2005-12-17 10:04 ` Neil Bothwick
2005-12-17 6:02 ` [gentoo-user] " Steven Ringwald
` (4 subsequent siblings)
5 siblings, 1 reply; 26+ messages in thread
From: Tom Eastman @ 2005-12-17 5:45 UTC (permalink / raw
To: gentoo-user
Also on the subject of cleaning things out and keeping things somewhat
up-to-date... what do you suppose would be a good way of seeing how old
some packages are on your system?
It would be cool if you could list every package based on when it was
installed... so the stuff that is *reall* old can be freshened by a
re-installation (with whatever my current compiler is)
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-user] A Gentoo Enema
2005-12-17 5:24 [gentoo-user] A Gentoo Enema Tom Eastman
2005-12-17 5:45 ` [gentoo-user] " Tom Eastman
@ 2005-12-17 6:02 ` Steven Ringwald
2005-12-17 6:45 ` Willie Wong
` (3 subsequent siblings)
5 siblings, 0 replies; 26+ messages in thread
From: Steven Ringwald @ 2005-12-17 6:02 UTC (permalink / raw
To: gentoo-user
Tom Eastman wrote:
>Hey all,
>
>Sorry about any imagery conjured up by the subject line... I've been
>running the same gentoo system on my computer for several years now...
>keeping it relativey updated, but over time there's always cruft that
>builds up, stuff that gets left behind during upgrades, or re-installs.
> Packages that don't change version for a long time, and don't get
>recompiled with the latest compiler, etc etc and so on and so forth.
>
>So what I want to do is give my computer a complete clean-out. What I
>really CAN'T be bothered doing is a complete format and re-install!
>
>One idea I've had is to delete almost every entry in my 'world' file,
>and then do an 'emerge depclean'. That would be pretty cool, empty out
>a huge amount of stuff, and then start re-installing at my leisure.
>
>But what that *wouldn't* do is delete all the files in random places
>that aren't owned by any particular package. This would be a good thing
>to do when spring cleaning, as it were.
>
>Is there a tool that will allow me to find *all* files that aren't owned
>by any package, so that I can then decide what to do with them?
>Obviously skipping directories such as /home/. Then I can delete
>everything that doesn't look critical, hopefully without losing my stuff
>in places like /boot or /etc either :-)
>
>Then I think I would do an emerge -e system, and then start re-adding
>applications I wanted.
>
>What do you think? Does anyone have any ideas about good ways of
>'refreshing' my gentoo system? All suggestions appreciated :-)
>
>Thanks!
>
Well, what I would do is:
% etc-update
(to make sure that there aren't any cruft files lying around)
and then:
% emerge -eD world
to rebuild the entire system.
You could also do:
emerge --newuse -D world
to just upgrade things that haven't been built since you change USE
options.
or if you have gentoolkit installed,
revdep-rebuild
to verify that all packages have all the correct dependancies.
Steve
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-user] A Gentoo Enema
2005-12-17 5:24 [gentoo-user] A Gentoo Enema Tom Eastman
2005-12-17 5:45 ` [gentoo-user] " Tom Eastman
2005-12-17 6:02 ` [gentoo-user] " Steven Ringwald
@ 2005-12-17 6:45 ` Willie Wong
2005-12-17 7:23 ` Richard Fish
` (2 subsequent siblings)
5 siblings, 0 replies; 26+ messages in thread
From: Willie Wong @ 2005-12-17 6:45 UTC (permalink / raw
To: gentoo-user
On Sat, Dec 17, 2005 at 06:24:37PM +1300, Penguin Lover Tom Eastman squawked:
> Is there a tool that will allow me to find *all* files that aren't owned
> by any package, so that I can then decide what to do with them?
> Obviously skipping directories such as /home/. Then I can delete
> everything that doesn't look critical, hopefully without losing my stuff
> in places like /boot or /etc either :-)
There was this script by Benjamin Braatz called findcruft.
http://forums.gentoo.org/viewtopic.php?t=254197&highlight=findcruft
HTH
W
--
"I assume you've all done stationary phase integrals...right?"
~DeathMech, S. Sondhi. P-town PHY 205
Sortir en Pantoufles: up 34 days, 23:03
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-user] A Gentoo Enema
2005-12-17 5:24 [gentoo-user] A Gentoo Enema Tom Eastman
` (2 preceding siblings ...)
2005-12-17 6:45 ` Willie Wong
@ 2005-12-17 7:23 ` Richard Fish
2005-12-17 9:49 ` Neil Bothwick
2005-12-17 12:29 ` [gentoo-user] " reader
5 siblings, 0 replies; 26+ messages in thread
From: Richard Fish @ 2005-12-17 7:23 UTC (permalink / raw
To: gentoo-user
On 12/16/05, Tom Eastman <tom@cs.otago.ac.nz> wrote:
> Is there a tool that will allow me to find *all* files that aren't owned
> by any package, so that I can then decide what to do with them?
It should be fairly simple to generate such a list. You can generate
a list of all regular files that are owned by an installed package
with something like:
cd /var/db/pkg; find . -name CONTENTS -exec cat {} \; | grep ^obj |
awk '{print $2}' | sort
And then a list of all regular files on your system with:
find / -type f | grep -v -e "^/home" -e "^/tmp" -e "^/var/db" -e
"^/var/tmp" | sort
Then you just have to diff the two lists to find things that are not
owned by a package...
-Richard
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-user] A Gentoo Enema
2005-12-17 5:24 [gentoo-user] A Gentoo Enema Tom Eastman
` (3 preceding siblings ...)
2005-12-17 7:23 ` Richard Fish
@ 2005-12-17 9:49 ` Neil Bothwick
2005-12-17 12:29 ` [gentoo-user] " reader
5 siblings, 0 replies; 26+ messages in thread
From: Neil Bothwick @ 2005-12-17 9:49 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 782 bytes --]
On Sat, 17 Dec 2005 18:24:37 +1300, Tom Eastman wrote:
> One idea I've had is to delete almost every entry in my 'world' file,
> and then do an 'emerge depclean'. That would be pretty cool, empty out
> a huge amount of stuff, and then start re-installing at my leisure.
That sounds like a lot of work and re-installation. The way I've done it
is to edit the world file, removing anything that I don't run, then do an
emerge depclean -p. anything that shows up that I want to keep, I put
back with emerge -n packagename. Then run depclean -p again until I am
happy with what it wants to remove.
There's no point in removing and reinstalling packages, especially if you
are going to to emerge -e world later.
--
Neil Bothwick
IBM: Inferior But Marketable.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-user] Re: A Gentoo Enema
2005-12-17 5:45 ` [gentoo-user] " Tom Eastman
@ 2005-12-17 10:04 ` Neil Bothwick
2005-12-22 14:52 ` Iain Buchanan
0 siblings, 1 reply; 26+ messages in thread
From: Neil Bothwick @ 2005-12-17 10:04 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 498 bytes --]
On Sat, 17 Dec 2005 18:45:24 +1300, Tom Eastman wrote:
> It would be cool if you could list every package based on when it was
> installed... so the stuff that is *reall* old can be freshened by a
> re-installation (with whatever my current compiler is)
How about
find /var/db/pkg -name '*.ebuild' ! -newer /var/db/pkg/sys-devel/gcc-3.4.4-r1/gcc-3.4.*
to find all packages compiled before your last compiler update.
--
Neil Bothwick
I believe the technical term is "Oops!"
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* [gentoo-user] Re: A Gentoo Enema
2005-12-17 5:24 [gentoo-user] A Gentoo Enema Tom Eastman
` (4 preceding siblings ...)
2005-12-17 9:49 ` Neil Bothwick
@ 2005-12-17 12:29 ` reader
2005-12-17 20:00 ` Tom Eastman
2005-12-18 11:23 ` Neil Bothwick
5 siblings, 2 replies; 26+ messages in thread
From: reader @ 2005-12-17 12:29 UTC (permalink / raw
To: gentoo-user
Tom Eastman <tom@cs.otago.ac.nz> writes:
> So what I want to do is give my computer a complete clean-out. What I
> really CAN'T be bothered doing is a complete format and re-install!
What you've described and what others have posted sounds more
compiicated and time consuming than doing what you CAN'T be bothered
with. Also allows the opportunity to redo any partitioning scheme
and swap setup that may have aged or not fill the bill any more.
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 26+ messages in thread
* [gentoo-user] Re: A Gentoo Enema
2005-12-17 12:29 ` [gentoo-user] " reader
@ 2005-12-17 20:00 ` Tom Eastman
2005-12-18 11:23 ` Neil Bothwick
1 sibling, 0 replies; 26+ messages in thread
From: Tom Eastman @ 2005-12-17 20:00 UTC (permalink / raw
To: gentoo-user
reader@newsguy.com wrote:
> What you've described and what others have posted sounds more
> compiicated and time consuming than doing what you CAN'T be bothered
> with. Also allows the opportunity to redo any partitioning scheme
> and swap setup that may have aged or not fill the bill any more.
*almost*.
Reformatting, repartitioning, and re-bootstrapping is exactly the step I
want to avoid. I'm pretty much happy with my setup in that regard. :-)
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-user] Re: A Gentoo Enema
2005-12-17 12:29 ` [gentoo-user] " reader
2005-12-17 20:00 ` Tom Eastman
@ 2005-12-18 11:23 ` Neil Bothwick
2005-12-18 13:46 ` Michael Crute
2005-12-18 20:58 ` reader
1 sibling, 2 replies; 26+ messages in thread
From: Neil Bothwick @ 2005-12-18 11:23 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1142 bytes --]
On Sat, 17 Dec 2005 06:29:41 -0600, reader@newsguy.com wrote:
> > So what I want to do is give my computer a complete clean-out. What I
> > really CAN'T be bothered doing is a complete format and re-install!
> What you've described and what others have posted sounds more
> compiicated and time consuming than doing what you CAN'T be bothered
> with. Also allows the opportunity to redo any partitioning scheme
> and swap setup that may have aged or not fill the bill any more.
There are some major advantages to not re-installing. One is that all
your settings remain untouched, whereas a reinstall requires you to
reconfigure everything.
A more important difference is that the computer cannot be used for
anything else during reinstallation, whereas a clean up is performed on
a running system. It is also a lot less work that a reinstallation,
especially if you do it regularly. All you really need to do is clean
the world file of any cruft, emerge depclean && revdep-rebuild and run
the script to clean orphaned files from /etc.
--
Neil Bothwick
Hot tip #345: Never whistle while drinking coffee.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-user] Re: A Gentoo Enema
2005-12-18 11:23 ` Neil Bothwick
@ 2005-12-18 13:46 ` Michael Crute
2005-12-18 20:58 ` reader
1 sibling, 0 replies; 26+ messages in thread
From: Michael Crute @ 2005-12-18 13:46 UTC (permalink / raw
To: gentoo-user
On 12/18/05, Neil Bothwick <neil@digimed.co.uk> wrote:
> On Sat, 17 Dec 2005 06:29:41 -0600, reader@newsguy.com wrote:
>
>
> > > So what I want to do is give my computer a complete clean-out. What I
> > > really CAN'T be bothered doing is a complete format and re-install!
>
> There are some major advantages to not re-installing. One is that all
> your settings remain untouched, whereas a reinstall requires you to
> reconfigure everything.
>
> A more important difference is that the computer cannot be used for
> anything else during reinstallation, whereas a clean up is performed on
> a running system. It is also a lot less work that a reinstallation,
> especially if you do it regularly. All you really need to do is clean
> the world file of any cruft, emerge depclean && revdep-rebuild and run
> the script to clean orphaned files from /etc.
I recently had a similar issue. I seriously b0rked my box by upgrading
gcc, neglecting to read the upgrade guide, and pruning the old gcc
thus breaking just about EVERYTHING.
What I did was recover to a semi-usable state, create a chrooted
environment on my disk, unpacked a stage and did a complete
re-install, the whole time I was using the computer for some
programming work. When all the builds completed I just tarred up the
old / partition and the new one from my build environment, booted a
livecd and unpacked the new / over the old one, no format involved. It
was a major pain in the butt that I hope to never repeat but it gave
me a new system while still letting me use my old system.
Still, if all you want to do is clean up cruft there are far better
ways than re-installing your whole system. That's something windoze
users do ;-)
-Mike
--
________________________________
Michael E. Crute
Software Developer
SoftGroup Development Corporation
Linux takes junk and turns it into something useful.
Windows takes something useful and turns it into junk.
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 26+ messages in thread
* [gentoo-user] Re: A Gentoo Enema
2005-12-18 11:23 ` Neil Bothwick
2005-12-18 13:46 ` Michael Crute
@ 2005-12-18 20:58 ` reader
1 sibling, 0 replies; 26+ messages in thread
From: reader @ 2005-12-18 20:58 UTC (permalink / raw
To: gentoo-user
Neil Bothwick <neil@digimed.co.uk> writes:
> There are some major advantages to not re-installing. One is that all
> your settings remain untouched, whereas a reinstall requires you to
> reconfigure everything.
Neil,
You're going to have to slow down on all these usefull posts. I keep
lots of stuff (after serious trimming) like what came after above in a
homemade db for later reference and its growing at a prodigious rate:
wc -l ~/.*-snp
2064 /home/reader/.awk-snp
514 /home/reader/.cvs-snp
3350 /home/reader/.gnumacs-snp
1152 /home/reader/.lisp-snp
** Yours go here usually
11703 /home/reader/.misc-snp
1841 /home/reader/.perl-snp
879 /home/reader/.sendmail-snp
1422 /home/reader/.vi-snp
========
22975
Thats a lot o lines for a text file.
Between you and Richard F, I'll have to start charging for
hdd soon : )
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-user] Re: A Gentoo Enema
2005-12-17 10:04 ` Neil Bothwick
@ 2005-12-22 14:52 ` Iain Buchanan
2005-12-22 19:32 ` Neil Bothwick
0 siblings, 1 reply; 26+ messages in thread
From: Iain Buchanan @ 2005-12-22 14:52 UTC (permalink / raw
To: gentoo-user
On Sat, 2005-12-17 at 10:04 +0000, Neil Bothwick wrote:
> On Sat, 17 Dec 2005 18:45:24 +1300, Tom Eastman wrote:
>
> > It would be cool if you could list every package based on when it was
> > installed... so the stuff that is *reall* old can be freshened by a
> > re-installation (with whatever my current compiler is)
>
> How about
>
> find /var/db/pkg -name '*.ebuild' ! -newer /var/db/pkg/sys-devel/gcc-3.4.4-r1/gcc-3.4.*
>
> to find all packages compiled before your last compiler update.
There's also app-portage/genlop, quite nice for doing various things:
$ genlop evolution
* net-mail/evolution
Sat May 1 15:36:46 2004 >>> net-mail/evolution-1.4.6
Fri Sep 24 11:59:02 2004 >>> mail-client/evolution-2.0.0
Tue Oct 19 21:17:52 2004 >>> mail-client/evolution-2.0.2
Thu Nov 11 19:29:00 2004 >>> mail-client/evolution-2.0.2
Thu Nov 11 21:30:22 2004 >>> mail-client/evolution-2.0.2
Fri Nov 12 11:25:29 2004 >>> mail-client/evolution-2.0.2
Tue Nov 16 17:05:45 2004 >>> mail-client/evolution-2.0.2
Wed Jan 5 19:42:42 2005 >>> mail-client/evolution-2.0.3
Mon Jan 24 09:50:56 2005 >>> mail-client/evolution-2.0.3-r1
Sat Feb 19 22:00:52 2005 >>> mail-client/evolution-2.0.3-r2
Fri Mar 4 10:53:57 2005 >>> mail-client/evolution-2.0.4
Tue May 3 15:00:41 2005 >>> mail-client/evolution-2.2.1.1
Tue Jul 5 22:35:23 2005 >>> mail-client/evolution-2.2.1.1
Mon Jul 11 15:42:08 2005 >>> mail-client/evolution-2.2.3
Tue Jul 26 10:53:30 2005 >>> mail-client/evolution-2.2.3-r2
Sun Aug 21 18:05:49 2005 >>> mail-client/evolution-2.2.3-r2
Sat Sep 3 00:38:31 2005 >>> mail-client/evolution-2.2.3-r3
Fri Oct 14 14:43:07 2005 >>> mail-client/evolution-2.4.1
Sun Dec 11 19:55:31 2005 >>> mail-client/evolution-2.4.2.1
--
Iain Buchanan <iaindb at netspace dot net dot au>
COBOL is for morons.
-- E.W. Dijkstra
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-user] Re: A Gentoo Enema
2005-12-22 14:52 ` Iain Buchanan
@ 2005-12-22 19:32 ` Neil Bothwick
2005-12-22 21:37 ` reader
0 siblings, 1 reply; 26+ messages in thread
From: Neil Bothwick @ 2005-12-22 19:32 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 576 bytes --]
On Fri, 23 Dec 2005 00:22:24 +0930, Iain Buchanan wrote:
> > find /var/db/pkg -name '*.ebuild' !
> > -newer /var/db/pkg/sys-devel/gcc-3.4.4-r1/gcc-3.4.*
> >
> > to find all packages compiled before your last compiler update.
>
> There's also app-portage/genlop, quite nice for doing various things:
genlop is really nice, I use it all the time, but I don't think it has an
option to find all packages installed after a particular package. It
would be a nice variation on the --date option.
--
Neil Bothwick
Happiness is merely the remission of pain.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* [gentoo-user] Re: A Gentoo Enema
2005-12-22 19:32 ` Neil Bothwick
@ 2005-12-22 21:37 ` reader
2005-12-22 22:59 ` Neil Bothwick
0 siblings, 1 reply; 26+ messages in thread
From: reader @ 2005-12-22 21:37 UTC (permalink / raw
To: gentoo-user
Neil Bothwick <neil@digimed.co.uk> writes:
> On Fri, 23 Dec 2005 00:22:24 +0930, Iain Buchanan wrote:
>
>> > find /var/db/pkg -name '*.ebuild' !
>> > -newer /var/db/pkg/sys-devel/gcc-3.4.4-r1/gcc-3.4.*
>> >
>> > to find all packages compiled before your last compiler update.
>>
>> There's also app-portage/genlop, quite nice for doing various things:
>
> genlop is really nice, I use it all the time, but I don't think it has an
> option to find all packages installed after a particular package. It
> would be a nice variation on the --date option.
Isn't the output in chrono order?
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-user] Re: A Gentoo Enema
2005-12-22 21:37 ` reader
@ 2005-12-22 22:59 ` Neil Bothwick
2005-12-23 0:32 ` reader
0 siblings, 1 reply; 26+ messages in thread
From: Neil Bothwick @ 2005-12-22 22:59 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 587 bytes --]
On Thu, 22 Dec 2005 15:37:35 -0600, reader@newsguy.com wrote:
> > genlop is really nice, I use it all the time, but I don't think it
> > has an option to find all packages installed after a particular
> > package. It would be a nice variation on the --date option.
>
> Isn't the output in chrono order?
Yes, but then you'd have to do some funky regexp stuff to find the last
line showing gcc (in this case) and only show the lines after it. It was
a lot easier to do this with find -newer.
--
Neil Bothwick
Protect your software at all costs -- all else is meat.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* [gentoo-user] Re: A Gentoo Enema
2005-12-22 22:59 ` Neil Bothwick
@ 2005-12-23 0:32 ` reader
2005-12-23 7:47 ` Neil Bothwick
0 siblings, 1 reply; 26+ messages in thread
From: reader @ 2005-12-23 0:32 UTC (permalink / raw
To: gentoo-user
Neil Bothwick <neil@digimed.co.uk> writes:
> On Thu, 22 Dec 2005 15:37:35 -0600, reader@newsguy.com wrote:
>
>> > genlop is really nice, I use it all the time, but I don't think it
>> > has an option to find all packages installed after a particular
>> > package. It would be a nice variation on the --date option.
>>
>> Isn't the output in chrono order?
>
> Yes, but then you'd have to do some funky regexp stuff to find the last
> line showing gcc (in this case) and only show the lines after it. It was
> a lot easier to do this with find -newer.
Here is a pooryly coded sloppy perl script I just wrote.
Rather than get to tricky with date regex it relies on genlop output
being in chrono order. If it ever isn't I'm sunk.
It might be something you'd like, although it doesn't do any error
checking or testing etc and I've only done very limited testing:
This script expects to be run in a pipe with genlop -v --list
(Example: genlop -v --list|RevChron.pl "/gcc-3.6")
-------- 8< snip -----------
#!/usr/local/bin/perl -w
# Keywords: RevChron.pl - designed to manipulate genlop -v --list output,
# finding packages installed since some specific package.
# Dec 22 18:18:06 2005 4
# &&
use diagnostics;
my ($PreReg,$Regex,$OurLine,@Out,@RevOut,@RevChron,@Chron);
my $myscript;
($myscript = $0) =~ s:^.*/::;
## print usage if no cmdline arg is given or "help" is given
if(!$ARGV[0] || $ARGV[0] eq "help"){
usage();
exit;
}
## Compile our regex
$PreReg = shift;
$Regex = qr/$PreReg/;
## parse genlop --list output keeping a variable each
## time a line machtches our Regex (Last match will be ours)
while(<>){
chomp;
if(/$Regex/){
$OurLine = $_;
}
push @Out, $_;
}
if(!$OurLine){
print "
No hits on your regex <$PreReg> were found ... exiting
";
exit;
}
## Reverse the output and grab lines until we find OurLine
@RevOut = reverse @Out;
for(@RevOut){
if($OurLine eq $_ ){
## grab it too
push @RevChron,$_;
last;
}
push @RevChron,$_;
}
## Reverse whats left again so its in chrono order
@Chron = reverse @RevChron;
## Print the captured lines we need.
for(@Chron){
print "$_\n";;
}
sub usage {
print "
Purpose: Show packages after specific package in genlop output
Usage: \`genlop -v --list|$myscript REGEX '
Where REGEX is a good/unique identifier for a specific package.
Example: \`genlop -v --list|$myscript /gcc-3.6'
(type \`$myscript help' for usage)
";
};
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-user] Re: A Gentoo Enema
@ 2005-12-23 4:42 Beau E. Cox
2005-12-23 7:25 ` Neil Bothwick
0 siblings, 1 reply; 26+ messages in thread
From: Beau E. Cox @ 2005-12-23 4:42 UTC (permalink / raw
To: gentoo-user@lists.gentoo.org
Hi reader -
At 2005-12-22, 11:37:35 you wrote:
>Neil Bothwick <neil@digimed.co.uk> writes:
>
>> On Fri, 23 Dec 2005 00:22:24 +0930, Iain Buchanan wrote:
>>
>>> > find /var/db/pkg -name '*.ebuild' !
>>> > -newer /var/db/pkg/sys-devel/gcc-3.4.4-r1/gcc-3.4.*
>>> >
>>> > to find all packages compiled before your last compiler update.
>>>
>>> There's also app-portage/genlop, quite nice for doing various things:
>>
>> genlop is really nice, I use it all the time, but I don't think it has an
>> option to find all packages installed after a particular package. It
>> would be a nice variation on the --date option.
>
>Isn't the output in chrono order?
>
This is exactly why I wrote 'echanges' perl script:
I have a small perl script, 'echanges', that determines the latest
timestamp for installed packages; I find it very helpful to determine
what my daily cron of 'emerge -uD world' has done. I will post it
here if there is any interest;
The manual page follows:
NAME
echanges - display the timestamp for installed Gentoo packages.
SYNOPSIS
echanges [options]
options:
--help | -? this page ( ddduuuuhhhh ).
--man complete man page.
--since=dt | -s dt packages since dt[yesterday,<nbr>{h|d|w|y}]
[DEFAULT: all].
--time | -t sort descending by timestamp [DEFAULT].
--reverse | -r reverse the sort order.
--progress | -p print progress to STDERR.
examples:
# display timestamps for all installed packages in descending
# order by timestamp:
$ echanges
# display timestamps for packages installed/updated since yesterday
# in ascending order by timestamp with a progress hint:
$ echanges --since=yesterday --time --reverse --progress
# display timestamps for packages installed/updated since two days ago
# in descending order by package name:
$ echanges -rns 2d
# to see the complete manual:
$ echanges --man
DESCRIPTION
echanges tracks the latest Gentoo package installs/updates. I find it
very helpful in knowing when I should restart my user sessions ( after a
kde update ), compile the kernel and reboot ( after new kernel sources
), and when to run *etc-update*, among other uses.
Internally, this perl script issues equerys ( *equery* in *gentoolkit*
). First a list of all installed packages is obtained with:
equery -C list
Next, for each package installed, the following equery is issued:
equery -C files --timestamp --filter=obj <package-name>
This list is processed to get the timestamp of the most recent file and
associate that timestamp with the package.
Finally, the list of packages with timestamps is filtered according to
the options passed ( see "OPTIONS" below ) and displayed.
OPTIONS
--since=time -or- -s time
Only display packages since 'time', where time can be one of:
yesterday
24 hours ago.
<number>h
'number' hours ago.
<number>d
'number' days ago.
<number>w
'number' weeks ago.
<number>m
'number' months ( 30 days ) ago.
<number>y
'number' years ago.
DEFAULT:
All packages selected.
--time -or- -t
Sorts in descending order by timestamp [DEFAULT].
--name -or- -n
Sorts in ascending order by package name.
--reverse -or- -r
Reverses the sort selected.
--progress | -p
Print progress ( currently processing package ) to STDERR.
*echanges* can take a long time on slower systems with many packages
installed; use --progress if you need assurance that all is well.
REQUIRES
Gentoo Linux with the *gentoolkit* installed:
emerge gentoolkit
SEE ALSO
Gentoo documentation and *equery* documentation in the *gentoolkit*.
AUTHOR
Beau E. Cox, <beaucox@hawaii.rr.com>
COPYRIGHT AND LICENSE
Copyright (C) 2005-2006 by Beau E. Cox
This script is free software; you can redistribute it and/or modify it
under the same terms as Perl itself, either Perl version 5.8.7 or, at
your option, any later version of Perl 5 you may have available.
Aloha => Beau;
beaucox@hawaii.rr.com
2005-12-22
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-user] Re: A Gentoo Enema
2005-12-23 4:42 Beau E. Cox
@ 2005-12-23 7:25 ` Neil Bothwick
0 siblings, 0 replies; 26+ messages in thread
From: Neil Bothwick @ 2005-12-23 7:25 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 520 bytes --]
On Thu, 22 Dec 2005 18:42:38 -1000, Beau E. Cox wrote:
> I have a small perl script, 'echanges', that determines the latest
> timestamp for installed packages; I find it very helpful to determine
> what my daily cron of 'emerge -uD world' has done. I will post it
> here if there is any interest;
But genlop already does that. What it is missing is the option to use the
installation date of another package as the argument to --date.
--
Neil Bothwick
CAUTION: Do not install prior to installation.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-user] Re: A Gentoo Enema
2005-12-23 0:32 ` reader
@ 2005-12-23 7:47 ` Neil Bothwick
2005-12-23 15:15 ` reader
2005-12-23 15:17 ` reader
0 siblings, 2 replies; 26+ messages in thread
From: Neil Bothwick @ 2005-12-23 7:47 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 828 bytes --]
On Thu, 22 Dec 2005 18:32:23 -0600, reader@newsguy.com wrote:
> > Yes, but then you'd have to do some funky regexp stuff to find the
> > last line showing gcc (in this case) and only show the lines after
> > it. It was a lot easier to do this with find -newer.
>
> Here is a pooryly coded sloppy perl script I just wrote.
> Rather than get to tricky with date regex it relies on genlop output
> being in chrono order. If it ever isn't I'm sunk.
What's wrong with using a simple find command as I originally posted?
However, if you want to do it with genlop, here's a one line bash
script.
#!/bin/sh
genlop --list --date "$(genlop --nocolor $1 | grep $1 | tail -n 1 | sed 's/^ *\(.*\) >>>.*/\1/')"
--
Neil Bothwick
My friends went to alt.california, and all they brought
me was this lousy sig.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* [gentoo-user] Re: A Gentoo Enema
2005-12-23 7:47 ` Neil Bothwick
@ 2005-12-23 15:15 ` reader
2005-12-23 17:06 ` Neil Bothwick
2005-12-23 15:17 ` reader
1 sibling, 1 reply; 26+ messages in thread
From: reader @ 2005-12-23 15:15 UTC (permalink / raw
To: gentoo-user
Neil Bothwick <neil@digimed.co.uk> writes:
> genlop --list --date "$(genlop --nocolor $1 | grep $1 | tail -n 1 | sed 's/^ *\(.*\) >>>.*/\1/')"
What is it supposed to do? Here it gets genlops usage message.
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 26+ messages in thread
* [gentoo-user] Re: A Gentoo Enema
2005-12-23 7:47 ` Neil Bothwick
2005-12-23 15:15 ` reader
@ 2005-12-23 15:17 ` reader
2005-12-23 17:04 ` Neil Bothwick
1 sibling, 1 reply; 26+ messages in thread
From: reader @ 2005-12-23 15:17 UTC (permalink / raw
To: gentoo-user
Neil Bothwick <neil@digimed.co.uk> writes:
> What's wrong with using a simple find command as I originally posted?
Do you mean run against / or what?
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-user] Re: A Gentoo Enema
2005-12-23 15:17 ` reader
@ 2005-12-23 17:04 ` Neil Bothwick
0 siblings, 0 replies; 26+ messages in thread
From: Neil Bothwick @ 2005-12-23 17:04 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 417 bytes --]
On Fri, 23 Dec 2005 09:17:37 -0600, reader@newsguy.com wrote:
> > What's wrong with using a simple find command as I originally posted?
>
> Do you mean run against / or what?
Against /var/db/pkg, where you'll find everything you have installed,
complete with datestamps. See my first post in this thread.
--
Neil Bothwick
Never get into fights with ugly people because they have nothing to lose.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-user] Re: A Gentoo Enema
2005-12-23 15:15 ` reader
@ 2005-12-23 17:06 ` Neil Bothwick
2005-12-23 18:09 ` reader
0 siblings, 1 reply; 26+ messages in thread
From: Neil Bothwick @ 2005-12-23 17:06 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 483 bytes --]
On Fri, 23 Dec 2005 09:15:31 -0600, reader@newsguy.com wrote:
> > genlop --list --date "$(genlop --nocolor $1 | grep $1 | tail -n 1 |
> > sed 's/^ *\(.*\) >>>.*/\1/')"
>
> What is it supposed to do? Here it gets genlops usage message.
you need to give the name of the package you want to compare against as
an argument to the script. Sorry, I should have made that clear.
--
Neil Bothwick
We are THOR of Borg... your RFC compliant mailbox has been assimilated
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* [gentoo-user] Re: A Gentoo Enema
2005-12-23 17:06 ` Neil Bothwick
@ 2005-12-23 18:09 ` reader
2005-12-23 18:38 ` Neil Bothwick
0 siblings, 1 reply; 26+ messages in thread
From: reader @ 2005-12-23 18:09 UTC (permalink / raw
To: gentoo-user
Neil Bothwick <neil@digimed.co.uk> writes:
> On Fri, 23 Dec 2005 09:15:31 -0600, reader@newsguy.com wrote:
>
>> > genlop --list --date "$(genlop --nocolor $1 | grep $1 | tail -n 1 |
>> > sed 's/^ *\(.*\) >>>.*/\1/')"
>>
>> What is it supposed to do? Here it gets genlops usage message.
>
> you need to give the name of the package you want to compare against as
> an argument to the script. Sorry, I should have made that clear.
Why would you trim off the date info?
With your find approach, if the package has been uninstalled you'll
find nothing.
If you were wanting to know if some other behaviour could be dated to
the uninstall of something it would be of no use.
Genlop knows about that kind of stuff.
The perl script searches from the front back and so has grabbed
everthing since argument package. For example, if a package was
installed and uninstalled several times it would still find the most
recent and everything since.
I didn't really test it much ... did you see something that would
break it?
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [gentoo-user] Re: A Gentoo Enema
2005-12-23 18:09 ` reader
@ 2005-12-23 18:38 ` Neil Bothwick
0 siblings, 0 replies; 26+ messages in thread
From: Neil Bothwick @ 2005-12-23 18:38 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1502 bytes --]
On Fri, 23 Dec 2005 12:09:47 -0600, reader@newsguy.com wrote:
> >> > genlop --list --date "$(genlop --nocolor $1 | grep $1 | tail -n 1 |
> >> > sed 's/^ *\(.*\) >>>.*/\1/')"
> >>
> >> What is it supposed to do? Here it gets genlops usage message.
> >
> > you need to give the name of the package you want to compare against
> > as an argument to the script. Sorry, I should have made that clear.
>
> Why would you trim off the date info?
To pass to genlop with --date, in order to get a list of all packages
installed after that date.
> With your find approach, if the package has been uninstalled you'll
> find nothing.
Of course. The question was about finding all packages installed after a
particular reference package, in this case gcc. If the reference package
is no longer installed 9impossible with gcc of course) the question
becomes pointless.
> If you were wanting to know if some other behaviour could be dated to
> the uninstall of something it would be of no use.
It would, you'd only have to modify it to use genlop's -u option.
All of this is irrelevant anyway, using genlop and parsing the output is
going round three sides of a square instead of going in a straight line
with find. Using a non-standard bash or perl script to parse the output
of an optional perl script seems rather redundant when you can do it all
with one call to a core command.
--
Neil Bothwick
After a few years in space, even Worf started to look good...
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2005-12-23 18:54 UTC | newest]
Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-17 5:24 [gentoo-user] A Gentoo Enema Tom Eastman
2005-12-17 5:45 ` [gentoo-user] " Tom Eastman
2005-12-17 10:04 ` Neil Bothwick
2005-12-22 14:52 ` Iain Buchanan
2005-12-22 19:32 ` Neil Bothwick
2005-12-22 21:37 ` reader
2005-12-22 22:59 ` Neil Bothwick
2005-12-23 0:32 ` reader
2005-12-23 7:47 ` Neil Bothwick
2005-12-23 15:15 ` reader
2005-12-23 17:06 ` Neil Bothwick
2005-12-23 18:09 ` reader
2005-12-23 18:38 ` Neil Bothwick
2005-12-23 15:17 ` reader
2005-12-23 17:04 ` Neil Bothwick
2005-12-17 6:02 ` [gentoo-user] " Steven Ringwald
2005-12-17 6:45 ` Willie Wong
2005-12-17 7:23 ` Richard Fish
2005-12-17 9:49 ` Neil Bothwick
2005-12-17 12:29 ` [gentoo-user] " reader
2005-12-17 20:00 ` Tom Eastman
2005-12-18 11:23 ` Neil Bothwick
2005-12-18 13:46 ` Michael Crute
2005-12-18 20:58 ` reader
-- strict thread matches above, loose matches on Subject: below --
2005-12-23 4:42 Beau E. Cox
2005-12-23 7:25 ` Neil Bothwick
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox