[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Comments about pkg.m
From: |
David Bateman |
Subject: |
Re: Comments about pkg.m |
Date: |
Fri, 18 May 2007 23:38:41 +0200 |
User-agent: |
Thunderbird 1.5.0.7 (X11/20060921) |
Michael Goffioul wrote:
> Hi,
>
> I have a few comments about the pkg.m verbosity mode. They are quite
> personal, so other people might not agree. IMO, the verbose mode is not
> verbose enough; I'd like to see messages like "Decompressing package...",
> "Compiling...", "Copying files..." and so on.
> I also would avoid to buffer output messages with "system" when verbose
> mode is on.
> Finally, I would also output informations like temporary directory where
> source
> code is decompressed, installation directory, user mode (superuser or not)
> and so on.
>
> Michael.
>
I started adding a few more in my current patch attached that also
addresses the issues with the architecture dependent directories (I
hope, but see the other thread). I'd be happy to see other changes to
the verbose mode.
We'll need to converge our patches, so as John suggested I commit this
patch when I was ready, I have. Though the question at the end of the thread
http://www.cae.wisc.edu/pipermail/bug-octave/2007-May/002422.html
still needs addressing..
Regards
David
Index: scripts/pkg/pkg.m
===================================================================
RCS file: /usr/local/cvsroot/octave/scripts/pkg/pkg.m,v
retrieving revision 1.43
diff -u -r1.43 pkg.m
--- scripts/pkg/pkg.m 14 May 2007 13:56:34 -0000 1.43
+++ scripts/pkg/pkg.m 18 May 2007 21:29:12 -0000
@@ -302,12 +302,18 @@
## Create a temporary directory
tmpdir = tmpnam ();
tmpdirs{end+1} = tmpdir;
+ if (verbose)
+ printf ("mkdir (%s)\n", tmpdir);
+ endif
[status, msg] = mkdir (tmpdir);
if (status != 1)
error ("couldn't create temporary directory: %s", msg);
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
@@ -760,6 +766,11 @@
if (! all (isspace (filenames)))
mkdir (instdir);
if (! all (isspace (archindependent)))
+ if (verbose)
+ printf ("copyfile");
+ printf (" %s", archindependent{:});
+ printf ("%s\n", instdir);
+ endif
[status, output] = copyfile (archindependent, instdir);
if (status != 1)
rm_rf (desc.dir);
@@ -767,6 +778,11 @@
endif
endif
if (! all (isspace (archdependent)))
+ if (verbose)
+ printf ("copyfile");
+ printf (" %s", archdependent{:});
+ printf (" %s\n", archdir);
+ endif
mkdir (archdir);
[status, output] = copyfile (archdependent, archdir);
if (status != 1)
@@ -799,7 +815,16 @@
endfunction
function create_pkgadddel (desc, packdir, nm)
- pkg = fullfile (desc.dir, nm);
+ archdir = fullfile (desc.dir, getarch ());
+
+ ## If it is exists, the PKG_* files should go into the architecture
+ ## dependent directory so that the autoload/mfilename commands work
+ ## as expected...
+ if (exist (archdir, "dir"))
+ pkg = fullfile (desc.dir, getarch(), nm);
+ else
+ pkg = fullfile (desc.dir, nm);
+ endif
fid = fopen (pkg, "wt");
if (fid >= 0)
@@ -1138,6 +1163,17 @@
error ("couldn't read directory %s: %s", dir, msg);
endif
+ ## Check for architecture dependent files
+ arch = getarch();
+ tmpdir = fullfile (dir, arch);
+ if (exist (tmpdir, "dir"))
+ [files2, err, msg] = readdir (tmpdir);
+ if (err)
+ error ("couldn't read directory %s: %s", tmpdir, msg);
+ endif
+ files = [files; files2];
+ endif
+
functions = {};
for i = 1:length (files)
file = files{i};