Subject: | Removed prune from find to make it work on Linux |
RPM-Tools-0.6
Perl 5.6.1
Linux 2.4.2
GNU find 4.1.6
make test failed on Linux with the following message:
[tjmather@br1a RPM-Tools-0.6]$ make test
PERL_DL_NONLAZY=1 /usr/longitude/bin/perl -Iblib/arch -Iblib/lib -I/usr/longitude/lib/perl5/5.6.1/i386-linux -I/usr/longitude/lib/perl5/5.6.1 test.pl
This script will try to build an RPM assuming an i386 architecture.
Generating temporary directory ./TempBuildLoc
Creating stand-alone rpm build environment.
**** ERROR **** tmproot/file1.txt is neither a directory, soft link, or file.
make: *** [test_dynamic] Error 29
I was able to fix the problem by removing -prune from the find command. On my system
find doesn't return the file if -prune is included. I have included a patch that removes
-prune from the find. I'm not sure if this change is compatible with other Operating
systems.
diff -ru RPM-Tools-0.6/RPM/Make.pm RPM-Tools-0.61/RPM/Make.pm
--- RPM-Tools-0.6/RPM/Make.pm Wed Sep 11 12:23:34 2002
+++ RPM-Tools-0.61/RPM/Make.pm Wed Sep 18 15:27:12 2002
@@ -617,16 +617,16 @@
sub find_info {
my ($file)=@_;
my $line='';
- if (($line=`find $file -type f -prune`)=~/^$file\n/) {
- $line=`find $file -type f -prune -printf "\%s\t\%m\t\%u\t\%g"`;
+ if (($line=`find $file -type f`)=~/^$file\n/) {
+ $line=`find $file -type f -printf "\%s\t\%m\t\%u\t\%g"`;
return("files",split(/\t/,$line));
}
- elsif (($line=`find $file -type d -prune`)=~/^$file\n/) {
- $line=`find $file -type d -prune -printf "\%s\t\%m\t\%u\t\%g"`;
+ elsif (($line=`find $file -type d`)=~/^$file\n/) {
+ $line=`find $file -type d -printf "\%s\t\%m\t\%u\t\%g"`;
return("directories",split(/\t/,$line));
}
- elsif (($line=`find $file -type l -prune`)=~/^$file\n/) {
- $line=`find $file -type l -prune -printf "\%l\t\%m\t\%u\t\%g"`;
+ elsif (($line=`find $file -type l`)=~/^$file\n/) {
+ $line=`find $file -type l -printf "\%l\t\%m\t\%u\t\%g"`;
return("links",split(/\t/,$line));
}
die("**** ERROR **** $file is neither a directory, soft link, or file.\n");