|
From: Christopher D. M. <cas...@us...> - 2012-03-01 17:14:32
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "cap4".
The branch, master has been updated
via 04aaaf666d9c578fd4aefe2b59f46fbd3e3a85ea (commit)
from 7eaddd44c21676bccbb51c7a27b1620a8a4524d6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 04aaaf666d9c578fd4aefe2b59f46fbd3e3a85ea
Author: CDM <cas...@us...>
Date: Thu Mar 1 10:14:19 2012 -0700
CDM: add color printing, more fixes to deploy, add rpmupgrade tag
-----------------------------------------------------------------------
Summary of changes:
deploy | 8 ++--
libexec/sh/cfunc | 87 ++++++++++++++++++++++++++++++++++++---------
src/genders/Makefile | 7 ++--
src/gendersllnl/Makefile | 9 +++++
src/make.workbench | 10 +++++
5 files changed, 96 insertions(+), 25 deletions(-)
create mode 100644 src/gendersllnl/Makefile
diff --git a/deploy b/deploy
index 3e75e68..21c303f 100755
--- a/deploy
+++ b/deploy
@@ -40,8 +40,8 @@ else
fi
usage() {
- echo $0 --tool TOOLNAME --rpm
- echo $0 --tool TOOLNAME --prefix PREFIXDIRECTORY
+ cinfo "$0 --tool TOOLNAME --rpm --clean|--distclean"
+ cinfo "$0 --tool TOOLNAME --prefix PREFIXDIRECTORY --clean|--distclean"
exit 1
}
@@ -50,11 +50,11 @@ parsecli "$@"
check_validvar TOOL $TOOL
if [ $RPM -eq 1 ]; then
- cinfo MAKE "$TOOL => RPM"
+ [ $DEBUG -gt 0 ] && cprint MAKE "$TOOL => RPM"
make_tool $TOOL
else
check_validvar PREFIX $PREFIX
- cinfo MAKE "$TOOL => $PREFIX"
+ [ $DEBUG -gt 0 ] && cprint MAKE "$TOOL => $PREFIX"
make_tool $TOOL $PREFIX
fi
diff --git a/libexec/sh/cfunc b/libexec/sh/cfunc
index 19749f5..39bcc87 100755
--- a/libexec/sh/cfunc
+++ b/libexec/sh/cfunc
@@ -29,13 +29,64 @@
################################################################################
RPM=0
+CLEAN=0
+DISTCLEAN=0
+DEBUG=0
+VERBOSE=0
+
+cprint() {
+ local tag=$1
+ check_validvar tag $tag
+ shift
+
+ # Text color variables
+ txtred='\e[0;31m' # red
+ txtgrn='\e[0;32m' # green
+ txtylw='\e[0;33m' # yellow
+ txtblu='\e[0;34m' # blue
+ txtpur='\e[0;35m' # purple
+ txtcyn='\e[0;36m' # cyan
+ txtwht='\e[0;37m' # white
+ bldred='\e[1;31m' # red - Bold
+ bldgrn='\e[1;32m' # green
+ bldylw='\e[1;33m' # yellow
+ bldblu='\e[1;34m' # blue
+ bldpur='\e[1;35m' # purple
+ bldcyn='\e[1;36m' # cyan
+ bldwht='\e[1;37m' # white
+ txtund=$(tput sgr 0 1) # Underline
+ txtbld=$(tput bold) # Bold
+ txtrst='\e[0m' # Text reset
+
+ # Feedback indicators
+ info=${bldwht}*${txtrst}
+ pass=${bldblu}*${txtrst}
+ warn=${bldred}!${txtrst}
+
+ # Indicator usage
+ case "$tag" in
+ "info") echo -e "${bldblu}$@";;
+ "pass") echo -e "${bldgrn}$@";;
+ "debug") echo -e "${bldcyn}$@";;
+ "warn") echo -e "${bldylw}$@";;
+ "error") echo -e "${bldred}$@";;
+ *) echo -e "${bldpur}$@";;
+ esac
+ tput sgr0
+}
+
+cinfo() { cprint info "$@"; }
+cdebug() { cprint debug "$@"; }
+cpass() { cprint pass "$@"; }
+cwarn() { cprint warn "$@"; }
+cerror() { cprint error "$@"; }
parsecli() {
ARG="$@"
# Note that we use `"$@"' to let each command-line parameter expand to a
# separate word. The quotes around `$@' are essential!
# We need TEMP as the `eval set --' would nuke the return value of getopt.
- TEMP=`getopt -o hc:: -l tool:,prefix:,rpm,help,usage,debug \
+ TEMP=`getopt -o hc:: -l tool:,prefix:,rpm,clean,distclean,help,usage,debug \
-n 'ERROR' -- "$@"`
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
# Note the quotes around `$TEMP': they are essential!
@@ -46,32 +97,28 @@ parsecli() {
--tool) TOOL=$2; shift 2 ;;
--prefix) PREFIX=$2; shift 2 ;;
--rpm) RPM=1; shift ;;
+ --clean) CLEAN=1; shift ;;
+ --distclean) DISTCLEAN=1; shift ;;
--help|--usage) usage ;;
--debug) DEBUG=1; shift ;;
+ --verbose) DEBUG=1; shift ;;
--) shift ; break ;;
- *) echo "Internal error!" ; exit 1 ;;
+ *) cerror "Internal error!" ; exit 1 ;;
esac
done
- if [ $DEBUG ] ; then
- echo "Remaining args:"
+ if [ $DEBUG -gt 1 ] ; then
+ cdebug "Remaining args:"
for arg do echo '--> '"\`$arg\`" ; done
fi
}
check_validvar() {
- [ $# -lt 1 ] && echo "VARIABLE_NAME VARIABLE_VALUE" && usage
- [ "x${2}" = "x" ] && echo "Undefined VARIABLE ${1}" && usage
-}
-
-cinfo() {
- local tag=$1
- check_validvar tag $tag
- shift
- echo "$tag: $@"
+ [ $# -lt 1 ] && cerror "VARIABLE_NAME VARIABLE_VALUE" && usage
+ [ "x${2}" = "x" ] && cerror "Undefined VARIABLE ${1}" && usage
}
make_tool() {
- [ $# -lt 1 ] && echo "make_tool TOOL PREFIXOPTION" && exit 1
+ [ $# -lt 1 ] && cerror "make_tool TOOL PREFIXOPTION" && exit 1
local tool=$1
shift
@@ -81,18 +128,22 @@ make_tool() {
# CAPHOME defined and if defined is there a tool there library
[ "x${CAPHOME}" = "x" ] ||
[ "x${CAPHOME}" != "x" -a ! -d ${CAPHOME}/src/${tool} ] &&
- echo "Missing make directory src for $tool" && exit 1
+ cerror "Missing make directory src for $tool" && exit 1
maketooldir=${CAPHOME}/src/${tool}
fi
if [ $RPM -eq 1 -a "x${PREFIX}" != "x" ]; then
- echo "UNDER DEVELOPMENT: make_tool called with a prefix for rpm"
+ cinfo "UNDER DEVELOPMENT: make_tool called with a prefix for rpm"
exit 1
- elif [ $RPM -eq 1 ]; then
+ fi
+ [ $CLEAN -eq 1 -a $DISTCLEAN -eq 0 ] && make -C $maketooldir clean
+ [ $DISTCLEAN -eq 1 ] && make -C $maketooldir distclean
+ if [ $RPM -eq 1 ]; then
make -C $maketooldir rpm
+ make -C $maketooldir rpmstatus
+ make -C $maketooldir rpminstall
else
- make -C $maketooldir distclean
PREFIX=$PREFIX make -C $maketooldir install
fi
}
diff --git a/src/genders/Makefile b/src/genders/Makefile
index 5e04e23..35fb6bc 100644
--- a/src/genders/Makefile
+++ b/src/genders/Makefile
@@ -1,8 +1,9 @@
include ../make.def
-VERSION=1.11
-SRC=python-hostlist-$(VERSION)
+BASEVERSION=1.18
+VERSION=1.18-1
+SRC=genders-$(BASEVERSION)
TAR=$(SRC).tar.gz
-URL="http://www.nsc.liu.se/~kent/python-hostlist/$(TAR)"
+URL="https://sourceforge.net/projects/genders/files/genders/$(VERSION)/$(TAR)"
include ../make.workbench
diff --git a/src/gendersllnl/Makefile b/src/gendersllnl/Makefile
new file mode 100644
index 0000000..8f888cd
--- /dev/null
+++ b/src/gendersllnl/Makefile
@@ -0,0 +1,9 @@
+include ../make.def
+
+BASEVERSION=1.19
+VERSION=1.19-1
+SRC=gendersllnl-$(BASEVERSION)
+TAR=$(SRC).tar.gz
+URL="https://sourceforge.net/projects/genders/files/gendersllnl/$(VERSION)/$(TAR)"
+
+include ../make.workbench
diff --git a/src/make.workbench b/src/make.workbench
index f0086a5..5591f2e 100644
--- a/src/make.workbench
+++ b/src/make.workbench
@@ -24,6 +24,16 @@ rpmstatus:
@[ -d RPMS ] && find ./RPMS -name *.rpm | xargs ls --color
@sleep 1
+rpminstall: rpm
+ $(call print-header,"cap4 src $@ $(SRC)")
+ @echo "Run the following command as root in: "
+ @[ -d RPMS ] && find $(shell pwd)/RPMS -name *.rpm | xargs echo yum install
+
+rpmupgrade: rpm
+ $(call print-header,"cap4 src $@ $(SRC)")
+ @echo "Run the following command as root in: "
+ @[ -d RPMS ] && find $(shell pwd)/RPMS -name *.rpm | xargs echo yum upgrade
+
clean distclean:
$(call print-header,"cap4 src $@ $(SRC)")
rm -fr $(TAR) $(SRC) .rpmbuild-$(SRC) .rpmbuild BUILD BUILDROOT RPMS SOURCES SPECS SRPMS .make-$(SRC) .configure-$(SRC) src
hooks/post-receive
--
cap4
|