Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Feb 2006 15:51:09 +0101
From:      "David J. Weller-Fahy" <dave-lists-freebsd-ports@weller-fahy.com>
To:        freebsd-ports@freebsd.org
Subject:   Re: portmaster [was: New /bin/sh based script to manage ports]
Message-ID:  <20060219145045.GB868@weller-fahy.com>
In-Reply-To: <20060219143913.GA868@weller-fahy.com>
References:  <43BCF31F.8050900@FreeBSD.org> <20060214213514.GB20841@leia.lambermont.dyndns.org> <20060219143913.GA868@weller-fahy.com>

next in thread | previous in thread | raw e-mail | index | archive | help
* David J. Weller-Fahy <dave-lists-freebsd-ports@weller-fahy.com> [2006-02-19 15:40 +0100]:
> Hrm... would something like the attached script be sufficient?  it
> outputs a tree-like view of what will be updated.  It's not very
> complex, and doesn't take into account things like removing ports
> already ouput from any future output, but it works for me.

Which apparently didn't get through, here's an inline version:
#v+
#!/bin/sh
list_ports () {
	depth=$1
	shift
	for port in $@; do
		pkg_cur=`grep -l " ORIGIN:${port#/usr/ports/}$" /var/db/pkg/*/+CONTENTS`
		pkg_cur=${pkg_cur#/var/db/pkg/}
		pkg_cur=${pkg_cur%/+CONTENTS}
		pkg_new=`cd $port && make -V PKGNAME`
		test "`pkg_version -t $pkg_cur $pkg_new`" = "<" \
			&& echo "$depth>$pkg_cur::$pkg_new"
		deps=`cd $port && make all-depends-list`
		test -n "$deps" \
			&& list_ports ":$depth" $deps
	done
	depth=${depth#:}
}

for port in `portmaster -an | grep '^===>>> La' | awk '{print $6}'`; do
	orig=`grep '^@comment ORIGIN:' /var/db/pkg/$port/+CONTENTS`
	list_ports "" /usr/ports/${orig#@comment ORIGIN:}
done
#v-

Regards,
-- 
dave [ please don't CC me ]



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