Subject: Re: Restoring packages from backup
To: David Brownlee <abs@netbsd.org>
From: Andrew Brown <atatat@atatdot.net>
List: netbsd-users
Date: 09/25/2002 09:16:36
>> >> Is there a way to get a similar backup/restore scheme happening in NetBSD?
>> >>
>> >try
>> >
>> >pkg_info|cut -f 1 -d  " "
>> >
>> That gives you the list, but not in the proper order of dependencies
>> for rebuilds.
>
>	How about:
>	pkg_info -B \* | awk '/PKGPATH/{print $2}' > .../pkgsrc/pkgchk.conf
>
>	Then copy across to new machine, install pkgtools/pkgchk, and run
>	'pkg_chk -a'.

try this one:

	# cd /var/db/pkg
	# ls -rt */+BUILD_INFO | xargs awk '/PKGPATH/{print$2}' > foo

that'll print a list of pkg sub directories in the order that the
+BUILD_INFO files were installed, which typically indicates dependency
ordering properly.  then, later, you can simply

	# for i in `cat foo`; do
	> cd /usr/pkgsrc/$i
	> make install && make clean
	> done

and you should be covered.

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
werdna@squooshy.com       * "information is power -- share the wealth."