Martin Hejl <[EMAIL PROTECTED]> writes:

> Update of /cvsroot/leaf/src/bering-uclibc/buildtool
> In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32764
>
> Modified Files:
>       buildpacket.pl 
> Log Message:
> Hopefully fixed problem with permissions of directories that are also used in 
> a file-entry with a wildcard and issue with filenames containing "+"

Unfortunately, this patch does not fix the problem (debug output added
by me):

sourceFile = 
/tmp/BUILDTOOL_STAGING_vR02/lib/libstdc++.so.5.0.5/libstdc\+\+\.so\.5\.0\.5
Nested quantifiers in regex; marked by <-- HERE in 
m/^/tmp/BUILDTOOL_STAGING_vR02/lib/libstdc++ <-- HERE 
.so.5.0.5/libstdc\+\+\.so\.5\.0\.5$/ at ./buildpacket.pl line 768.

However, I wonder why the wildcard stuff is not done with glob() or
File::Glob...

> Index: buildpacket.pl
> ===================================================================
> RCS file: /cvsroot/leaf/src/bering-uclibc/buildtool/buildpacket.pl,v
> retrieving revision 1.26
> retrieving revision 1.27
> diff -C2 -d -r1.26 -r1.27
> *** buildpacket.pl    22 Oct 2004 20:34:23 -0000      1.26
> --- buildpacket.pl    31 Jan 2005 21:31:24 -0000      1.27
> ***************
> *** 184,187 ****
> --- 184,190 ----
>               $regex =~ s/\./\\\./ig;
>               $regex =~ s/\*/\.\*/ig;
> +             # make sure a "+" in the filename doesn't screw up our regex
> +             $regex =~ s/\+/\\\+/ig;
> +             
>   
>               foreach my $fileToCheck (keys %{$p_h_tmpListFiles}) {
> ***************
> *** 206,209 ****
> --- 209,216 ----
>               $regex =~ s/\*/\.\*/ig;
>   
> +             # make sure a "+" in the filename doesn't screw up our regex
> +             $regex =~ s/\+/\\\+/ig;
> +             
> + 
>               foreach my $fileToCheck (keys %{$p_h_allFiles}) {
>                       # if it matches, we can remove it from the list
> ***************
> *** 709,723 ****
>       print "Setting file ownerships and permissions\n"  if $verbose;
>   
> -     my $permission;
> -     my $ownership;
>   
>       foreach my $file (keys %{$p_h_package_contents}) {
>               # setup defaults
>               if ($p_h_package_contents->{$file} eq 'FILE') {
> !                     $permission = $p_h_package->{'permissions'}->{'files'} ;
> !                     $ownership = $p_h_package->{'owner'}->{'files'};
>               } else {
> !                     $permission = 
> $p_h_package->{'permissions'}->{'directories'} ;
> !                     $ownership = $p_h_package->{'owner'}->{'directories'};
>               }
>   
> --- 716,736 ----
>       print "Setting file ownerships and permissions\n"  if $verbose;
>   
>   
>       foreach my $file (keys %{$p_h_package_contents}) {
> + 
> +             my $permission=0;
> +             my $ownership=0;
> + 
> +             my $defaultPermission;
> +             my $defaultOwnership;
> + 
> +     
>               # setup defaults
>               if ($p_h_package_contents->{$file} eq 'FILE') {
> !                     $defaultPermission = 
> $p_h_package->{'permissions'}->{'files'} ;
> !                     $defaultOwnership = $p_h_package->{'owner'}->{'files'};
>               } else {
> !                     $defaultPermission = 
> $p_h_package->{'permissions'}->{'directories'} ;
> !                     $defaultOwnership = 
> $p_h_package->{'owner'}->{'directories'};
>               }
>   
> ***************
> *** 745,748 ****
> --- 758,763 ----
>                               $sourceFile =~ s/\./\\\./ig;
>                               $sourceFile =~ s/\*/\.\*/ig;
> +                             # make sure a "+" in the filename doesn't screw 
> up our regex
> +                             $sourceFile =~ s/\+/\\\+/ig;
>                       
>                               # We must assume that $filename is a directory, 
> if
> ***************
> *** 753,764 ****
>                       }
>                       
> !                     if ($file eq $filename || $wildcardMatch ) {
>                               $permission = $p_h_file->{'permissions'} if 
> exists($p_h_file->{'permissions'} );
>                               $ownership = $p_h_file->{'owner'} if 
> exists($p_h_file->{'owner'});
>                               last;
>                       }
>   
>               }
>               
>               # don't change permissions of links
>               if (! -l $file) {
> --- 768,789 ----
>                       }
>                       
> !                     # tricky - problematic when a file entry as well as a 
> wildcard matches
> !                     # if that happens, the file entry overrides the 
> wildcard match
> !                     if ($file eq $filename && $p_h_file->{'source'} !~ 
> /\*/g) {
>                               $permission = $p_h_file->{'permissions'} if 
> exists($p_h_file->{'permissions'} );
>                               $ownership = $p_h_file->{'owner'} if 
> exists($p_h_file->{'owner'});
>                               last;
>                       }
> +                     
> +                     if ($wildcardMatch && !$ownership) {
> +                             $permission = $p_h_file->{'permissions'} if 
> exists($p_h_file->{'permissions'} );
> +                             $ownership = $p_h_file->{'owner'} if 
> exists($p_h_file->{'owner'});                      
> +                     }
>   
>               }
>               
> +             $permission = $defaultPermission unless $permission;
> +             $ownership = $defaultOwnership unless $ownership;
> +                             
>               # don't change permissions of links
>               if (! -l $file) {


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

_______________________________________________
leaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/leaf-devel

Reply via email to