Concerning pkgng

Matthew Seaman matthew at FreeBSD.org
Tue Feb 11 07:41:19 UTC 2014


On 11/02/2014 04:15, Montgomery-Smith, Stephen wrote:
> So I have started using pkgng.  It is extremely easy to convert, it runs
> very fast, and I really like it.

Very glad to hear you like it.

> However, it would be nice if the old pkg_install, pkg_info, etc programs
> were somehow disabled on FreeBSD-8.  Maybe they could look inside
> /etc/make.conf and see if /var/db/pkg/local.sqlite exists, and then
> decide not to operate.
> 
> The reason for this is because I can easily see me accidentally doing
> pkg_delete instead of pkg delete.  And especially since pkg convert
> seems to leave all the old directories in /var/db/pkg, I can see this
> creating quite a mess.
> 
> I know I can simply delete the pkg_delete, pkg_info binaries.  But I'll
> have to remember to do that each time I remake world.

If you're building your own systems, then there should be /etc/src.conf
options to disable the old pkg tools.  According to src.conf(5):

     WITHOUT_PKGTOOLS
             Set to not build pkg_add(8) and related programs.

This should add pkg_add et al to the obsolete files list, so 'make
delete-old' will remove them.

Otherwise, you can clear out the old pkg_tools data from /var/db/pkg --
this will make pkg_tools think there are no packages installed which
mostly renders accidentally using those tools harmless.

To do this, delete the subdirectories under /var/db/pkg.  This is what
the contents of /var/db/pkg look like on a fully pkgng-ised setup:

lucid-nonsense:/var/log:# ls -la /var/db/pkg
total 11332
drwxr-xr-x   2 root  wheel         5 Feb 11 07:34 ./
drwxr-xr-x  24 root  wheel        36 Feb 11 07:24 ../
-rw-r--r--   1 root  wheel  17022976 Feb 11 07:12 local.sqlite
-rw-r--r--   1 root  wheel   1412096 Feb 11 07:09
repo-infracaninophile.sqlite
-r--r--r--   1 root  wheel   3077188 Feb  8 05:48 vuln.xml

where you will have different repository names or several different
repo-foo.sqlite files depending on what you have configured.

One note of caution: if you use portmaster, it uses those per-port
subdirectories under /var/db/pkg to stash some information about what
distfiles ports use.  I don't think it is a disaster if that info gets
blown away, but don't get concerned if those subdirectories keep
re-appearing.  The significant difference is if there's a file +CONTENTS
plus various other files starting with + -- if those aren't there, then
it's all good.

	Cheers,

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.
PGP: http://www.infracaninophile.co.uk/pgpkey


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1036 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20140211/608524ca/attachment.sig>


More information about the freebsd-ports mailing list