summaryrefslogtreecommitdiffstats
path: root/cvs-helpers
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2012-01-14 02:30:14 -0600
committerJoel Sherrill <joel.sherrill@oarcorp.com>2012-01-14 02:30:14 -0600
commit3f621085163cf2f3bb5bf6d0602b5f3fc6f7f4fd (patch)
treecf1ff615cf0999325ac87469a40227211fc81a49 /cvs-helpers
parentUpdate to add initial support for git. (diff)
downloadrtems-testing-3f621085163cf2f3bb5bf6d0602b5f3fc6f7f4fd.tar.bz2
Distribute cvs-helpers to other directories.
Diffstat (limited to 'cvs-helpers')
-rw-r--r--cvs-helpers/ChangeLog65
-rw-r--r--cvs-helpers/Makefile20
-rw-r--r--cvs-helpers/README23
-rwxr-xr-xcvs-helpers/commit171
-rwxr-xr-xcvs-helpers/commit-with-changelog-diff14
-rwxr-xr-xcvs-helpers/mkChangeLogList168
-rwxr-xr-xcvs-helpers/mktest133
-rwxr-xr-xcvs-helpers/prepend21
8 files changed, 0 insertions, 615 deletions
diff --git a/cvs-helpers/ChangeLog b/cvs-helpers/ChangeLog
deleted file mode 100644
index 46422e6..0000000
--- a/cvs-helpers/ChangeLog
+++ /dev/null
@@ -1,65 +0,0 @@
-2011-07-20 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * mktest: Add option to put test number in.
-
-2011-01-28 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * cvscommit: Now running Go tests on PowerPC (2/3 passing) and i386 (in
- process).
-
-2011-01-04 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * cvscommit, mkChangeLogList: Avoid processing autom4te.cache
- directories and directories not added to CVS yet.
-
-2010-08-02 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * mktest: Add .doc files with -kkv option so keyword expansion is on.
- Otherwise cvs assumes it is a Word file and treats it as binary.
-
-2010-06-21 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * mktest: Test backwards.
-
-2010-06-21 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * mktest: Remove echo on cvs add and verify it works.
-
-2010-06-21 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * mktest: Add generation of .cvsignore and first attempt at cvs add.
-
-2010-06-21 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * Makefile: Add RTEMS test templates and test instantiator.
- * mktest: New file.
-
-2010-04-09 Joel Sherrill <joel.sherrilL@OARcorp.com>
-
- * mkChangeLogList: elif not else if
-
-2010-03-27 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * mkChangeLogList: Add initial support for svn.
-
-2010-01-29 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * mkChangeLogList: Fixed bug where new files and removed files messages
- could go past the desired column.
-
-2010-01-19 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * cvscommit, mkChangeLogList: Add Coverity Id support.
-
-2009-10-21 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * cvscommit: Fix handling of files/directories with spaces in the name.
-
-2009-09-14 Joel Sherrill <joel.sherrill@OARcorp.com>
-
- * Makefile: Add more files.
-
-2009-08-26 Joel Sherrill <joel.sherrill@oarcorp.com>
-
- * ChangeLog, README, commit-with-changelog-diff: New files.
-
diff --git a/cvs-helpers/Makefile b/cvs-helpers/Makefile
deleted file mode 100644
index 6afcd0a..0000000
--- a/cvs-helpers/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# $Id: Makefile,v 1.3 2010/06/21 12:37:03 joel Exp $
-#
-
-INSTALL_DIR=../bin
-SCRIPTS=commit-with-changelog-diff commit mkChangeLogList prepend mktest
-
-all: prep ${SCRIPTS} install
-
-prep:
- test -d ${INSTALL_DIR} || mkdir ${INSTALL_DIR}
-
-clean:
-
-install:
- for i in ${SCRIPTS} ; do \
- cp $${i} ${INSTALL_DIR}/$${i} ; \
- chmod +x ${INSTALL_DIR}/$${i} ; \
- done
-
diff --git a/cvs-helpers/README b/cvs-helpers/README
deleted file mode 100644
index f999ce9..0000000
--- a/cvs-helpers/README
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# $Id$
-#
-
-This directory contains helpers for dealing with the RTEMS CVS Repository
-during maintenance activities.
-
-commit-with-changelog-diff
- This utility is used when a patch is submitted with a diff that includes
- the ChangeLog entry prepended to the ChangeLog. This diffs the ChangeLog
- and extracts the added Log entry. Then it commits all files from the
- current directory using that ChangeLog entry.
-cvscommit
- This utility takes a message on the command line and uses mkChangeLogList
- to properly format it. It then allows you the option to edit it and
- commit files from the current directory using that Log entry.
-mkChangeLogList
- This utility formats a ChangeLog entry using a message from the
- command line. It uses the user information from /etc/passwd by
- default but can be told to use another user's information or
- an explicit name and email address.
-prepend
- This is used to prepend a file to the ChangeLog.
diff --git a/cvs-helpers/commit b/cvs-helpers/commit
deleted file mode 100755
index 8d32ebc..0000000
--- a/cvs-helpers/commit
+++ /dev/null
@@ -1,171 +0,0 @@
-#! /bin/sh
-#
-# Recurse from current directory assisting in generating ChangeLog entries
-# and committing files to the Source Code Repository.
-#
-# TODO:
-# + Currently supports CVS and git. Could add svn
-#
-
-progname=${0##*/}
-usage()
-{
- echo "$progname [-dlq] [-e editor] [-u user] [-m message] [-M msgfile]"
- echo "options:"
- echo " -d .. debug, don't delete change files";
- echo " -q .. quiet, don't display directories";
- echo " -l .. local directory only";
- echo " -m message .. text to use for modified files";
- echo " -M msgfile .. file containing to use for modified files";
- echo " -u user .. use user instead of LOGNAME";
- echo " -U user .. use explicit user info -- not from passwd";
- echo " -p PR .. PR info";
- echo " -c CID .. Coverity Id number";
- echo
- exit 1
-}
-
-# Determine VCS in use
-if [ -d .git ] ; then
- VCS=git
-elif [ -d CVS ] ; then
- VCS=cvs
-else
- echo "This does not look like a checkout from a VCS I understand."
- exit 1
-fi
-
-editor="vim"
-changefile="changes-xxx"
-rem_changes="yes"
-quiet="no"
-user=$LOGNAME
-mkchoptions="-n"
-message=
-localdir="no"
-while getopts dlqe:M:m:u:U:p:c: OPT
-do
- case "$OPT" in
- d) rem_changes="yes" ;;
- e) editor=$OPTARG ;;
- l) localdir="yes" ;;
- m) message=$OPTARG ;;
- M) message=`cat $OPTARG` ;;
- q) quiet="yes" ;;
- u) user=$OPTARG ; mkchoptions=${mkchoptions}" -u ${user}" ;;
- U) userArg="-U" userInfo=$OPTARG ;;
- p) PrInfo=$OPTARG ; mkchoptions=${mkchoptions}" -p ${PrInfo}" ;;
- c) CoverityInfo=$OPTARG ; mkchoptions=${mkchoptions}" -c ${CoverityInfo}" ;;
- *) usage ;;
- esac
-done
-
-export message
-let $((shiftcount = $OPTIND - 1))
-shift #shiftcount
-
-args=$*
-
-# find ChangeLogs and print them by depth
-get_subdirs()
-{
- find . -name ChangeLog | while read f
- do
- case $1 in
- */*/*/*/*/*/*/*/*/*) d=9 ;;
- */*/*/*/*/*/*/*/*) d=8 ;;
- */*/*/*/*/*/*/*) d=7 ;;
- */*/*/*/*/*/*) d=6 ;;
- */*/*/*/*/*) d=5 ;;
- */*/*/*/*) d=4 ;;
- */*/*/*) d=3 ;;
- */*/*) d=2 ;;
- */*) d=1 ;;
- *) d=0 ;;
- esac
- echo ${d} ${f}
- done | sort -n -r | cut -d' ' -f2- | while read f
- do
- dirname $f
- done
-}
-if [ ${localdir} = "yes" ] ; then
- subdirs="."
-else
- subdirs=`get_subdirs`
-fi
-
-# Make sure we have user information
-if test "X${userInfo}" = "X" ; then
- user_name=`grep ^${user} /etc/passwd | cut -d':' -f5 | cut -d',' -f1`
- if test "X${user_name}" = "X" ; then
- echo "User information not set"
- usage
- fi
-fi
-
-commit()
-{
- if [ $? -ne 0 ] ; then
- return
- fi
-
- prepend ${changefile}
-
- # Specify VCS support directory
- case ${VCS} in
- cvs)
- ${CVS} up ChangeLog
- cvs commit -F ${changefile}
- ;;
- git)
- echo "git commit -F ${changefile}"
- git commit -a -F ${changefile}
- ;;
- *) echo "${VCS} to be implemented" ; exit 1 ;;
- esac
-}
-
-# Specify VCS support directory
-case ${VCS} in
- cvs) VCSDIR=CVS ;;
- git) VCSDIR=.git ;;
- *)
- echo "${VCS} to be implemented"
- exit 1
- ;;
-esac
-
-for ddir in ${subdirs} ; do
- test "${ddir}" = "${VCSDIR}" && continue
- test "${ddir}" = "autom4te.cache" && continue
- test "${ddir}" = "install" && continue
- if [ -d "${ddir}" ]; then
- if [ ! -d "${ddir}/${VCSDIR}" ] ; then
- echo "WARNING - ${ddir} is not in .git"
- continue
- fi
- test -f "${ddir}/ChangeLog" || continue
- cd "$ddir" >/dev/null
- mkChangeLogList ${mkchoptions} ${userArg} "${userInfo}" \
- -m "${message}" >${changefile}
- test $? -ne 0 && continue
- while test -s ${changefile} ; do
- fullpath=`pwd`
- test "$quiet" = "no" && echo "** directory: $fullpath **"
- cat ${changefile}
- response="n"
- read -p "Commit changes? [y/n/e(edit)]: " response
- case ${response} in
- y) commit; break ;;
- n) break ;;
- e) ${editor} ${changefile} ;;
- *) echo "*** enter y,n, or e ***" ;;
- esac
- done
- test $rem_changes = "yes" && rm -rf $changefile
- cd - >/dev/null
- fi
-done
-
-
diff --git a/cvs-helpers/commit-with-changelog-diff b/cvs-helpers/commit-with-changelog-diff
deleted file mode 100755
index f1bf5e5..0000000
--- a/cvs-helpers/commit-with-changelog-diff
+++ /dev/null
@@ -1,14 +0,0 @@
-#! /bin/sh
-
-if [ ! -r ChangeLog ] ; then
- echo "ERROR: No ChangeLog in current directory."
- exit 1
-fi
-
-cvs diff -u ChangeLog| grep ^+ | \
- sed -e '/^+++/d' -e 's/^+ //' -e 's/^+//' >ch
-cat ch
-
-cvs commit -F ch
-rm -f ch
-exit 0
diff --git a/cvs-helpers/mkChangeLogList b/cvs-helpers/mkChangeLogList
deleted file mode 100755
index 5d9fe9c..0000000
--- a/cvs-helpers/mkChangeLogList
+++ /dev/null
@@ -1,168 +0,0 @@
-#! /bin/sh
-#
-# Use git from the current directory and put the file names
-# in suitable format for use in a ChangeLog.
-#
-# TODO: Initial conversion from cvs
-#
-# $Id: mkChangeLogList,v 1.6 2011/01/04 19:53:53 joel Exp $
-#
-
-mklog_()
-{
- cat >XXX
- if test `cat XXX | wc -l` -ne 0 ; then
- (cat XXX | cut -d':' -f2 | \
- sed -e '$!s/$/,/' -e '$s/$/:/' ; \
- test $? -ne 0 || echo "$*" )| \
- xargs -s80 | sed -e '1s/^/ \* /' -e '2,$s/^/ /'
- fi
- rm -f XXX
-}
-
-progname=${0##*/}
-usage()
-{
- echo "$progname [-ln] [-u user] [-U user_information] [-m message] [-M msgfile]"
- exit 1
-}
-
-print_name="no"
-user=$LOGNAME
-git_local_arg=""
-basedir=.
-while getopts d:lnM:m:p:c:u:U: OPT
-do
- case "$OPT" in
- d) basedir=$OPTARG ;;
- l) git_local_arg="-l" ;;
- n) print_name="yes" ;;
- p) prnum=$OPTARG ;;
- c) coverity_num=$OPTARG ;;
- m) message=$OPTARG ;;
- M) message=`cat $OPTARG` ;;
- u) user=$OPTARG ; print_name="yes" ;;
- U) user_name=$OPTARG ; print_name="yes" ;;
- *) usage ;;
- esac
-done
-
-let $((shiftcount = $OPTIND - 1))
-shift #shiftcount
-
-args=$*
-
-dirarg="${basedir}"
-
-# Determine VCS in use
-if [ -d .git ] ; then
- VCS=git
-elif [ -d CVS ] ; then
- VCS=cvs
-else
- echo "This does not look like a checkout from a VCS I understand."
- exit 1
-fi
-
-if [ ! -r ChangeLog ] ; then
- ( echo "There is no ChangeLog in this directory." ;
- echo "Where are you putting the entry?" )>/dev/stderr
- exit 1
-fi
-
-case ${VCS} in
- cvs)
- # done parsing arguments, now work
- if [ "X${CVSROOT}" = "X" ] ; then
- CVS=cvs
- else
- CVS="cvs -d ${CVSROOT}"
- fi
- CVS="${CVS}"
-
- files_modded=`${CVS} diff ${dirarg} 2>&1 | grep ^Index | wc -l`
- files_added=`${CVS} diff ${dirarg} 2>&1 | grep "is a new entry, no " | wc -l`
- files_deleted=`${CVS} diff ${dirarg} 2>&1 | grep " was removed, no " | wc -l`
- ;;
- git)
- files_modded=`git status ${dirarg} 2>&1 | grep "modified: " | wc -l`
- files_added=`git status ${dirarg} 2>&1 | grep "new file: " | wc -l`
- files_deleted=0
- #files_deleted=`${CVS} diff ${dirarg} 2>&1 | grep " was removed, no " | wc -l`
- ;;
- *)
- echo "${VCS} to be implemented"
- exit 1
- ;;
-esac
-
-files_changed=`expr ${files_modded} + ${files_added} + ${files_deleted}`
-if test ${files_changed} -eq 0 ; then
- exit 0
-fi
-
-if test ${print_name} = "yes" ; then
- if test "X${user_name}" = "X" ; then
- if test "X${user}" = "X" ; then
- echo "User not specified (LOGNAME not set or no -u option)"
- usage
- fi
-
- user_name=`grep ^${user} /etc/passwd | cut -d':' -f5 | cut -d',' -f1`
- if test "X${user_name}" = "X" ; then
- echo "User information not set"
- usage
- fi
- fi
-
- date=`date +%Y-%m-%d`
- echo "${date} ${user_name}"
- echo
-fi
-
-if test "X${prnum}" != "X" ; then
- echo " PR ${prnum}"
-fi
-if test "X${coverity_num}" != "X" ; then
- echo " Coverity Id ${coverity_num}"
-fi
-
-case ${VCS} in
- cvs)
- # Generate list of modified files
- ${CVS} diff ${dirarg} 2>/dev/null | grep ^Index | mklog_ ${message}
-
- # Generate list of deleted files
- test ${files_added} -gt 1 && plural=s
- ${CVS} diff ${dirarg} 2>&1 | grep "is a new entry, no comparison" | \
- sed -e 's/^.*: //' -e 's/ is a .*$//' | mklog_ "New file${plural}."
-
- # Generate list of removed files
- ${CVS} diff ${dirarg} 2>&1 | grep "was removed, no comparison" | \
- sed -e 's/^.*: //' -e 's/ was removed, no comparison.*$//' | \
- mklog_ Removed.
- ;;
- git)
- # Generate list of modified files
- git status 2>&1 | grep "modified: " | mklog_ ${message}
-
- # Generate list of deleted files
- test ${files_added} -gt 1 && plural=s
- git status 2>&1 | grep "new file: " | \
- sed -e 's/^.*: //' -e 's/ is a .*$//' | mklog_ "New file${plural}."
-
- # Generate list of removed files
- #${CVS} diff ${dirarg} 2>&1 | grep "was removed, no comparison" | \
- # sed -e 's/^.*: //' -e 's/ was removed, no comparison.*$//' | \
- # mklog_ Removed.
- ;;
- *)
- echo "${VCS} to be implemented"
- exit 1
- ;;
-esac
-
-echo
-
-# rm -f XXX
-exit 0
diff --git a/cvs-helpers/mktest b/cvs-helpers/mktest
deleted file mode 100755
index e837fd0..0000000
--- a/cvs-helpers/mktest
+++ /dev/null
@@ -1,133 +0,0 @@
-#! /bin/sh
-#
-# Process a test template directory into the baseline for a new test
-#
-# $Id$
-#
-
-toggle()
-{
- case $1 in
- no) echo "yes" ;;
- yes) echo "no" ;;
- *) fatal "Unknown value to toggle ($1)" ;;
- esac
-}
-
-check_status()
-{
- if [ $1 -ne 0 ] ; then
- shift
- echo "FAILED: " "$*" >&2
- exit 1
- fi
-}
-
-usage()
-{
- echo "$progname -s SOURCE -d DEST -D description -n NUMBER [-v]"
- echo " OR"
- echo "$progname -c -d DEST"
-cat <<EOF
-
-The first form is to generate a new test.
-The second form is to add the new test to CVS.
-EOF
- exit 1
-}
-
-addToCVS=no
-source=
-dest=
-desc=
-testNum=
-verbose=no
-while getopts cd:D:s:n:v OPT
-do
- case "$OPT" in
- c) addToCVS=`toggle ${addToCVS}` ;;
- d) dest=$OPTARG ;;
- D) desc=$OPTARG ;;
- s) source=$OPTARG ;;
- n) testNum=$OPTARG ;;
- v) verbose=`toggle ${verbose}` ;;
- *) usage ;;
- esac
-done
-
-# Error check
-test "X${dest}" != "X"
-check_status $? No destination provided
-test -r configure.ac
-check_status $? Not in test suite directory
-
-
-if [ ${addToCVS} == yes ] ; then
- test -d ${dest}
- check_status $? "Cannot add ${dest} -- does not exist"
-
- cvs add ${dest}
- cd ${dest}
- for f in `ls -1 .cvsignore Makefile.am *.doc *.scn *.[ch] 2>/dev/null`
- do
- cvs add -kkv ${f}
- done
- exit 0
-fi
-
-test "X${source}" != "X"
-check_status $? No source provided
-test -d "${source}"
-check_status $? Source directory not present
-test "X${testNum}" != "X"
-check_status $? No test number provided
-
-test ! -d ${dest}/CVS
-check_status $? "Are you sure about ${dest}? Already a CVS directory in it"
-
-let $((shiftcount = $OPTIND - 1))
-shift #shiftcount
-
-args=$*
-
-destCaps=`echo ${dest} | tr [:lower:] [:upper:]`
-echo ${destCaps}
-
-# Process the test
-rm -rf ${dest}
-check_status $? "Unable to remove ${dest}"
-
-mkdir ${dest}
-check_status $? "Unable to make ${dest}"
-
-# all the source code we know about
-for s in ${source}/*
-do
- if [ -r ${s} -a ! -d ${s} ] ; then
- b=`basename ${s}`
- d=`echo ${dest}/${b} | sed "s/TEST\./${dest}\./"`
- echo Processing ${s} to ${d}
- sed -e "s/@LOWER@/${dest}/g" \
- -e "s/@UPPER@/${destCaps}/g" \
- -e "s/@DESC@/${desc}/g" \
- -e "s/@TESTNUM@/${testNum}/g" \
- <${s} >${d}
- check_status $? "Unable to process ${d}"
- fi
-done
-
-cat <<EOF >${dest}/.cvsignore
-Makefile
-Makefile.in
-EOF
-
-cat <<EOF
-You need to add the test to the Makefile.am and configure.ac by hand
-before you can build.
-
-You will have to add content to the test itself including screen
-and doc files.
-
-EOF
-
-exit 0
diff --git a/cvs-helpers/prepend b/cvs-helpers/prepend
deleted file mode 100755
index 454a5fa..0000000
--- a/cvs-helpers/prepend
+++ /dev/null
@@ -1,21 +0,0 @@
-#! /bin/sh
-
-if [ ! -r ChangeLog ] ; then
- echo ChangeLog does not exist
- exit 1
-fi
-
-if [ $# -ne 1 ] ; then
- echo no file to prepend to ChangeLog specified
- exit 1
-fi
-
-if [ ! -r $1 ] ; then
- echo $1 does not exist so can not be prepended to ChangeLog
- exit 1
-fi
-
-mv ChangeLog XXX
-cat $1 XXX > ChangeLog
-rm -f XXX
-exit 0