Mailing List Archive

restore package.keywords?
Hey all. I accidently used '>' instead of '>>' when adding a line to
my /etc/portage/package.keywords file. Is there any way to recover the
list based on the installed packages somehow? Not a HUGE deal to go
through an emerge -u world to figure out what's trying to be downgraded,
but I had a fairly long list and I'd much rather not :)

TIA

alan

--
Alan <alan@ufies.org> - http://arcterex.net
--------------------------------------------------------------------
"There are only 3 real sports: bull-fighting, car racing and mountain
climbing. All the others are mere games." -- Hemingway

--
gentoo-user@gentoo.org mailing list
Re: restore package.keywords? [ In reply to ]
* Alan <alan@ufies.org>
> Hey all. I accidently used '>' instead of '>>' when adding a line to
> my /etc/portage/package.keywords file. Is there any way to recover the
> list based on the installed packages somehow?

I was able to rebuild it with the following command, which gives you a
list of ebuilds installed with KEYWORDS=~x86.

find /var/db/pkg -name \*.ebuild -print | xargs egrep "^KEYWORDS.*~x86"

There probably are scenarios where this will fail, but in my case, the
list of ebuilds that this command generated was exactly what i had in
my package.keywords.

regards
steingrim dovland

--
gentoo-user@gentoo.org mailing list
Re: restore package.keywords? [ In reply to ]
* Alan <alan@ufies.org>
> Hey all. I accidently used '>' instead of '>>' when adding a line to
> my /etc/portage/package.keywords file. Is there any way to recover the
> list based on the installed packages somehow?

I was able to rebuild it with the following command, which gives you a
list of ebuilds installed with KEYWORDS=~x86.

find /var/db/pkg -name \*.ebuild -print | xargs egrep "^KEYWORDS.*~x86"

There probably are scenarios where this will fail, but in my case, the
list of ebuilds that this command generated was exactly what i had in
my package.keywords.

regards
steingrim dovland

--
gentoo-user@gentoo.org mailing list
restore package.keywords? [ In reply to ]
On Mon, 18 Oct 2004 14:31:23 -0700, Alan <alan@ufies.org> wrote:
> Hey all. I accidently used '>' instead of '>>' when adding a line to
> my /etc/portage/package.keywords file. Is there any way to recover the
> list based on the installed packages somehow? Not a HUGE deal to go
> through an emerge -u world to figure out what's trying to be downgraded,
> but I had a fairly long list and I'd much rather not :)
>
> TIA
>
> alan
>

You might like to put set noclobber in your ~/.bashrc file (assuming
your using bash), this prevents cat from doing that (you can override
it with >| )

--
gentoo-user@gentoo.org mailing list
restore package.keywords? [ In reply to ]
On Mon, 18 Oct 2004 14:31:23 -0700, Alan <alan@ufies.org> wrote:
> Hey all. I accidently used '>' instead of '>>' when adding a line to
> my /etc/portage/package.keywords file. Is there any way to recover the
> list based on the installed packages somehow? Not a HUGE deal to go
> through an emerge -u world to figure out what's trying to be downgraded,
> but I had a fairly long list and I'd much rather not :)
>
> TIA
>
> alan
>

You might like to put set noclobber in your ~/.bashrc file (assuming
your using bash), this prevents cat from doing that (you can override
it with >| )

--
gentoo-user@gentoo.org mailing list
Re: restore package.keywords? [ In reply to ]
On Tue, 2004-10-19 at 08:33 +0200, Steingrim Dovland wrote:
> * Alan <alan@ufies.org>
> > Hey all. I accidently used '>' instead of '>>' when adding a line to
> > my /etc/portage/package.keywords file. Is there any way to recover the
> > list based on the installed packages somehow?
>
> I was able to rebuild it with the following command, which gives you a
> list of ebuilds installed with KEYWORDS=~x86.
>
> find /var/db/pkg -name \*.ebuild -print | xargs egrep "^KEYWORDS.*~x86"
>
> There probably are scenarios where this will fail, but in my case, the
> list of ebuilds that this command generated was exactly what i had in
> my package.keywords.

Seems to work, many thanks, just need to massage it a bit in vim and I'm
happy again!

alan

--
Alan <alan@ufies.org> - http://arcterex.net
--------------------------------------------------------------------
"There are only 3 real sports: bull-fighting, car racing and mountain
climbing. All the others are mere games." -- Hemingway



--
gentoo-user@gentoo.org mailing list
Re: restore package.keywords? [SOLVED] [ In reply to ]
On Mon, 2004-10-18 at 14:31 -0700, Alan wrote:
> Hey all. I accidently used '>' instead of '>>' when adding a line to
> my /etc/portage/package.keywords file. Is there any way to recover the
> list based on the installed packages somehow? Not a HUGE deal to go

Just in case anyone was wondering, and for the archives, here's the full
solution, thanks to those who responded:

find /var/db/pkg/ -name \*.ebuild -print | xargs egrep "^KEYWORDS.*~x86"
| sed -e 's!/var/db/pkg/!!g' | sed -e 's/.ebuild:KEY.*//g' | sed -e
's/-[0-9][0-9]*.*/ ~x86/g' | sort -u > package.keywords-NEW

With linebreaks removed as appropriate :)

Seems to work for me anyway, the end result looks a lot like what I had
before.

alan

--
Alan <alan@ufies.org> - http://arcterex.net
--------------------------------------------------------------------
"There are only 3 real sports: bull-fighting, car racing and mountain
climbing. All the others are mere games." -- Hemingway



--
gentoo-user@gentoo.org mailing list