On Mon, Sep 10, 2012 at 09:36:25PM +0200, Alan McKinnon wrote:
> On Mon, 10 Sep 2012 12:53:41 -0400
> Andrey Moshbear <andrey....@gmail.com> wrote:
> 
> > On Mon, Sep 10, 2012 at 12:43 PM, Nikos Chantziaras
> > <rea...@gmail.com> wrote:
> > > On 10/09/12 19:12, Samuraiii wrote:
> > >>
> > >> Hello,
> > >> because I broke me PC and I need to reinstall it I'm going ask what
> > >> should I preserve to make install faster:
> > >
> > > So what *is* broken?  The hardware?  If you have a new PC, you
> > > simply need to transfer your Gentoo install to a new hard disk
> > > using rsync.
> > 
> > He borked his /usr/include due to an improperly-written uninstall rule
> > in a Makefile.

What about a script that looks for all installed packages, looks at what they
installed into /usr/include, and extracts those files from the sources?

Just some basic thoughts:

Get all file lists for installed packages:
find /var/db/pkg/ -type f -name CONTENTS

# extract package name and version from path of the file, e.g.
/var/db/pkg/kde-base/kdelibs-4.9.1/CONTENT
would yield name = kde-base/kdelibs, version = 4.9.1

Find out the source archive file from the ebuild (there's probably a nice
python way for this. As a last resort, some one-liner like
emerge -pvfO "=$name-$version"|sed -n '1s_.*/\(.*\) .*_\1_gp'
which gets the filename of the first URL that emerge spits out.

Now extract all those files from the source archive whose path starts with
/usr/include in the CONTENTS file.
-- 
Gruß | Greetings | Qapla'
Please do not share anything from, with or about me with any Facebook service.

The situation is hopeless, but not serious.

Attachment: signature.asc
Description: Digital signature

Reply via email to