Import Debian changes 1.8.5-1
[hcoop/debian/openafs.git] / debian / ConfigUtils.pm
diff --git a/debian/ConfigUtils.pm b/debian/ConfigUtils.pm
new file mode 100644 (file)
index 0000000..4d35047
--- /dev/null
@@ -0,0 +1,26 @@
+# This is -*- perl -*-
+
+package Debian::OpenAFS::ConfigUtils;
+
+use strict;
+use vars qw( @ISA @EXPORT @unwinds);
+@ISA = qw(Exporter);
+require Exporter;
+@EXPORT = qw(@unwinds run unwind);
+
+sub run ($) {
+  print join(' ', @_);
+  print "\n";
+  system (@_)  == 0
+    or die "Failed: $?\n";
+}
+
+# This subroutine takes a command to run in case of failure.  After
+# each succesful step, this routine should be run with a command to
+# undo the successful step.
+
+        sub unwind($) {
+          push @unwinds, $_[0];
+        }
+
+1;