Description: Allow installation of already extracted packages with pkg.m
Forwarded: not-needed
Author: Thomas Weber <tweber@debian.org>
--- a/scripts/pkg/private/install.m
+++ b/scripts/pkg/private/install.m
@@ -75,25 +75,32 @@
         endif
 
         ## Uncompress the package.
-        if (verbose)
-          printf ("untar (%s, %s)\n", tgz, tmpdir);
-        endif
-        untar (tgz, tmpdir);
-
-        ## Get the name of the directories produced by tar.
-        [dirlist, err, msg] = readdir (tmpdir);
-        if (err)
-          error ("couldn't read directory produced by tar: %s", msg);
-        endif
+	if (!exist(tgz, "dir"))
+          if (verbose)
+            printf ("untar (%s, %s)\n", tgz, tmpdir);
+          endif
+          untar (tgz, tmpdir);
 
-        if (length (dirlist) > 3)
-          error ("bundles of packages are not allowed");
-        endif
-      endif
+	  ## Get the name of the directories produced by tar.
+          [dirlist, err, msg] = readdir (tmpdir);
+          if (err)
+            error ("couldn't read directory produced by tar: %s", msg);
+          endif
 
-      ## The filename pointed to an uncompressed package to begin with.
-      if (exist (tgz, "dir"))
-        dirlist = {".", "..", tgz};
+          if (length (dirlist) > 3)
+            error ("bundles of packages are not allowed");
+          endif
+	else
+	  ## we are dealing with a directory, so just copy the files
+	  if (verbose)
+	    printf ("Copying directory (%s, %s)\n", tgz, tmpdir);
+	  endif
+	  [status, msg, msgid] = copyfile (tgz, tmpdir);
+	  if (!status)
+	    disp(msg);
+	  endif
+	  dirlist = {".", "..", tgz};
+	endif
       endif
 
       if (exist (tgz, "file") || exist (tgz, "dir"))
