--- /usr/bin/svn-buildpackage.old	2011-11-20 15:59:46.000000000 +0100
+++ /usr/bin/svn-buildpackage	2011-11-20 16:11:11.000000000 +0100
@@ -623,6 +623,7 @@
          # The files are stored in the archive under a top directory, we
          # presume
          withecho "mv", (<$ba/tmp-$mod/*>), $bdir;
+         rmdir "$ba/tmp-$mod";
       }
       else {
          # Otherwise, we put them into a new directory
@@ -630,9 +631,10 @@
       }
       foreach my $component (keys %otherOrigFiles) {
 	  withecho "rm", "-rf", "$bdir/$component";
+	  mkdir "$ba/tmp-$mod";
 	  withecho "tar", "--no-same-owner", "--no-same-permissions", "--extract", "--file", $otherOrigFiles{$component}, "--directory", "$ba/tmp-$mod";
 	  my @entries = (<$ba/tmp-$mod/*>);
-	  if (@entries == 1) {
+	  if (@entries == 1 && !-l "@entries" && -d "$_") {
 	     withecho "mv", (<$ba/tmp-$mod/*>), "$bdir/$component";
 	     rmdir "$ba/tmp-$mod";
 	  } else {
