mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 09:49:18 -04:00
- Add pkgng support
PR: ports/170118 Submitted by: bsdstats@nanoman.ca (maintainer)
This commit is contained in:
parent
66268a76b3
commit
1eaf9d912b
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=301654
2 changed files with 57 additions and 8 deletions
|
@ -100,13 +100,63 @@ send_devices () {
|
||||||
send_ports () {
|
send_ports () {
|
||||||
case $(uname) in
|
case $(uname) in
|
||||||
FreeBSD )
|
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'`
|
# At the time of this writing (2012-07-24), FreeBSD is switching from
|
||||||
line=$(uri_escape $line)
|
# pkg_* tools to pkgng. Starting in FreeBSD 9.1, pkgng will become the
|
||||||
category=$(uri_escape $category)
|
# default tool for package management.
|
||||||
query_string=$query_string`echo \&port[]=${category}:${line}`
|
#
|
||||||
done
|
# 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
|
report_ports
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -85,4 +85,3 @@ if [ "$2" = "POST-INSTALL" ]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue