diff --git a/rpm/group-source-files.pl b/rpm/group-source-files.pl index 3a8aa85..4b0f6a4 100755 --- a/rpm/group-source-files.pl +++ b/rpm/group-source-files.pl @@ -19,6 +19,12 @@ sub main &output($dev, $ndev, $dev_output, $ndev_output); } +sub rpm_quote_filename +{ + # technically should also quote % -> %% " -> \" \ -> \\ + return map { "\"$_\"" } @_; +} + sub scan { # Normalize file path, mainly to strip away the ending forward slash, @@ -53,8 +59,14 @@ sub scan $is_devel ? push(@dev, $abs_path) : push(@ndev, $abs_path); } - push(@dev, &calc_dirs($abs_loc, \@dev)); - push(@ndev, &calc_dirs($abs_loc, \@ndev)); + my @dev_dirs = calc_dirs($abs_loc, \@dev); + my @ndev_dirs = calc_dirs($abs_loc, \@ndev); + @dev = rpm_quote_filename(@dev); + @ndev = rpm_quote_filename(@ndev); + @dev_dirs = map { "\%dir $_" } rpm_quote_filename(@dev_dirs); + @ndev_dirs = map { "\%dir $_" } rpm_quote_filename(@ndev_dirs); + push(@dev, @dev_dirs); + push(@ndev, @ndev_dirs); return (\@dev, \@ndev); } @@ -75,7 +87,7 @@ sub calc_dirs # This loop also makes sure that $base itself is included. } - return map { "\%dir $_" } keys %dirs; + return keys %dirs; } sub output diff --git a/rpm/kernel-source.spec.in b/rpm/kernel-source.spec.in index f05665f..ec2b6e0 100644 --- a/rpm/kernel-source.spec.in +++ b/rpm/kernel-source.spec.in @@ -326,6 +326,6 @@ done # the future and be thus lower than the timestamps of files built from the # source (bnc#669669). ts="$(head -n1 %_sourcedir/source-timestamp)" -find %buildroot/usr/src/linux* ! -type l | xargs touch -d "$ts" +find %buildroot/usr/src/linux* ! -type l -print0 | xargs -0 touch -d "$ts" %changelog