From owner-svn-src-all@freebsd.org Tue Apr 12 23:20:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2438B0E2A1; Tue, 12 Apr 2016 23:20:51 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B1AAA1C06; Tue, 12 Apr 2016 23:20:51 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3CNKoVN086367; Tue, 12 Apr 2016 23:20:50 GMT (envelope-from phil@FreeBSD.org) Received: (from phil@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3CNKot4086364; Tue, 12 Apr 2016 23:20:50 GMT (envelope-from phil@FreeBSD.org) Message-Id: <201604122320.u3CNKot4086364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phil set sender to phil@FreeBSD.org using -f From: Phil Shafer Date: Tue, 12 Apr 2016 23:20:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r297892 - vendor/Juniper/libxo X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Apr 2016 23:20:52 -0000 Author: phil Date: Tue Apr 12 23:20:50 2016 New Revision: 297892 URL: https://svnweb.freebsd.org/changeset/base/297892 Log: import libxo 0.4.6 Added: vendor/Juniper/libxo/.svnignore Replaced: vendor/Juniper/libxo/import.sh - copied, changed from r296971, vendor/NetBSD/bmake/import.sh Modified: Directory Properties: vendor/Juniper/libxo/ (props changed) Added: vendor/Juniper/libxo/.svnignore ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/Juniper/libxo/.svnignore Tue Apr 12 23:20:50 2016 (r297892) @@ -0,0 +1,2 @@ +libxo-0.4.6 +tag.sh Copied and modified: vendor/Juniper/libxo/import.sh (from r296971, vendor/NetBSD/bmake/import.sh) ============================================================================== --- vendor/NetBSD/bmake/import.sh Thu Mar 17 00:46:36 2016 (r296971, copy source) +++ vendor/Juniper/libxo/import.sh Tue Apr 12 23:20:50 2016 (r297892) @@ -1,11 +1,28 @@ -: +#!/bin/sh # $FreeBSD$ +# +# Import script for libxo. Typically invoked as: +# +# cd work/bsd/base +# sh ./vendor/Juniper/libxo/import.sh -v 0.4.6 +# +# Add "-n" to avoid svn actions +# Add "-d" to generate docs +# +# Phil Shafer (phil@), April 2016 +# + +PROJECT=libxo +MAKEOBJDIRPREFIX=/tank/home/phil/work/bsd/base/head/obj/ +export MAKEOBJDIRPREFIX -# "global" vars -ECHO= +#"global" vars # Set SVN variables # select the local subversion site SVN=${SVN:-/usr/local/bin/svn} +# "Real" SVN, even if "-n" +RSVN=$SVN +GMAKE=${GMAKE:-gmake} # For consistency... Error() { @@ -16,6 +33,46 @@ Error() { Cd() { [ $# -eq 1 ] || Error "Cd() takes a single parameter." cd $1 || Error "cannot \"cd $1\" from $PWD" + info "Directory =" `pwd` +} + +run() { + desc="$1" + cmd="$2" + + if [ "$DOC" = doc ]; then + echo " == $desc" + echo " - $cmd" + echo " " + else + echo "====" + echo "Phase: $desc" + echo " Run: $cmd" + okay + # We need to eval to handle "&&" in commands + eval $cmd + okay + fi +} + +info() { + echo " -- " "$@" +} + +okay() { + if [ -z "$OKAY" ]; then + /bin/echo -n "proceed? " + read okay + case "$okay" in + [QqNn]*) echo "exiting"; exit 1;; + esac + fi +} + +spew_words () { + for i in "$@"; do + echo $i + done } # Call this function and then follow it by any specific import script additions @@ -28,19 +85,25 @@ option_parsing() { *=*) eval "$1"; shift;; --) shift; break;; -a) TARBALL=$2; shift 2;; - -n) ECHO=echo; shift;; + -d) DOC=doc; shift;; + -D) VENDOR_DIR=$2; shift 2;; + -f) FETCH=yes; shift;; + -n) SVN='echo svn'; shift;; + -p) PROJECT=$2; shift 2;; -P) PR=$2; shift 2;; -r) REVIEWER=$2; shift 2;; - -u) url=$2; shift 2;; + -v) VERS=$2; shift 2;; + -y) OKAY=yes; shift;; + -h) echo "Usage:"; echo " "$0 '[-ahnPr] [TARBALL=] [PR=] [REVIEWER=]' - echo " "$0 '-a # (a)rchive' - echo " "$0 '-h # print usage' - echo " "$0 '-n # do not import, check only.' - echo " "$0 '-P # Use PR' - echo " "$0 '-r # (r)eviewed by' - echo " "$0 'PR=' - echo " "$0 'REVIEWER=' + echo " -a -- name or tarball" + echo " -d -- generate documentation" + echo " -f -- force fetch of tarballs" + echo " -h -- print usage" + echo " -n -- do not import, check only" + echo " -v -- version to import" + echo " -y -- answer 'yes'" exit 1;; *) break;; esac @@ -53,34 +116,199 @@ option_parsing() { 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 +CWD=`pwd` + +if [ -z "$VENDOR_DIR" ]; then + VENDOR_DIR=`echo $CWD | sed 's:.*/vendor/::'` +fi + +#-------------------------------------------------------------- + +info "CWD = $CWD" +info "VENDOR_DIR = $VENDOR_DIR" +info "VERS = $VERS" + +[ -z "$VERS" ] && Error "missing version argument (-v)" + +mkdir -p ~/tars + +# We use the source tarball from git since it has no frills +# (and libxo has a lot of frills.....) +URL=https://github.com/Juniper/libxo/archive/$VERS.tar.gz +BASEURL=libxo-`basename $URL` +TARBALL=~/tars/$BASEURL + +info "BASEURL = $BASEURL" + +if [ "$FETCH" = "yes" -o ! -f $TARBALL ]; then + run "fetching tarball ($URL)" "fetch -o $TARBALL $URL" + [ -s $TARBALL ] || Error "fetch failed to get file" +fi + +# We need the release tar ball for the HTML docs, nothing more +DOCURL=https://github.com/Juniper/libxo/releases/download/$VERS/libxo-$VERS.tar.gz +DOCBALL=~/tars/doc-$BASEURL + +if [ "$FETCH" = "yes" -o ! -f $DOCBALL ]; then + run "fetching doc tarball" "fetch -o $DOCBALL $DOCURL" + test -s ${DOCBALL} || Error need DOCBALL +fi + +# BASE should match what the TARBALL contains +BASE=`basename $TARBALL .tar.gz` +VERSION=`echo $BASE | sed 's/libxo-//'` + +TF=$BASE/info + +run "untarring source files TARBALL" "tar zxf $TARBALL" +run "untarring html manual" \ + "tar zxf $DOCBALL libxo-$VERS/doc/libxo-manual.html" + +# List of top-level files we want to ignore +TOPJUNKFILES="\ +libxo-* \ +tag.sh" + +# List of files in the tarball that we want to ignore +DISTJUNKFILES="\ +Makefile.in \ +aclocal.m4 \ +ar-lib \ +autom4te.cache \ +bin* \ +build* \ +compile \ +configure \ +config.guess \ +config.sub \ +depcomp \ +doc/Makefile.in \ +info* \ +install-sh \ +ltmain.sh \ +m4 \ +missing \ +patches*" + +# List of directories that need a "Makefile.in" ignored +IGNOREDIRS="\ +doc \ +encoder \ +encoder/cbor \ +encoder/test \ +libxo \ +tests \ +tests/core \ +tests/gettext \ +tests/xo \ +xo \ +xohtml \ +xolint \ +xopo" + +SEDNUKE="sed -e '/^bin/d' -e '/^build/d' -e '/^info/d' -e '/^patches/d'" + +run "writing .svnignore" \ + "(for i in $TOPJUNKFILES; do echo \$i ; done ) > .svnignore" +run "setting svn:ignore for ." \ + "$SVN propset svn:ignore -F .svnignore ." + +run "writing dist/.svnignore" \ + "(for i in $DISTJUNKFILES; do echo \$i ; done ) > dist/.svnignore" +run "setting svn:ignore for dist" \ + "(cd dist && $SVN propset svn:ignore -F .svnignore .)" +run "setting svn:ignore for Makefile.in dirs" \ + "for dir in $IGNOREDIRS; do (cd dist/\$dir && $SVN propset svn:ignore Makefile.in .) ; done" # 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 +run "making list of files in existing tree" \ + "(cd dist && $RSVN list -R) | grep -v '/$' | sort > $TF.old" + +run "making list of files in incoming tree" \ + "(cd $BASE && find . -type f ) | cut -c 3- | $SEDNUKE | sort > $TF.new" + +run "making list of deleted files" "comm -23 $TF.old $TF.new | tee $TF.rmlist" +run "making list of new files" "comm -13 $TF.old $TF.new | tee $TF.addlist" + +run "copying contents over to dist/" "(cd $BASE && tar cf - . | tar xf - -C ../dist)" +run "removing old files from svn" \ + "(test -s $TF.rmlist && cd dist && xargs $SVN rm < ../$TF.rmlist)" +run "adding new files to svn" \ + "(test -s $TF.addlist && cd dist && xargs $SVN --parents add < ../$TF.addlist )" + +url=`$RSVN info | sed -n '/^URL:/s,URL: ,,p'` +info "URL = $url" + +run "building tag script" "(echo set -x ; echo $SVN cp $url/dist $url/$VERSION ) > tag.sh" + +Cd $CWD/dist +run "autoreconf" "autoreconf --install --force" + +Cd $CWD/dist/build +run "configure for testing" "../configure --prefix $CWD/dist/build/root" +run "build and test" \ + "${GMAKE} clean && ${GMAKE} && ${GMAKE} install && ${GMAKE} test" + +# Freebsd lacks stock gettext, so don't build it +run "configure for real" "../configure --disable-gettext --prefix /usr" +run "build for real" \ + "${GMAKE} clean && ${GMAKE}" + + +# Move over and build the source tree +Cd $CWD/../../../head +HEAD=`pwd` +info "HEAD = $HEAD" + +run "copying xo_config.h" "cp $CWD/dist/build/libxo/xo_config.h $HEAD/lib/libxo/" +run "copying add.man" "cp $CWD/dist/build/libxo/add.man $HEAD/lib/libxo/" + +#BUILDDIRS="lib/libxo usr.bin/xo" +#for dir in $BUILDDIRS ; do + #Cd $HEAD/$dir + #run "making build dir '$dir'" "make LIBXOSRC=$CWD/dist" +#done + +DATESTAMP=`date "+%Y-%m-%d-%H-%M"` +run "building the entire world" "script $MAKEOBJDIRPREFIX/out.$DATESTAMP make -DNO_CLEAN buildworld LIBXOSRC=$CWD/dist" + +# Okay, so now it all builds!! Now we can start committing.... + +Cd $CWD + +run "show svn stat for 'dist'" "$SVN stat" +run "show svn diff for 'dist'" "$SVN diff --no-diff-deleted" + +Cd $HEAD + +run "show svn stat for 'head'" "$SVN stat" +run "show svn diff for 'head'" "$SVN diff --no-diff-deleted" + +# Start committing + +Cd $CWD +run "commit changes to 'dist'" "$SVN -m 'Import $PROJECT $VERSION' commit dist" +run "show svn stat for 'dist'" "$SVN stat dist" +run "show svn diff for 'dist'" "$SVN diff dist --no-diff-deleted" + + +run "tagging repo" "$SVN cp -m 'Tag $PROJECT $VERSION' $url/dist $url/$VERSION" + +Cd $HEAD/contrib/$PROJECT +CONTRIB=`pwd` + +run "copy dist to contrib" "$SVN merge --accept=postpone svn+ssh://repo.freebsd.org/base/vendor/Juniper/libxo/dist ." + +run "show svn stat for 'head'" "$SVN stat" +run "checking merge issues" "$SVN diff --no-diff-deleted --old=svn+ssh://repo.freebsd.org/base/vendor/Juniper/libxo/dist --new=." + +#run "committing to contrib" "$SVN commit -m 'Import $PROJECT $VERSION'" + +Cd $HEAD +run "show svn stat for 'head'" "$SVN stat" +run "show svn diff for 'head'" "$SVN diff --no-diff-deleted" +run "commit changes to 'head'" "$SVN -m 'Merge $PROJECT $VERSION' commit" +run "show svn stat for 'head'" "$SVN stat" +exit 0