summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorMichael Scheidell <scheidell@FreeBSD.org>2012-07-28 12:27:28 +0000
committerMichael Scheidell <scheidell@FreeBSD.org>2012-07-28 12:27:28 +0000
commit1eaf9d912bd0886b9deb149d432302debe2ac26b (patch)
tree7000cdba7bbb14512180456b78de8eea3144767b /sysutils
parent- Fix CONFLICTS and readd PKGNAMESUFFIX so we don't get in trouble with dns/p... (diff)
- Add pkgng support
PR: ports/170118 Submitted by: bsdstats@nanoman.ca (maintainer)
Notes
Notes: svn path=/head/; revision=301654
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/bsdstats/files/300.statistics.in64
-rw-r--r--sysutils/bsdstats/pkg-install1
2 files changed, 57 insertions, 8 deletions
diff --git a/sysutils/bsdstats/files/300.statistics.in b/sysutils/bsdstats/files/300.statistics.in
index 8d4304b6b97c..9881747f8fad 100644
--- a/sysutils/bsdstats/files/300.statistics.in
+++ b/sysutils/bsdstats/files/300.statistics.in
@@ -100,13 +100,63 @@ send_devices () {
send_ports () {
case $(uname) in
FreeBSD )
- for line in `/usr/sbin/pkg_info | /usr/bin/awk '{print $1}' `
- do
- category=`grep "@comment ORIGIN" /var/db/pkg/${line}/+CONTENTS | sed -E 's/^\@comment ORIGIN:(.+)\/.+/\1/g'`
- line=$(uri_escape $line)
- category=$(uri_escape $category)
- query_string=$query_string`echo \&port[]=${category}:${line}`
- done
+
+ ############################################################################
+ # At the time of this writing (2012-07-24), FreeBSD is switching from
+ # pkg_* tools to pkgng. Starting in FreeBSD 9.1, pkgng will become the
+ # default tool for package management.
+ #
+ # Until pkg_* tools are officially declared unsupported, they will need
+ # legacy support in ports like this one. When the need for this support is
+ # officially discontinued, please do the following:
+ #
+ # 1. Delete the contents of this "LEGACY" section:
+ #
+ #-----BEGIN LEGACY-----
+ # Detect pkgng
+ if [ -e /var/db/pkg/local.sqlite ]; then
+
+ # Use pkgng
+
+ for line in `pkg info | awk '{ print $1 }'`
+ do
+ category=`pkg info -q -o ${line} | sed 's/\/.*//g'`
+ line=$(uri_escape $line)
+ category=$(uri_escape $category)
+ query_string=$query_string`echo \&port[]=${category}:${line}`
+ done
+
+ else
+
+ # Use pkg_* tools
+
+ for line in `pkg_info | awk '{ print $1 }'`
+ do
+ category=`grep "@comment ORIGIN" /var/db/pkg/${line}/+CONTENTS | sed -E 's/^\@comment ORIGIN:(.+)\/.+/\1/g'`
+ line=$(uri_escape $line)
+ category=$(uri_escape $category)
+ query_string=$query_string`echo \&port[]=${category}:${line}`
+ done
+
+ fi
+ #-----END LEGACY-----
+ #
+ # 2. Uncomment the contents of this "PKGNG" section:
+ #
+ #-----BEGIN PKGNG-----
+# for line in `pkg info | awk '{ print $1 }'`
+# do
+# category=`pkg info -q -o ${line} | sed 's/\/.*//g'`
+# line=$(uri_escape $line)
+# category=$(uri_escape $category)
+# query_string=$query_string`echo \&port[]=${category}:${line}`
+# done
+ #-----END PKGNG-----
+ #
+ # 3. Delete these comments.
+ #
+ # Thank you!
+ ############################################################################
report_ports
;;
diff --git a/sysutils/bsdstats/pkg-install b/sysutils/bsdstats/pkg-install
index 31792cfbdf38..dd228acf9ddf 100644
--- a/sysutils/bsdstats/pkg-install
+++ b/sysutils/bsdstats/pkg-install
@@ -85,4 +85,3 @@ if [ "$2" = "POST-INSTALL" ]; then
fi
fi
fi
-