Re: ports and /var/db/pkg

2003-04-04 Thread Danny Braniss

  ok, so i wrote a small script (tcl, since i don't know perl), that
  does some checking, it reports for each package, the number of files
  how many are realy there, and if so, checks the MD5.
 
  now, if im not to far off, if some/all files are missing, or if the
  md5 does not match, i should be able to remove the package info, ...
 
 Well, that's not what you were asking for originally, and tools
 already exist to check that.

OK, let me refrase it

PROBLEM:
how to update /var/db/pkg, when it knows too much,
i.e. /usr/local has less stuff that /var/db/pkg knows about.

 
 e.g. pkg_info -g and the example from the pkg_which(1) manpage that I
 mentioned to you in a previous email.

i read most of the pkg*, and though im very impressed, i fail to find a
clear/easy way to get a one line output saying:
pkg xyz no longer exits, can be removed from database
thanks,
danny


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: ports and /var/db/pkg

2003-04-04 Thread Matthew Emmerton

   ok, so i wrote a small script (tcl, since i don't know perl), that
   does some checking, it reports for each package, the number of files
   how many are realy there, and if so, checks the MD5.
  
   now, if im not to far off, if some/all files are missing, or if the
   md5 does not match, i should be able to remove the package info, ...
 
  Well, that's not what you were asking for originally, and tools
  already exist to check that.

 OK, let me refrase it

 PROBLEM:
 how to update /var/db/pkg, when it knows too much,
 i.e. /usr/local has less stuff that /var/db/pkg knows about.

 
  e.g. pkg_info -g and the example from the pkg_which(1) manpage that I
  mentioned to you in a previous email.

 i read most of the pkg*, and though im very impressed, i fail to find a
 clear/easy way to get a one line output saying:
 pkg xyz no longer exits, can be removed from database
 thanks,
 danny

If you know that package XYZ exists in /var/db/pkg but isn't in /usr/local
(probably because you didn't 'make deinstall' or pkg_delete it), just do
this:

rm -rf /var/db/pkg/XYZ

--
Matt Emmerton

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: ports and /var/db/pkg

2003-04-04 Thread Danny Braniss
 
ok, so i wrote a small script (tcl, since i don't know perl), that
does some checking, it reports for each package, the number of files
how many are realy there, and if so, checks the MD5.
   
now, if im not to far off, if some/all files are missing, or if the
md5 does not match, i should be able to remove the package info, ...
  
   Well, that's not what you were asking for originally, and tools
   already exist to check that.
 
  OK, let me refrase it
 
  PROBLEM:
  how to update /var/db/pkg, when it knows too much,
  i.e. /usr/local has less stuff that /var/db/pkg knows about.
 
  
   e.g. pkg_info -g and the example from the pkg_which(1) manpage that I
   mentioned to you in a previous email.
 
  i read most of the pkg*, and though im very impressed, i fail to find a
  clear/easy way to get a one line output saying:
  pkg xyz no longer exits, can be removed from database
  thanks,
  danny
 
 If you know that package XYZ exists in /var/db/pkg but isn't in /usr/local
 (probably because you didn't 'make deinstall' or pkg_delete it), just do
 this:
 
 rm -rf /var/db/pkg/XYZ
 

sorry, no points. it's a correct answer but that was/is not the question :-)
how do you know that XYZ is no longer there?
sure, pkg_info -g will tell you which files are no longer there, or have bad
md5, but is one file? or all files?

danny

 --
 Matt Emmerton
 


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: ports and /var/db/pkg

2003-04-04 Thread Peter Pentchev
On Fri, Apr 04, 2003 at 02:11:58PM +0300, Danny Braniss wrote:
 
   ok, so i wrote a small script (tcl, since i don't know perl), that
   does some checking, it reports for each package, the number of files
   how many are realy there, and if so, checks the MD5.
  
   now, if im not to far off, if some/all files are missing, or if the
   md5 does not match, i should be able to remove the package info, ...
  
  Well, that's not what you were asking for originally, and tools
  already exist to check that.
 
 OK, let me refrase it
 
 PROBLEM:
   how to update /var/db/pkg, when it knows too much,
   i.e. /usr/local has less stuff that /var/db/pkg knows about.
   
  
  e.g. pkg_info -g and the example from the pkg_which(1) manpage that I
  mentioned to you in a previous email.
 
 i read most of the pkg*, and though im very impressed, i fail to find a
 clear/easy way to get a one line output saying:
   pkg xyz no longer exits, can be removed from database

If you are only interested in packages which no longer have *any* files
on the filesystem, then compare the output of the following two
commands:

  pkg_info -qL package | wc -l
  pkg_info -qg package | wc -l

If the output of those two commands is the same, then there are no valid
package files left at all, and a pkg_delete -f is in order.

Moreover, if you are only interested in the existence of the files, it
would be easier to do something like:

  remove=1
  pkg_info -qL package | while read fname; do
  [ -f $fname ]  remove=0
  done
  if [ $remove == 1 ]; then pkg_delete package; fi

G'luck,
Peter

-- 
Peter Pentchev  [EMAIL PROTECTED][EMAIL PROTECTED][EMAIL PROTECTED]
PGP key:http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
yields falsehood, when appended to its quotation. yields falsehood, when appended to 
its quotation.


pgp0.pgp
Description: PGP signature


Re: ports and /var/db/pkg

2003-04-04 Thread Peter Pentchev
On Fri, Apr 04, 2003 at 04:14:19PM +0300, Peter Pentchev wrote:
 On Fri, Apr 04, 2003 at 02:11:58PM +0300, Danny Braniss wrote:
  
ok, so i wrote a small script (tcl, since i don't know perl), that
does some checking, it reports for each package, the number of files
how many are realy there, and if so, checks the MD5.
   
now, if im not to far off, if some/all files are missing, or if the
md5 does not match, i should be able to remove the package info, ...
   
   Well, that's not what you were asking for originally, and tools
   already exist to check that.
  
  OK, let me refrase it
  
  PROBLEM:
  how to update /var/db/pkg, when it knows too much,
  i.e. /usr/local has less stuff that /var/db/pkg knows about.
  
   
   e.g. pkg_info -g and the example from the pkg_which(1) manpage that I
   mentioned to you in a previous email.
  
  i read most of the pkg*, and though im very impressed, i fail to find a
  clear/easy way to get a one line output saying:
  pkg xyz no longer exits, can be removed from database
 
 If you are only interested in packages which no longer have *any* files
 on the filesystem, then compare the output of the following two
 commands:
 
   pkg_info -qL package | wc -l
   pkg_info -qg package | wc -l
 
 If the output of those two commands is the same, then there are no valid
 package files left at all, and a pkg_delete -f is in order.
 
 Moreover, if you are only interested in the existence of the files, it
 would be easier to do something like:
 
   remove=1
   pkg_info -qL package | while read fname; do
   [ -f $fname ]  remove=0
   done
   if [ $remove == 1 ]; then pkg_delete package; fi

Just one more comment: the reason I stick to pkg_delete -f instead
of rm -rf /var/db/pkg/package is that the /var/db/pkg scheme is not
really set in stone: the correct way to manipulate the package database
is *only* via the pkg_* tools.  Well, there is something to be said
about the tools available in ports/sysutils/portupgrade, but then,
they are actively maintained by knu, who will most probably track any
changes in the base system handling of packages, if and when those
should occur.

G'luck,
Peter

-- 
Peter Pentchev  [EMAIL PROTECTED][EMAIL PROTECTED][EMAIL PROTECTED]
PGP key:http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
Hey, out there - is it *you* reading me, or is it someone else?


pgp0.pgp
Description: PGP signature


Re: ports and /var/db/pkg

2003-04-04 Thread Ryan Merrick
Danny Braniss wrote:

ok, so i wrote a small script (tcl, since i don't know perl), that
does some checking, it reports for each package, the number of files
how many are realy there, and if so, checks the MD5.
now, if im not to far off, if some/all files are missing, or if the
md5 does not match, i should be able to remove the package info, ...
 

Well, that's not what you were asking for originally, and tools
already exist to check that.
   

OK, let me refrase it

PROBLEM:
how to update /var/db/pkg, when it knows too much,
i.e. /usr/local has less stuff that /var/db/pkg knows about.
 

e.g. pkg_info -g and the example from the pkg_which(1) manpage that I
mentioned to you in a previous email.
   

i read most of the pkg*, and though im very impressed, i fail to find a
clear/easy way to get a one line output saying:
pkg xyz no longer exits, can be removed from database
thanks,
danny
 

If you know that package XYZ exists in /var/db/pkg but isn't in /usr/local
(probably because you didn't 'make deinstall' or pkg_delete it), just do
this:
rm -rf /var/db/pkg/XYZ

   

sorry, no points. it's a correct answer but that was/is not the question :-)
how do you know that XYZ is no longer there?
sure, pkg_info -g will tell you which files are no longer there, or have bad
md5, but is one file? or all files?
danny

 

--
Matt Emmerton
   



___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]
 

Hello,

Take a look at pkgdb -F

 The pkgdb command also works as an interactive tool for fixing the pack-
age registry database when -F is specified.  It helps you resolve stale
dependencies, unlink cyclic dependencies, complete stale or missing 
ori-
gins and remove duplicates.  You have to run this periodically so
portupgrade(1) and other pkg_* tools can work effectively and unfail-
ingly.  From #man pkgdb (1)

-Ryan





___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: ports and /var/db/pkg

2003-04-04 Thread Dag-Erling Smørgrav
Matthew Emmerton [EMAIL PROTECTED] writes:
 If you know that package XYZ exists in /var/db/pkg but isn't in /usr/local
 (probably because you didn't 'make deinstall' or pkg_delete it), just do
 this:

 rm -rf /var/db/pkg/XYZ

Umm, no, just pkg_delete it and ignore the warnings about missing files.

DES
-- 
Dag-Erling Smørgrav - [EMAIL PROTECTED]
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: ports and /var/db/pkg

2003-04-03 Thread Kris Kennaway
On Thu, Apr 03, 2003 at 11:06:06AM +0300, Danny Braniss wrote:
 
  Only if you've never run 'make clean' (unlikely, if he's following
  directions).
  
 :-), specially since disk space tends to run out.
 
 so, if i understand the drift, there is no simple way to sync 'what is'
 with 'what should' be?

Correct.

Kris


pgp0.pgp
Description: PGP signature


Re: ports and /var/db/pkg

2003-04-03 Thread Danny Braniss

 Correct.
 

ok, so i wrote a small script (tcl, since i don't know perl), that
does some checking, it reports for each package, the number of files
how many are realy there, and if so, checks the MD5.

now, if im not to far off, if some/all files are missing, or if the
md5 does not match, i should be able to remove the package info, ...
Q:
true
or
false?

danny



___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: ports and /var/db/pkg

2003-04-03 Thread Peter Pentchev
On Thu, Apr 03, 2003 at 02:06:39PM +0300, Danny Braniss wrote:
 
  Correct.
  
 
 ok, so i wrote a small script (tcl, since i don't know perl), that
 does some checking, it reports for each package, the number of files
 how many are realy there, and if so, checks the MD5.

Errr.. you mean, it does something like 'pkg_info -g'? :)

 now, if im not to far off, if some/all files are missing, or if the
 md5 does not match, i should be able to remove the package info, ...
 Q:
   true
 or
   false?

What do you mean, 'remove the package info'?  What exactly are you
trying to achieve?

G'luck,
Peter

-- 
Peter Pentchev  [EMAIL PROTECTED][EMAIL PROTECTED][EMAIL PROTECTED]
PGP key:http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
Thit sentence is not self-referential because thit is not a word.


pgp0.pgp
Description: PGP signature


Re: ports and /var/db/pkg

2003-04-03 Thread Kris Kennaway
On Thu, Apr 03, 2003 at 02:06:39PM +0300, Danny Braniss wrote:
 
  Correct.
  
 
 ok, so i wrote a small script (tcl, since i don't know perl), that
 does some checking, it reports for each package, the number of files
 how many are realy there, and if so, checks the MD5.
 
 now, if im not to far off, if some/all files are missing, or if the
 md5 does not match, i should be able to remove the package info, ...

Well, that's not what you were asking for originally, and tools
already exist to check that.

e.g. pkg_info -g and the example from the pkg_which(1) manpage that I
mentioned to you in a previous email.

Kris


pgp0.pgp
Description: PGP signature


Re: ports and /var/db/pkg

2003-04-02 Thread Kris Kennaway
On Wed, Apr 02, 2003 at 06:18:24PM +0300, Danny Braniss wrote:
 hi all,
   is there some 'easy' way to resync /var/db/pkg from /usr/local
 (after some rm's on it?), i guess i could write a script to would try and
 match the info in /var/db/pkg, and if it's not where it's supposed to be
 would remove the info, but if there is a command ...

Not really..you can go the other way though; see the example in
pkg_which(1).

Kris


pgp0.pgp
Description: PGP signature


Re: ports and /var/db/pkg

2003-04-02 Thread Brian O'Shea
Danny,

If you built your packages from ports, you could always reinstall them.
You just have to check for /usr/ports/group/port/work/.install_done.*

It's not perfect, but you could use it to generate a quick list of ports
to selectively re-install.

Good luck,
-brian

--- Kris Kennaway [EMAIL PROTECTED] wrote:
 On Wed, Apr 02, 2003 at 06:18:24PM +0300, Danny Braniss wrote:
  hi all,
  is there some 'easy' way to resync /var/db/pkg from /usr/local
  (after some rm's on it?), i guess i could write a script to would try and
  match the info in /var/db/pkg, and if it's not where it's supposed to be
  would remove the info, but if there is a command ...
 
 Not really..you can go the other way though; see the example in
 pkg_which(1).
 
 Kris
 

 ATTACHMENT part 2 application/pgp-signature 



__
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: ports and /var/db/pkg

2003-04-02 Thread Kris Kennaway
On Wed, Apr 02, 2003 at 02:58:43PM -0800, Brian O'Shea wrote:
 Danny,
 
 If you built your packages from ports, you could always reinstall them.
 You just have to check for /usr/ports/group/port/work/.install_done.*

Only if you've never run 'make clean' (unlikely, if he's following
directions).

Kris


pgp0.pgp
Description: PGP signature