summaryrefslogtreecommitdiffstats
path: root/usr.sbin/portsnap
diff options
context:
space:
mode:
authorcperciva <cperciva@FreeBSD.org>2008-05-17 16:26:27 +0000
committercperciva <cperciva@FreeBSD.org>2008-05-17 16:26:27 +0000
commit55aafae3bb6d6ee7a99322fa2cc2488709b72731 (patch)
treed38adb51ebd1ad3da67e3338b78a019713ea4442 /usr.sbin/portsnap
parentc890e8f252f916ae5f70c91e56e558be15390f18 (diff)
downloadFreeBSD-src-55aafae3bb6d6ee7a99322fa2cc2488709b72731.zip
FreeBSD-src-55aafae3bb6d6ee7a99322fa2cc2488709b72731.tar.gz
Add support for specifying which INDEX files to build via portsnap.conf.
Requested by: brooks Reminded by: brooks, about halfway through his BSDCan talk
Diffstat (limited to 'usr.sbin/portsnap')
-rw-r--r--usr.sbin/portsnap/portsnap/portsnap.sh20
1 files changed, 16 insertions, 4 deletions
diff --git a/usr.sbin/portsnap/portsnap/portsnap.sh b/usr.sbin/portsnap/portsnap/portsnap.sh
index 7d7a2d1..0660b41 100644
--- a/usr.sbin/portsnap/portsnap/portsnap.sh
+++ b/usr.sbin/portsnap/portsnap/portsnap.sh
@@ -199,6 +199,12 @@ parse_conffile() {
cut -c 7- | xargs echo | tr ' ' '|'
`)"
fi
+
+ if grep -qE "^INDEX[[:space:]]" ${CONFFILE}; then
+ INDEXPAIRS="`
+ grep -E "^INDEX[[:space:]]" "${CONFFILE}" |
+ cut -c 7- | tr ' ' '|' | xargs echo`"
+ fi
fi
}
@@ -829,19 +835,25 @@ fetch_run() {
# Build a ports INDEX file
extract_make_index() {
+ if ! look $1 ${WORKDIR}/tINDEX > /dev/null; then
+ echo -n "$1 not provided by portsnap server; "
+ echo "$2 not being generated."
+ else
gunzip -c "${WORKDIR}/files/`look $1 ${WORKDIR}/tINDEX |
cut -f 2 -d '|'`.gz" |
cat - ${LOCALDESC} |
${MKINDEX} /dev/stdin > ${PORTSDIR}/$2
+ fi
}
# Create INDEX, INDEX-5, INDEX-6
extract_indices() {
echo -n "Building new INDEX files... "
- extract_make_index DESCRIBE.4 INDEX || return 1
- extract_make_index DESCRIBE.5 INDEX-5 || return 1
- extract_make_index DESCRIBE.6 INDEX-6 || return 1
- extract_make_index DESCRIBE.7 INDEX-7 || return 1
+ for PAIR in ${INDEXPAIRS}; do
+ INDEXFILE=`echo ${PAIR} | cut -f 1 -d '|'`
+ DESCRIBEFILE=`echo ${PAIR} | cut -f 2 -d '|'`
+ extract_make_index ${DESCRIBEFILE} ${INDEXFILE} || return 1
+ done
echo "done."
}
OpenPOWER on IntegriCloud