aboutsummaryrefslogtreecommitdiff
path: root/clubber
diff options
context:
space:
mode:
Diffstat (limited to 'clubber')
-rwxr-xr-xclubber22
1 files changed, 13 insertions, 9 deletions
diff --git a/clubber b/clubber
index 4e871d1..fda8039 100755
--- a/clubber
+++ b/clubber
@@ -24,13 +24,6 @@ use File::Basename;
use Getopt::Long;
#
-# Bail if we're not root.
-#
-if ($< != 0 || $> != 0) {
- error("You must have root permissions to use this script.");
-}
-
-#
# Check ldd is available.
#
chomp(my $ldd = `which ldd`);
@@ -164,7 +157,7 @@ if ($chroot) {
#
# If we're just supposed to print what we do, all the better, do
- # that and then quit.
+ # that and then quit; and for that, we don't require root privileges.
#
if ($dry) {
if (keys %$directories) {
@@ -181,9 +174,20 @@ if ($chroot) {
}
#
- # Otherwise, we'd best get started.
+ # Otherwise, we'd best get started, and we need root privileges.
#
} else {
+
+ #
+ # Bail if we're not root.
+ #
+ if ($< != 0 || $> != 0) {
+ error("You must have root permissions to use the --chroot parameter.");
+ }
+
+ #
+ # Create directories and import libraries.
+ #
foreach my $directory (keys(%$directories)) {
system("mkdir -pv ${chroot}${directory}");
}