Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 04 Nov 2006 07:58:08 -0600
From:      Eric Schuele <e.schuele@computer.org>
To:        Chris Whitehouse <chris@childeric.freeserve.co.uk>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: /var corrupted.....
Message-ID:  <454C9C70.9010401@computer.org>
In-Reply-To: <454BE131.9050303@childeric.freeserve.co.uk>
References:  <1162399232.4866.25.camel@ugly>	<4548D3DC.3060902@orchid.homeunix.org>	<454A0699.2000904@computer.org>	<17738.3589.181431.82582@jerusalem.litteratus.org>	<454AB54B.6060700@computer.org> <454BE131.9050303@childeric.freeserve.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
On 11/03/2006 18:39, Chris Whitehouse wrote:
> Eric Schuele wrote:
>> On 11/02/2006 09:25, Robert Huff wrote:
>>> Eric Schuele writes:
>>>
>>>>  How can I force a reinstall of a port and all its deps.
>>>
>>>     The port itself will handle anything "above".
>>
>> Well, that's what I had thought would happen, but the port does not 
>> seem to re-register the dependencies. It simply notes that they are 
>> present, and builds and registers the port I have attempted to `make 
>> install`. So for example if I go to /usr/ports/www/firefox, and `make 
>> install` it.  I only end up with firefox in my /var/db/pkg folder.  
>> None of its deps appear.
>>
>>>     As for things "below" ... you're pretty much hosed.  If the pkg
>>> db (or equivalent) existed, it would know which ports had been
>>> installed and could rebuild things.
>>>     Without the pkg db, the only record of what _should_ be
>>> installed is in your head.  
>>
> 
> Have you tried sysutils/portmanager?
> 
>  From the man page:
> " Determines ports that are out of date by comparing them to Makefiles
>      downloaded through cvsup into the ports tree"
> So it looks like it doesn't require /var/db/pkg to work.
> 
>  "-p or --pristine
>           Updates a port if any dependency in it's /var/db/pkg/{port
>          name}/+CONTENTS does not match what is installed. The effect is 
> when
>          a port is updated, any port who uses the updated port in it's 
> depen-
>          dency chain, no matter how deep, are rebuilt. Normally only 
> ports one
>          level up are rebuilt."
> 
> This looks like it rebuilds /var/db/pkg
> 
> You also probably need -f if your ports are up-to-date

Aha!
Example from the man page:
  rebuild  all installed ports

           portmanager -u -f

This might be my silver bullet.  Its been running for quite some time 
but it appears to be rebuilding everything and its full set of 
dependencies.  Thanks!

I've never used portmanager before.  Always portupgrade.  Nice.

I was having all sorts of difficulties using `pkgdb -F`.  possibly 
something else gone wrong on my machine.  It was complaining of 
DB_PAGE_NOTFOUND? and complaining that it could not convert nil to 
String?  Never seen it do that before.

Thanks!

> 
> I haven't tried it in these particular circumstances and I'm not sure if 
> I've read the man page right but it's worth a try, it's a pretty clever 
> utility.
> 
> Note if you try it on a single port you have to put the options after 
> the port name, see the EXAMPLES section. Also see my recent question 
> about portmanager and /tmp if you are rebuilding lots of ports in one 
> session.
> 
> Chris
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>> Yes.. this is now painfully obvious to me.  I guess in some way I had 
>> thought the pkg db, was simply a convenience.  But I now realize it is 
>> *the authority* on what is installed on your machine.  While I do plan 
>> to back it up from now on... I have added the two small scripts to my 
>> toolbox as well.
>>
>> I alias the following as port_install
>> #!/bin/sh
>>
>> #
>> # Used to create a log file of things I have installed on a machine
>> #
>>
>> make install clean && \
>>     printf "`pwd`\t\t\t`date`\n" >> /root/maint/install/port_install.log
>>
>> and the following as port_deinstall (mind the word-wrap).
>>
>> #!/bin/sh
>>
>> #
>> # Used to create a log file of things I have installed on a machine
>> #
>>
>> SCRIPT_DIR=/root/maint/install
>>
>> grep -v `pwd` $SCRIPT_DIR/port_install.log > 
>> $SCRIPT_DIR/port_deinstall.log
>> rm $SCRIPT_DIR/port_install.log
>> mv $SCRIPT_DIR/port_deinstall.log $SCRIPT_DIR/port_install.log
>>
>> make deinstall
>>
>>
>> Then I have a list of top level apps that *I* have installed.  I am 
>> using the above today, as I am reinstalling all top level apps.  :)
>>
>>> On the other hand, if you remeber
>>> certain leaf ports installing them will drag in most of the
>>> infrastructure.  (My candidates: OpenOffice, Firefox, Apache,
>>> something involving Java. GIMP.)  It will still take time, but
>>> within limits you can just let it run.
>>>
>>>     A scenario for the future: my /var/db/pkg has ~620 entries, and
>>> totals just over 62mb.  Building a tarball took less than a minute
>>> and ate another 60mb.  Might be a sound investment.
>>>
>>
>> yeah... I have already added /var/db/pkg to my backup scripts.  I 
>> backup a bunch of system stuff every time I buildworld.  I just wasn't 
>> getting that.
>>
>> Thanks.
>>>
>>>                 Robert Huff
>>> _______________________________________________
>>> freebsd-questions@freebsd.org mailing list
>>> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>>> To unsubscribe, send any mail to 
>>> "freebsd-questions-unsubscribe@freebsd.org"
>>>
>>
>>
> 
> 
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to 
> "freebsd-questions-unsubscribe@freebsd.org"
> 


-- 
Regards,
Eric



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?454C9C70.9010401>