[csw-devel] SF.net SVN: gar:[7138] csw/mgar/pkg/cswpkgloghooks/trunk
bdwalton at users.sourceforge.net
bdwalton at users.sourceforge.net
Fri Nov 6 03:10:32 CET 2009
Revision: 7138
http://gar.svn.sourceforge.net/gar/?rev=7138&view=rev
Author: bdwalton
Date: 2009-11-06 02:10:32 +0000 (Fri, 06 Nov 2009)
Log Message:
-----------
cswpkgloghooks: update files, file content to reflect rename
Modified Paths:
--------------
csw/mgar/pkg/cswpkgloghooks/trunk/Makefile
Added Paths:
-----------
csw/mgar/pkg/cswpkgloghooks/trunk/files/01-CSWcswpkgloghooks-postupgrade
csw/mgar/pkg/cswpkgloghooks/trunk/files/01-CSWcswpkgloghooks-preupgrade
Removed Paths:
-------------
csw/mgar/pkg/cswpkgloghooks/trunk/files/01-CSWcswpkgsyslog-postupgrade
csw/mgar/pkg/cswpkgloghooks/trunk/files/01-CSWcswpkgsyslog-preupgrade
Modified: csw/mgar/pkg/cswpkgloghooks/trunk/Makefile
===================================================================
--- csw/mgar/pkg/cswpkgloghooks/trunk/Makefile 2009-11-06 02:02:40 UTC (rev 7137)
+++ csw/mgar/pkg/cswpkgloghooks/trunk/Makefile 2009-11-06 02:10:32 UTC (rev 7138)
@@ -1,4 +1,4 @@
-GARNAME = cswpkgsyslog
+GARNAME = cswpkgloghooks
GARVERSION = 1.0
CATEGORIES = utils
Copied: csw/mgar/pkg/cswpkgloghooks/trunk/files/01-CSWcswpkgloghooks-postupgrade (from rev 7136, csw/mgar/pkg/cswpkgloghooks/trunk/files/01-CSWcswpkgsyslog-postupgrade)
===================================================================
--- csw/mgar/pkg/cswpkgloghooks/trunk/files/01-CSWcswpkgloghooks-postupgrade (rev 0)
+++ csw/mgar/pkg/cswpkgloghooks/trunk/files/01-CSWcswpkgloghooks-postupgrade 2009-11-06 02:10:32 UTC (rev 7138)
@@ -0,0 +1,62 @@
+#!/opt/csw/bin/bash
+
+script=$0
+
+set -- ${1/-/ }
+PKG=$1
+VER=$2
+
+function logdie() {
+ logger -t "cswpkgloghooks" "$1"
+ exit 0
+}
+
+function success() {
+ case ${script} in
+ *install) MSG="installed ${PKG} ${VER}";;
+ *upgrade) MSG="upgraded ${PKG} to ${VER} (from: $1)";;
+ *remove) MSG="removed ${PKG} ${VER}";;
+ esac
+
+ logdie "${MSG}"
+}
+
+function failure() {
+ case ${script} in
+ *install) MSG="Failed to install ${PKG} ${VER}";;
+ *upgrade) MSG="Failed to upgrade ${PKG} ${VER} (current: $1)";;
+ *remove) MSG="Failed to remove ${PKG} ${VER}";;
+ esac
+
+ logdie "${MSG}"
+}
+
+if [ -d /var/sadm/pkg/${PKG} ]; then
+ SYSTEMVER=$(pkgparam ${PKG} VERSION 2>/dev/null)
+ pf=/var/opt/csw/pkg-hooks/CSWcswpkgloghooks.upgrade.${PKG}
+ if [ -f ${pf} ]; then
+ PREVVER=$(cat ${pf} 2>/dev/null)
+ rm -f ${pf}
+ fi
+
+ case ${script} in
+ *remove)
+ failure
+ ;;
+ *install|*upgrade)
+ case "${VER}" in
+ ${SYSTEMVER}) success ${PREVVER};;
+ *) failure ${SYSTEMVER};;
+ esac
+ ;;
+ esac
+else
+ case ${script} in
+ *remove)
+ success
+ ;;
+ *install|*upgrade)
+ failure
+ ;;
+ esac
+fi
Copied: csw/mgar/pkg/cswpkgloghooks/trunk/files/01-CSWcswpkgloghooks-preupgrade (from rev 7136, csw/mgar/pkg/cswpkgloghooks/trunk/files/01-CSWcswpkgsyslog-preupgrade)
===================================================================
--- csw/mgar/pkg/cswpkgloghooks/trunk/files/01-CSWcswpkgloghooks-preupgrade (rev 0)
+++ csw/mgar/pkg/cswpkgloghooks/trunk/files/01-CSWcswpkgloghooks-preupgrade 2009-11-06 02:10:32 UTC (rev 7138)
@@ -0,0 +1,11 @@
+#!/opt/csw/bin/bash
+
+set -- ${1/-/ }
+
+PKG=$1
+VER=$2
+
+SYSTEMVER=$(pkgparam ${PKG} VERSION)
+
+# store previous version so we can log smarter things if upgrade fails.
+echo ${SYSTEMVER} > /var/opt/csw/pkg-hooks/CSWcswpkgloghooks.upgrade.${PKG}
Deleted: csw/mgar/pkg/cswpkgloghooks/trunk/files/01-CSWcswpkgsyslog-postupgrade
===================================================================
--- csw/mgar/pkg/cswpkgloghooks/trunk/files/01-CSWcswpkgsyslog-postupgrade 2009-11-06 02:02:40 UTC (rev 7137)
+++ csw/mgar/pkg/cswpkgloghooks/trunk/files/01-CSWcswpkgsyslog-postupgrade 2009-11-06 02:10:32 UTC (rev 7138)
@@ -1,62 +0,0 @@
-#!/opt/csw/bin/bash
-
-script=$0
-
-set -- ${1/-/ }
-PKG=$1
-VER=$2
-
-function logdie() {
- logger -t "cswpkgsyslog" "$1"
- exit 0
-}
-
-function success() {
- case ${script} in
- *install) MSG="installed ${PKG} ${VER}";;
- *upgrade) MSG="upgraded ${PKG} to ${VER} (from: $1)";;
- *remove) MSG="removed ${PKG} ${VER}";;
- esac
-
- logdie "${MSG}"
-}
-
-function failure() {
- case ${script} in
- *install) MSG="Failed to install ${PKG} ${VER}";;
- *upgrade) MSG="Failed to upgrade ${PKG} ${VER} (current: $1)";;
- *remove) MSG="Failed to remove ${PKG} ${VER}";;
- esac
-
- logdie "${MSG}"
-}
-
-if [ -d /var/sadm/pkg/${PKG} ]; then
- SYSTEMVER=$(pkgparam ${PKG} VERSION 2>/dev/null)
- pf=/var/opt/csw/pkg-hooks/CSWcswpkgsyslog.upgrade.${PKG}
- if [ -f ${pf} ]; then
- PREVVER=$(cat ${pf} 2>/dev/null)
- rm -f ${pf}
- fi
-
- case ${script} in
- *remove)
- failure
- ;;
- *install|*upgrade)
- case "${VER}" in
- ${SYSTEMVER}) success ${PREVVER};;
- *) failure ${SYSTEMVER};;
- esac
- ;;
- esac
-else
- case ${script} in
- *remove)
- success
- ;;
- *install|*upgrade)
- failure
- ;;
- esac
-fi
Deleted: csw/mgar/pkg/cswpkgloghooks/trunk/files/01-CSWcswpkgsyslog-preupgrade
===================================================================
--- csw/mgar/pkg/cswpkgloghooks/trunk/files/01-CSWcswpkgsyslog-preupgrade 2009-11-06 02:02:40 UTC (rev 7137)
+++ csw/mgar/pkg/cswpkgloghooks/trunk/files/01-CSWcswpkgsyslog-preupgrade 2009-11-06 02:10:32 UTC (rev 7138)
@@ -1,11 +0,0 @@
-#!/opt/csw/bin/bash
-
-set -- ${1/-/ }
-
-PKG=$1
-VER=$2
-
-SYSTEMVER=$(pkgparam ${PKG} VERSION)
-
-# store previous version so we can log smarter things if upgrade fails.
-echo ${SYSTEMVER} > /var/opt/csw/pkg-hooks/CSWcswpkgsyslog.upgrade.${PKG}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list