Re: How to package up (all) installed ports
From: Alejandro Pulver (alejandro_at_varnet.biz)
Date: 02/18/05
- Previous message: Eric F Crist: "Re: Shell script question"
- In reply to: Danny Pansters: "How to package up (all) installed ports"
- Next in thread: Danny Pansters: "Re: How to package up (all) installed ports"
- Reply: Danny Pansters: "Re: How to package up (all) installed ports"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 17 Feb 2005 22:17:26 -0300 To: danny@ricin.com
On Fri, 18 Feb 2005 00:09:47 +0100
Danny Pansters <danny@ricin.com> wrote:
> What would be a good way to create binary packages of all/most of my currently
> installed ports (without rebuilding as "make package" does)?
>
> I want to move my entire setup to another disk (array) and like to get rid of
> any acumulated junk in the process so best would be to get packages from my
> current system, make world and kernel on the new disk (array) and then
> install the packages or vice versa. Would save a few days of compiling.
>
> Thanks,
>
> Dan
Hello,
The command to create packages of the ports installed in the system is pkg_create(1), it is used with the "-b" option (in this case), like this:
pkg_create -b <installed-port-name>
The name of the installed port is as outputed by pkg_info(1).
The default format is .tar.gz (.tgz), but the "-j" option allows to use bzip2.
I made a (simple) shell script to create packages of all the ports installed in the system.
----------BEGIN----------
#!/bin/sh
# Shell script to create packages of all the ports installed in the system.
# Usage: 'sh package-ports.sh'
# Will create the packages in the current directory.
PORTS=`pkg_info | awk '{print $1}'` # Filter the description.
NUM_PORTS=`echo "$PORTS" | awk 'END {print NR}'`
BZIP="-j" # Use bzip2 instead of gzip.
PKGCMD="pkg_create $BZIP -b" # Command to create package.
echo "Packaging $NUM_PORTS ports"
# Process one port at time.
for PORT in $PORTS
do
echo "Packaging port \"$PORT\""
$PKGCMD $PORT
done
echo "Done"
exit 0
----------END------------
To use it create a directory to store the packages (like 'mkdir packages'),
save the script there and run it with 'sh <script>', or './script' (in the last case the file must be executable).
Best Regards,
Ale
_______________________________________________
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"
- Previous message: Eric F Crist: "Re: Shell script question"
- In reply to: Danny Pansters: "How to package up (all) installed ports"
- Next in thread: Danny Pansters: "Re: How to package up (all) installed ports"
- Reply: Danny Pansters: "Re: How to package up (all) installed ports"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|