octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug with pkg if only a single file is installed


From: Søren Hauberg
Subject: Re: Bug with pkg if only a single file is installed
Date: Wed, 13 Sep 2006 22:05:40 +0200

I'm not sure I understand the problem, and I don't see how the patch
solves it (I've had a loong day at work). 
Basicly you want to add
  mkdir(desc.dir)
to the function 'copy_files'. The way I read the source (it's been a
while since I wrote it) the function 'prepare_installation' should've
done this already. I don't quite see what this has to do with only a
single file needs copying.

I do however see a potential bug, that your patch fixes. If you install
a package that replaces an old installation (an upgrade) things will
fail (I think). The following will happen:
  1) 'prepare_installation' will create the desc.dir directory.
  2) 'uninstall' will remove the the desc.dir directory.
  3) The installation will fail because desc.dir no longer exists.

I think this is the bug your fixing. So I think the patch should be
good, except the function 'prepare_installation' shouldn't create the
desc.dir directory if the patch is accepted.

Søren

ons, 13 09 2006 kl. 21:35 +0200, skrev David Bateman:
> It seems that pkg can fail if there is only a single file to install. An
> example is the combinatorics toolbox that has a single file plus a
> PKG_ADD with autoload's for other functions. I think the attached patch
> addresses this, thogh Soren should probably comment..
> 
> D.
> plain text document-bilag (patch)
> Index: scripts/pkg/pkg.m
> ===================================================================
> RCS file: /cvs/octave/scripts/pkg/pkg.m,v
> retrieving revision 1.10
> diff -c -r1.10 pkg.m
> *** scripts/pkg/pkg.m 12 Sep 2006 21:25:27 -0000      1.10
> --- scripts/pkg/pkg.m 13 Sep 2006 19:31:54 -0000
> ***************
> *** 599,604 ****
> --- 599,611 ----
>   function copy_files (desc, packdir, bindir)
>       ## Copy the files from "inst" to installdir
>       if (! dirempty([packdir "inst"]))
> +       if (! exist (desc.dir, "dir"))
> +     [status, output] = mkdir (desc.dir);
> +         if (status != 1)
> +        error("Couldn't create installation directory %s : %s\n", 
> +              desc.dir, output);
> +         endif
> +       endif
>         [status, output] = system(["cp -R " packdir "inst/* " desc.dir]);
>         if (status != 0)
>             rm_rf(desc.dir);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]