summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Vroon <chainsaw@gentoo.org>2017-06-30 18:48:44 +0100
committerTony Vroon <chainsaw@gentoo.org>2017-06-30 18:48:44 +0100
commit3ae4420681873e7d3f60758fce31f25b5d426ead (patch)
treee1957331458f84c3680d8d3580fc8b48565dc22d /sys-apps
parentmedia-libs/mlt: Drop old (diff)
downloadgentoo-3ae4420681873e7d3f60758fce31f25b5d426ead.tar.gz
gentoo-3ae4420681873e7d3f60758fce31f25b5d426ead.tar.bz2
gentoo-3ae4420681873e7d3f60758fce31f25b5d426ead.zip
sys-apps/cciss_vol_status: Version bump to 1.12; new cron script by Michael "mjo" Orlitzky closes bug #561868.
Package-Manager: portage-2.3.6
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/cciss_vol_status/Manifest1
-rw-r--r--sys-apps/cciss_vol_status/cciss_vol_status-1.12.ebuild21
-rw-r--r--sys-apps/cciss_vol_status/files/cciss_vol_status.cron252
3 files changed, 74 insertions, 0 deletions
diff --git a/sys-apps/cciss_vol_status/Manifest b/sys-apps/cciss_vol_status/Manifest
index 5ddfa11bc381..771888e2bb1a 100644
--- a/sys-apps/cciss_vol_status/Manifest
+++ b/sys-apps/cciss_vol_status/Manifest
@@ -2,3 +2,4 @@ DIST cciss_vol_status-1.03.tar.gz 86581 SHA256 b3cdcadba4dc8637c70aac9d594e32acb
DIST cciss_vol_status-1.09.tar.gz 104978 SHA256 93520050c3b1742288b92314585d1c0d4eaed9799747b8fc0c06977bbf5b74e4 SHA512 c773c6addcb26a3c635c28f9ebad7b9a5c2457516ffa87548fe0d3cee5ff864267dbe7c4dfccef0ed1c40d0273a833475ce4c96ba51f755776059daee892d114 WHIRLPOOL a3dcd382d5100c41bd0ff9900a3c6edba5e23a40711fbf9ec2762f596580947e51e31795b3d5a2daf4a299d68f798bba7500b5cb7e607a05f9cc39788abd0f48
DIST cciss_vol_status-1.10.tar.gz 107233 SHA256 803110bf3f7d49f3b03e299e9a5209eba2661631bd07630672e497a6e182a504 SHA512 2010a9fd90b3e4c1d21ae6946c8085df96d15e4d4ce732d6488034e96f1d029f48d6226190c7422f9d99ab2994315c0514c534bb79aafd52b52bd27498428461 WHIRLPOOL a3b80b9f914621fbcc8251c942638d7eef35dad40fdfe9f795ed2693045e36f3e5c5bf8559f49320679114b9fbde88b75b26cda33d13cdb80c36629df2380478
DIST cciss_vol_status-1.11.tar.gz 112316 SHA256 98c3c798cd8f322af8c8f18b19be069a137af15fce9e4022edee3ea7371df919 SHA512 20a80367a794a7f805f3b40184e93bd4f85e8ce2a7784eba1d2d68cbffc8299cbe121f9bf25e7112abec1269802f8146f3fc36501fb72536b1aee384e8d32064 WHIRLPOOL 70e7f5aa2f72e14e75df3c98b92bc03505ac770776bce1730c972bdf7f84808467275da93cf89e6eeab3e6af1096d8f51e35ef030a98d45ddcb3394d450fecaf
+DIST cciss_vol_status-1.12.tar.gz 120346 SHA256 a49abbfde6369416ac3d71bca6f60f342584eb99c786c080f8722ad19a17f91f SHA512 f9fa8b98bd42810932f03f514b4b8c6cea690378f065a6c9788ddb78612c7ca2aa9a7fefa8a40634cfe247600fb6d3f11f0b687fba77d1423087a2b319773d69 WHIRLPOOL 194a9edaea1c2e9b4a6a4681f583d3b665b84c432b4dfa26be9d96ea73ab7a7d632db0c7dc6a9c7d5b4b029f3e2bd78212feefa3789dd659e2e2d832034e3f9c
diff --git a/sys-apps/cciss_vol_status/cciss_vol_status-1.12.ebuild b/sys-apps/cciss_vol_status/cciss_vol_status-1.12.ebuild
new file mode 100644
index 000000000000..b70b2f6a0b91
--- /dev/null
+++ b/sys-apps/cciss_vol_status/cciss_vol_status-1.12.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+IUSE=""
+DESCRIPTION="Shows status of logical drives attached to HP SmartArray controllers"
+HOMEPAGE="http://cciss.sourceforge.net/#cciss_utils"
+LICENSE="GPL-2"
+SRC_URI="mirror://sourceforge/cciss/${P}.tar.gz"
+KEYWORDS="~amd64 ~ia64 ~x86"
+SLOT="0"
+RDEPEND=""
+DEPEND=""
+
+src_install() {
+ emake DESTDIR="${D}" install || die "Install failed."
+ dodoc AUTHORS ChangeLog NEWS README
+ exeinto /etc/cron.hourly
+ newexe "${FILESDIR}/cciss_vol_status.cron2" cciss_vol_status
+}
diff --git a/sys-apps/cciss_vol_status/files/cciss_vol_status.cron2 b/sys-apps/cciss_vol_status/files/cciss_vol_status.cron2
new file mode 100644
index 000000000000..43731b48e0ca
--- /dev/null
+++ b/sys-apps/cciss_vol_status/files/cciss_vol_status.cron2
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+test -x /usr/bin/cciss_vol_status || exit 0
+
+# WARNING: For the hpsa driver, we only support /dev/sda through
+# /dev/sdz and /dev/sg0 through /dev/sg9.
+DEVICES=$(find /dev -type b \( -path '/dev/cciss/c*d0' \
+ -or \
+ -path '/dev/sd[a-z]' \
+ -or \
+ -path '/dev/sg[0-9]' \))
+
+if [ -n "${DEVICES}" ]; then
+ #
+ # Unsupported devices will generate an error (to stderr) of the form,
+ #
+ # cciss_vol_status: /dev/sda: Unknown SCSI device.
+ #
+ # We want to ignore these, and fortunately, an exit code of zero
+ # is returned in this case. So we need only hide the output by
+ # redirecting stderr elsewhere. But, that also hides errors of the
+ # form,
+ #
+ # cciss_vol_status: open /dev/sda: Permission denied
+ #
+ # which we DO want to present to the user. So instead of sending
+ # stderr to stdout, we redirect it to a temporary file. We then
+ # show the content of the temporary file to the user if it
+ # contains errors other than "Unknown SCSI device."
+ #
+ TMPFILE=$( mktemp )
+ if [ $? -ne 0 ] || [ ! -f "${TMPFILE}" ]; then
+ echo "${0}: error creating temporary file." >&2
+ exit 2
+ fi
+
+ OUTPUT=$( /usr/bin/cciss_vol_status ${DEVICES} 2> "${TMPFILE}" )
+ if [ $? -ne 0 ]; then
+ printf "%s\n" "$OUTPUT"
+ rm -f "${TMPFILE}"
+ exit 1
+ fi
+
+ ERRORS=$( GREP_OPTIONS="" grep -v "Unknown SCSI device" "${TMPFILE}" )
+ rm -f "${TMPFILE}"
+ if [ -n "${ERRORS}" ]; then
+ echo "${ERRORS}" >&2
+ exit 3
+ fi
+fi
+
+exit 0