[Piuparts-commits] [SCM] piuparts git repository branch, piatti, updated. 0.49-105-gac1319a

Andreas Beckmann anbe at debian.org
Fri Mar 1 15:32:49 UTC 2013


The following commit has been merged in the piatti branch:
commit e945294a016e3124f54957480d63ae3d52961368
Author: Andreas Beckmann <anbe at debian.org>
Date:   Sat Jan 26 20:52:21 2013 +0100

    detect_tmp_cruft: merge functionality from detect_stale_mounts
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>

diff --git a/debian/changelog b/debian/changelog
index 5186305..b7c9086 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -21,6 +21,7 @@ piuparts (0.50) UNRELEASED; urgency=low
   * slave_{run,join}: Rename the screen session to "piuparts_slave_screen".
   * slave_{run,join,cleanup}: Use pgrep to find running processes.
   * detect_leftover_processes: Move statefile to slave-directory.
+  * detect_stale_mounts: Merge into detect_tmp_cruft.
 
  -- Andreas Beckmann <debian at abeckmann.de>  Tue, 15 Jan 2013 11:51:43 +0100
 
diff --git a/master-bin/detect_stale_mounts b/master-bin/detect_stale_mounts
deleted file mode 100755
index a7800a8..0000000
--- a/master-bin/detect_stale_mounts
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/sh
-
-# Copyright 2009 Holger Levsen (holger at layer-acht.org)
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation; either version 2 of the License, or (at your
-# option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-# Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-PIUPARTS_CONF=${PIUPARTS_CONF:-/etc/piuparts/piuparts.conf}
-[ -f "$PIUPARTS_CONF" ] || exit 0
-
-# usage: get_config_value VARIABLE section key [default]
-get_config_value()
-{
-	local section key value
-	test -n "$1" && test "$1" = "$(echo "$1" | tr -c -d '[:alnum:]_')" || exit 1
-	section="$2"
-	key="$3"
-	value="$(sed -rn '\#^\['"$section"'\]#,/^\[/ {/^'"$key"'\s*=/ {s/^'"$key"'\s*=\s*//; s/\s*$//; p}}' "$PIUPARTS_CONF")"
-	test -n "$value" || value="$4"
-	if [ -z "$value" ]; then
-		echo "'$key' not set in section [$section] of $PIUPARTS_CONF, exiting." >&2
-		exit 1
-	fi
-	eval "$1"='"$value"'
-}
-
-get_config_value PIUPARTS_TMPDIR global tmpdir /org/piuparts.debian.org/tmp
-
-
-FILE=`mktemp`
-cp /proc/mounts $FILE
-
-if [ "$(grep -v trash $FILE | grep -c "$PIUPARTS_TMPDIR" )" -gt 1 ] ; then
-	echo "More than one mountpoint below $PIUPARTS_TMPDIR detected!"
-	echo
-	grep "$PIUPARTS_TMPDIR" $FILE
-	echo
-	echo "Zero or one mountpoint is normal for piuparts operation, more is not."
-	echo "Please investigate and cleanup."
-fi
-rm $FILE
diff --git a/master-bin/detect_tmp_cruft b/master-bin/detect_tmp_cruft
index 5d07ba3..14798a9 100755
--- a/master-bin/detect_tmp_cruft
+++ b/master-bin/detect_tmp_cruft
@@ -16,6 +16,10 @@
 # with this program; if not, write to the Free Software Foundation, Inc.,
 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
+#
+# check for stale mounts and chroots in $PIUPARTS_TMPDIR
+#
+
 
 PIUPARTS_CONF=${PIUPARTS_CONF:-/etc/piuparts/piuparts.conf}
 [ -f "$PIUPARTS_CONF" ] || exit 0
@@ -39,6 +43,20 @@ get_config_value()
 get_config_value PIUPARTS_TMPDIR global tmpdir /org/piuparts.debian.org/tmp
 
 
+MOUNTS="$(mktemp)"
+cp /proc/mounts "$MOUNTS"
+
+if [ "$(grep -v trash "$MOUNTS" | grep -c "$PIUPARTS_TMPDIR")" -gt 1 ] ; then
+	echo "More than one mountpoint below $PIUPARTS_TMPDIR detected!"
+	echo
+	grep "$PIUPARTS_TMPDIR" "$MOUNTS"
+	echo
+	echo "Zero or one mountpoint is normal for piuparts operation, more is not."
+	echo "Please investigate and cleanup."
+	echo
+fi
+rm "$MOUNTS"
+
 LS_TMP=$(ls --color=never -l "$PIUPARTS_TMPDIR")
 if [ "$(echo "$LS_TMP" | wc -l)" -gt 12 ] ; then
 	echo "More than ten directories in $PIUPARTS_TMPDIR detected!"
@@ -49,5 +67,6 @@ if [ "$(echo "$LS_TMP" | wc -l)" -gt 12 ] ; then
 	echo
 	echo "One is normal for piuparts operation, more is not."
 	echo "Please investigate and cleanup."
+	echo
 fi
 

-- 
piuparts git repository



More information about the Piuparts-commits mailing list