changeset 1281:720b109bc978

Move zapchroot to a slightly less inappropriate place.
author Rob Landley <rob@landley.net>
date Tue, 09 Nov 2010 20:43:04 -0600
parents 35dc1da8988c
children 44073390f2b3
files more/zapchroot.sh sources/root-filesystem/bin/zapchroot
diffstat 2 files changed, 40 insertions(+), 40 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/more/zapchroot.sh	Tue Nov 09 20:43:04 2010 -0600
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+# Copyright 2010 Rob Landley <rob@landley.net> licensed under GPLv2
+
+if [ "$1" == "-d" ]
+then
+  DELETE=1
+  shift
+fi
+
+# Clean up a chroot directory
+
+ZAP=$(readlink -f "$1" 2>/dev/null)
+
+if [ ! -d "$ZAP" ]
+then
+  echo "usage: zapchroot [-d] dirname"
+  exit 1
+fi
+
+i="$(readlink -f "$(pwd)")"
+if [ "$ZAP" == "${i:0:${#ZAP}}" ]
+then
+  echo "Sanity check failed: cwd is under zapdir" >&2
+  exit 1
+fi
+
+# Iterate through the second entry of /proc/mounts in reverse order
+
+for i in $(awk '{print $2}' /proc/mounts | tac)
+do
+  # De-escape octal versions of space, tab, backslash, newline...
+  i=$(echo -e "$i")
+
+  # Skip entries that aren't under our chroot
+  [ "$ZAP" != "${i:0:${#ZAP}}" ] && continue
+
+  echo "Umounting: $i"
+  umount "$i"
+done
--- a/sources/root-filesystem/bin/zapchroot	Mon Nov 08 21:24:58 2010 -0600
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-#!/bin/bash
-
-# Copyright 2010 Rob Landley <rob@landley.net> licensed under GPLv2
-
-if [ "$1" == "-d" ]
-then
-  DELETE=1
-  shift
-fi
-
-# Clean up a chroot directory
-
-ZAP=$(readlink -f "$1" 2>/dev/null)
-
-if [ ! -d "$ZAP" ]
-then
-  echo "usage: zapchroot [-d] dirname"
-  exit 1
-fi
-
-i="$(readlink -f "$(pwd)")"
-if [ "$ZAP" == "${i:0:${#ZAP}}" ]
-then
-  echo "Sanity check failed: cwd is under zapdir" >&2
-  exit 1
-fi
-
-# Iterate through the second entry of /proc/mounts in reverse order
-
-for i in $(awk '{print $2}' /proc/mounts | tac)
-do
-  # De-escape octal versions of space, tab, backslash, newline...
-  i=$(echo -e "$i")
-
-  # Skip entries that aren't under our chroot
-  [ "$ZAP" != "${i:0:${#ZAP}}" ] && continue
-
-  echo "Umounting: $i"
-  umount "$i"
-done