Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Feb 2005 02:29:19 +0100
From:      Danny Pansters <danny@ricin.com>
To:        Alejandro Pulver <alejandro@varnet.biz>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: How to package up (all) installed ports
Message-ID:  <200502180229.20121.danny@ricin.com>
In-Reply-To: <20050217221726.6d6dff54@ale.varnet.bsd>
References:  <200502180009.47816.danny@ricin.com> <20050217221726.6d6dff54@ale.varnet.bsd>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 18 February 2005 02:17, you wrote:
> #!/bin/sh
>
> # Shell script to create packages of all the ports installed in the syste=
m.
> # Usage: 'sh package-ports.sh'
> # Will create the packages in the current directory.
>
> PORTS=3D`pkg_info | awk '{print $1}'`=A0=A0=A0=A0=A0# Filter the descript=
ion.
> NUM_PORTS=3D`echo "$PORTS" | awk 'END {print NR}'`
> BZIP=3D"-j"=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0# Use bzip2 instead of gzip.
> PKGCMD=3D"pkg_create $BZIP -b"=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0# Comma=
nd to create package.
>
> echo "Packaging $NUM_PORTS ports"
>
> # Process one port at time.
>
> for PORT in $PORTS
> do
> =A0=A0=A0=A0=A0=A0=A0=A0echo "Packaging port \"$PORT\""
> =A0=A0=A0=A0=A0=A0=A0=A0$PKGCMD $PORT
> done
>
> echo "Done"
>
> exit 0

I like it. Thank you!

Dan



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200502180229.20121.danny>