Add a mechanism for constructing INDEX files which include local ports.

Requested by:	brooks
This commit is contained in:
Colin Percival 2006-05-13 15:56:35 +00:00
parent c6a39ce216
commit d600d37002
2 changed files with 22 additions and 2 deletions

View File

@ -37,6 +37,7 @@
.Op Fl d Ar workdir
.Op Fl f Ar conffile
.Op Fl k Ar KEY
.Op Fl l Ar descfile
.Op Fl p Ar portsdir
.Op Fl s Ar server
.Cm command ...
@ -70,6 +71,14 @@ command, update INDEX files, but not the rest of the ports tree.
.It Fl k Ar KEY
Expect a public key with given SHA256 hash.
(default: read value from configuration file.)
.It Fl l Ar descfile
Merge the specified lcoal describes file into the INDEX files being
built.
The
.Ar descfile
should be generated by running
.Cm make describe
in each of the local port directories.
.It Fl p Ar portsdir
When extracting or updating an uncompressed snapshot,
operate on the directory

View File

@ -43,6 +43,7 @@ Options:
(default: /etc/portsnap.conf)
-I -- Update INDEX only. (update command only)
-k KEY -- Trust an RSA key with SHA256 hash of KEY
-l descfile -- Merge the specified local describes file into the INDEX.
-p portsdir -- Location of uncompressed ports tree
(default: /usr/ports/)
-s server -- Server from which to fetch updates.
@ -82,6 +83,7 @@ init_params() {
INDEXONLY=""
SERVERNAME=""
REFUSE=""
LOCALDESC=""
}
# Parse the command line
@ -117,6 +119,11 @@ parse_cmdline() {
if [ ! -z "${KEYPRINT}" ]; then usage; fi
shift; KEYPRINT="$1"
;;
-l)
if [ $# -eq 1 ]; then usage; fi
if [ ! -z "${LOCALDESC}" ]; then usage; fi
shift; LOCALDESC="$1"
;;
--no-stats)
if [ -z "${STATSREDIR}" ]; then
STATSREDIR="/dev/null"
@ -203,7 +210,9 @@ default_params() {
_WORKDIR="/var/db/portsnap"
_PORTSDIR="/usr/ports"
_NDEBUG="-n"
for X in QUIETREDIR QUIETFLAG STATSREDIR WORKDIR PORTSDIR NDEBUG; do
_LOCALDESC="/dev/null"
for X in QUIETREDIR QUIETFLAG STATSREDIR WORKDIR PORTSDIR \
NDEBUG LOCALDESC; do
eval _=\$${X}
eval __=\$_${X}
if [ -z "${_}" ]; then
@ -821,7 +830,9 @@ fetch_run() {
# Build a ports INDEX file
extract_make_index() {
gunzip -c "${WORKDIR}/files/`look $1 ${WORKDIR}/tINDEX |
cut -f 2 -d '|'`.gz" | ${MKINDEX} /dev/stdin > ${PORTSDIR}/$2
cut -f 2 -d '|'`.gz" |
cat - ${LOCALDESC} |
${MKINDEX} /dev/stdin > ${PORTSDIR}/$2
}
# Create INDEX, INDEX-5, INDEX-6