aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGustavo De Nardin <spuk@mandriva.org>2007-06-06 21:26:02 +0000
committerGustavo De Nardin <spuk@mandriva.org>2007-06-06 21:26:02 +0000
commit158acfca81619a3c2e7ba5c3842d8f9e0420a8a5 (patch)
tree44f1987c196bc6ab130f1ad4a9c1a450e22f00fb /lib
parent8d36f0331572d5eabd0d6d3fa5b7b4e6bfc19a4d (diff)
downloadmga-youri-core-158acfca81619a3c2e7ba5c3842d8f9e0420a8a5.tar
mga-youri-core-158acfca81619a3c2e7ba5c3842d8f9e0420a8a5.tar.gz
mga-youri-core-158acfca81619a3c2e7ba5c3842d8f9e0420a8a5.tar.bz2
mga-youri-core-158acfca81619a3c2e7ba5c3842d8f9e0420a8a5.tar.xz
mga-youri-core-158acfca81619a3c2e7ba5c3842d8f9e0420a8a5.zip
Workaround for find strange behavior. Should finally fix bug #30315.
Diffstat (limited to 'lib')
-rw-r--r--lib/Youri/Repository.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Youri/Repository.pm b/lib/Youri/Repository.pm
index cc02bbc..8aa9cb0 100644
--- a/lib/Youri/Repository.pm
+++ b/lib/Youri/Repository.pm
@@ -305,7 +305,12 @@ sub get_files {
my $grep = "";
$grep = "-regextype posix-egrep -regex '.*\/$pattern'" if ($pattern);
- my @files = map { chop; $_; } `find -L $root/$path $grep -type f`;
+ # XXX: run find in a directory the user is guaranteed to have read
+ # permissions! find simply exits with error if the user doesn't have
+ # read permission on the *current* dir; as this code is run thru many
+ # sudo invocations, sometimes the user calling it has $HOME chmoded to
+ # 0700, making find fail when run as mandrake
+ my @files = map { chop; $_; } `cd && find -L $root/$path $grep -type f`;
die "FATAL: get_files(): find failed!" if ($?);
return @files;