svn commit: r296977 - vendor/Juniper/libxo
David E. O'Brien
obrien at FreeBSD.org
Thu Mar 17 03:26:48 UTC 2016
Author: obrien
Date: Thu Mar 17 03:26:46 2016
New Revision: 296977
URL: https://svnweb.freebsd.org/changeset/base/296977
Log:
Give Phil and easy to use import script.
Added:
vendor/Juniper/libxo/import.sh
- copied unchanged from r296976, vendor/NetBSD/bmake/import.sh
Copied: vendor/Juniper/libxo/import.sh (from r296976, vendor/NetBSD/bmake/import.sh)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ vendor/Juniper/libxo/import.sh Thu Mar 17 03:26:46 2016 (r296977, copy of r296976, vendor/NetBSD/bmake/import.sh)
@@ -0,0 +1,86 @@
+:
+# $FreeBSD$
+
+# "global" vars
+ECHO=
+# Set SVN variables
+# select the local subversion site
+SVN=${SVN:-/usr/local/bin/svn}
+
+# For consistency...
+Error() {
+ echo ERROR: ${1+"$@"} >&2
+ exit 1
+}
+
+Cd() {
+ [ $# -eq 1 ] || Error "Cd() takes a single parameter."
+ cd $1 || Error "cannot \"cd $1\" from $PWD"
+}
+
+# Call this function and then follow it by any specific import script additions
+option_parsing() {
+ local _shift=$#
+ # Parse command line options
+ while :
+ do
+ case "$1" in
+ *=*) eval "$1"; shift;;
+ --) shift; break;;
+ -a) TARBALL=$2; shift 2;;
+ -n) ECHO=echo; shift;;
+ -P) PR=$2; shift 2;;
+ -r) REVIEWER=$2; shift 2;;
+ -u) url=$2; shift 2;;
+ -h) echo "Usage:";
+ echo " "$0 '[-ahnPr] [TARBALL=] [PR=] [REVIEWER=]'
+ echo " "$0 '-a <filename> # (a)rchive'
+ echo " "$0 '-h # print usage'
+ echo " "$0 '-n # do not import, check only.'
+ echo " "$0 '-P <PR Number> # Use PR'
+ echo " "$0 '-r <reviewer(s) list> # (r)eviewed by'
+ echo " "$0 'PR=<PR Number>'
+ echo " "$0 'REVIEWER=<reviewer(s) list>'
+ exit 1;;
+ *) break;;
+ esac
+ done
+ return $(($_shift - $#))
+}
+
+###
+
+option_parsing "$@"
+shift $?
+
+TF=/tmp/.$USER.$$
+Cd `dirname $0`
+test -s ${TARBALL:-/dev/null} || Error need TARBALL
+here=`pwd`
+# thing should match what the TARBALL contains
+thing=`basename $here`
+
+rm -rf $thing
+tar zxf $TARBALL
+
+# steps unique to bmake
+VERSION=`grep '^MAKE_VERSION' bmake/Makefile | sed 's,.*=[[:space:]]*,,'`
+rm -rf bmake/missing
+
+# the rest should be common
+('cd' dist && $SVN list -R) | grep -v '/$' | sort > $TF.old
+('cd' $thing && find . -type f ) | cut -c 3- | sort > $TF.new
+comm -23 $TF.old $TF.new > $TF.rmlist
+comm -13 $TF.old $TF.new > $TF.addlist
+[ -s $TF.rmlist ] && { echo rm:; cat $TF.rmlist; }
+[ -s $TF.addlist ] && { echo add:; cat $TF.addlist; }
+('cd' $thing && tar cf - . | tar xf - -C ../dist)
+('cd' dist
+test -s $TF.rmlist && xargs $SVN rm < $TF.rmlist
+test -s $TF.addlist && xargs $SVN --parents add < $TF.addlist
+)
+
+url=`$SVN info | sed -n '/^URL:/s,URL: ,,p'`
+echo After committing dist... run tag.sh
+echo "$SVN cp $url/dist $url/$VERSION" > tag.sh
+
More information about the svn-src-all
mailing list