From 902aefad1139b19d14164728cd6752d4514f94eb Mon Sep 17 00:00:00 2001 From: joey Date: Tue, 28 Oct 2003 22:11:51 +0000 Subject: [PATCH] * Make sure the working directory's subdirs have sane modes before trying to delete it, in case it has unwritable dirs and alien is not running as root. Closes: #217330 --- Alien/Package.pm | 6 ++++++ Alien/Package/Lsb.pm | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Alien/Package.pm b/Alien/Package.pm index 0ff5fcd..49933c1 100644 --- a/Alien/Package.pm +++ b/Alien/Package.pm @@ -304,6 +304,12 @@ sub DESTROY { if ($this->unpacked_tree eq '/') { die "alien internal error: unpacked_tree is set to '/'. Please file a bug report!"; } + + # Just in case some dir perms are too screwed up for rm to work and + # we're not running as root. NB: can't use xargs + $this->do('find', $this->unpacked_tree, '-type', 'd', + '-exec', 'chmod', '755', '{}', ';'); + $this->do('rm', '-rf', $this->unpacked_tree) or die "unable to delete temporary directory '".$this->unpacked_tree."': $!"; $this->unpacked_tree(''); diff --git a/Alien/Package/Lsb.pm b/Alien/Package/Lsb.pm index b31af31..7394925 100644 --- a/Alien/Package/Lsb.pm +++ b/Alien/Package/Lsb.pm @@ -96,7 +96,7 @@ sub revert { =item build -Uses the parent's build command. If a lsb-rpm is available, uses it to build +Uses the parent's build method. If a lsb-rpm is available, uses it to build the package. =cut