Subject: Re: building a package .tgz from a backup dump?
To: Steve Bellovin <smb@research.att.com>
From: David Brownlee <abs@netbsd.org>
List: netbsd-users
Date: 02/19/2004 15:11:26
On Wed, 18 Feb 2004, Steve Bellovin wrote:

> I have some disk backups (in 'dump' format) that contain a version of an
> installed package I'd like to recover.  Is there any easy way to do
> this?

	I'm probably missing an aspect of the question, but assuming you
	have a dump of the entire filesystem containing the pkg db
	directory and usr/pkg (or wherever you have installed):

	restore xvf <dumpfile> var/db/pkg

	awk '\!/[+@]/{print "usr/pkg/"$0}' var/db/pkg/<pkg>/+CONTENTS \|
			xargs restore xvf <dumpfile>

	should extract the pkg db directory, then everything listed in
	+CONTENTS for the given package. (Adjust <dumpfile> and <pkg>
	to taste, and run in smewhere other than '/' :)

-- 
		David/absolute          -- www.netbsd.org: No hype required --