diff --git a/Build/Rpm.pm b/Build/Rpm.pm index 57880172..56ec05dc 100644 --- a/Build/Rpm.pm +++ b/Build/Rpm.pm @@ -1001,6 +1001,7 @@ sub parse { } elsif ($keyword eq '#!createarchive') { $createarchive = {}; $createarchive->{'dir'} = $arg if $arg =~ /^[^\.\/][^\/]*$/s; + $createarchive->{'dir'} = $arg if $arg == '.'; } elsif ($keyword eq '#!buildtarget') { $arg = (split(' ', $arg, 2))[0]; if ($arg =~ s/(.*?)://) { diff --git a/build-recipe b/build-recipe index 0626d596..898baa86 100644 --- a/build-recipe +++ b/build-recipe @@ -340,7 +340,12 @@ recipe_create_tar_from_dir() { echo "Creating $t from directory $f" if test "${t%.tar.*}" != "$f" ; then rm -rf "${t%.tar.*}" - mv -f "$f" "${t%.tar.*}" + if test "$f" = "."; then + mkdir "${t%.tar.*}" + cp -a "$f" "${t%.tar.*}" + else + mv -f "$f" "${t%.tar.*}" + fi fi rm -f $BUILD_ROOT/.unpack.command echo "#!/bin/sh -e" > $BUILD_ROOT/.unpack.command @@ -355,7 +360,7 @@ recipe_create_tar_from_dir() { chmod 0755 $BUILD_ROOT/.unpack.command chroot $BUILD_ROOT su -c /.unpack.command - $BUILD_USER || cleanup_and_exit 1 rm -f $BUILD_ROOT/.unpack.command - if test "${t%.tar.*}" != "$f" ; then + if test "$f" != "." -a "${t%.tar.*}" != "$f" ; then mv -f "${t%.tar.*}" "$f" fi }