pkg - post_install.m

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

pkg - post_install.m

Marco Vassallo2
Hi all,

I have a little problem using pkg.

After the installation, I need to move a file from the folder where the DLD-function are installed ("x86_64-unknown-linux-gnu-api-v48+" on my pc) to another directory.


function post_install (desc)

  func = fullfile (desc.dir, "@function");
  [status, msg] = mkdir (func);

  [status, msg, msgid] = movefile ('./src/feval.oct', func, 'f');

endfunction


After the installation, the file "feval.oct" has been correctly moved to the "@function" folder, but it is also available in the original folder "x86_64-unknown-linux-gnu-api-v48+".
How can I fix it?

Thanks

Marco

Reply | Threaded
Open this post in threaded view
|

Re: pkg - post_install.m

Mike Miller
On Fri, Sep 6, 2013 at 09:52:32 +0200, marco Vassallo wrote:
> After the installation, I need to move a file from the folder where the
> DLD-function are installed ("x86_64-unknown-linux-gnu-api-v48+" on my pc) to
> another directory.

Have you tried building the feval.oct file under a @function folder as
part of your package build rules? Something like this in your
Makefile.in:

@function/feval.oct: feval.cc function.h
        mkdir -p @function
        $(MKOCTFILE) $(CPPFLAGS) -I. feval.cc $(LDFLAGS) $(LIBS) -o $@

Or even rename the file in the source tree to src/@function/feval.cc.
I don't know that it will work, but that's what I would try.

--
mike
Reply | Threaded
Open this post in threaded view
|

Re: pkg - post_install.m

Carnë Draug
In reply to this post by Marco Vassallo2
On 6 September 2013 08:52, marco Vassallo <[hidden email]> wrote:

> I have a little problem using pkg.
>
> After the installation, I need to move a file from the folder where the
> DLD-function are installed ("x86_64-unknown-linux-gnu-api-v48+" on my pc) to
> another directory.
>
> function post_install (desc)
>
>   func = fullfile (desc.dir, "@function");
>   [status, msg] = mkdir (func);
>
>   [status, msg, msgid] = movefile ('./src/feval.oct', func, 'f');
>
> endfunction

I took a closer look at this and noticed that you're trying to move an
oct file (architecture dependent), into a new directory where the .m
files are meant to go. We make a distinction between the two. Why are
you doing this?

Carnë
Reply | Threaded
Open this post in threaded view
|

RE: pkg - post_install.m

Marco Vassallo2
In reply to this post by Marco Vassallo2
----------------------------------------

> From: [hidden email]
> Date: Wed, 11 Sep 2013 16:25:22 +0100
> Subject: Re: pkg - post_install.m
> To: [hidden email]
> CC: [hidden email]
>
> On 6 September 2013 08:52, marco Vassallo <[hidden email]> wrote:
> > I have a little problem using pkg.
> >
> > After the installation, I need to move a file from the folder where the
> > DLD-function are installed ("x86_64-unknown-linux-gnu-api-v48+" on my pc) to
> > another directory.
> >
> > function post_install (desc)
> >
> > func = fullfile (desc.dir, "@function");
> > [status, msg] = mkdir (func);
> >
> > [status, msg, msgid] = movefile ('./src/feval.oct', func, 'f');
> >
> > endfunction
>
> I took a closer look at this and noticed that you're trying to move an
> oct file (architecture dependent), into a new directory where the .m
> files are meant to go. We make a distinction between the two. Why are
> you doing this?
>

I'm moving an oct file to the @mesh folfder, which I think is the only way
for implementing polymorphism.
Marco

> Carnë
Reply | Threaded
Open this post in threaded view
|

Re: pkg - post_install.m

c.-2

On 11 Sep 2013, at 17:33, marco Vassallo <[hidden email]> wrote:

> I'm moving an oct file to the @mesh folfder, which I think is the only way
> for implementing polymorphism.
> Marco

Why not build the oct file within the @mesh folder directly as someone previously suggested?
The current approach doesn't seem to work anyway:

>> pkg install fem-fenics.tgz
movefile: no files to move
error: called from 'movefile' in file /Applications/FEniCS.app/Contents/Resources/share/octave/3.7.6+/m/miscellaneous/movefile.m near line 94, column 5
error: called from:
error:   /Applications/FEniCS.app/Contents/Resources/share/octave/3.7.6+/m/pkg/private/install.m at line 241, column 5
error:   /Applications/FEniCS.app/Contents/Resources/share/octave/3.7.6+/m/pkg/pkg.m at line 394, column 9


c.
Reply | Threaded
Open this post in threaded view
|

Fwd: pkg - post_install.m

Carnë Draug
In reply to this post by Marco Vassallo2
On 11 September 2013 16:33, marco Vassallo <[hidden email]> wrote:

> ----------------------------------------
>> From: [hidden email]
>> Date: Wed, 11 Sep 2013 16:25:22 +0100
>> Subject: Re: pkg - post_install.m
>> To: [hidden email]
>> CC: [hidden email]
>>
>> On 6 September 2013 08:52, marco Vassallo <[hidden email]>
>> wrote:
>> > I have a little problem using pkg.
>> >
>> > After the installation, I need to move a file from the folder where the
>> > DLD-function are installed ("x86_64-unknown-linux-gnu-api-v48+" on my
>> > pc) to
>> > another directory.
>> >
>> > function post_install (desc)
>> >
>> > func = fullfile (desc.dir, "@function");
>> > [status, msg] = mkdir (func);
>> >
>> > [status, msg, msgid] = movefile ('./src/feval.oct', func, 'f');
>> >
>> > endfunction
>>
>> I took a closer look at this and noticed that you're trying to move an
>> oct file (architecture dependent), into a new directory where the .m
>> files are meant to go. We make a distinction between the two. Why are
>> you doing this?
>>
>
> I'm moving an oct file to the @mesh folfder, which I think is the only way
> for implementing polymorphism.

Then what you should be doing is name those functions __mesh_xxx__
(they can all be in the same oct file), and have .m files in the @mesh
folder that only call the __mesh_xxx__ functions. Take a look at how
the ftp class is implemented in octave core [1, 2]. Basically, the
files @ftp/cd.m, @ftp/dir.m, etc, are very simple calls to __ftp_pwd__
and __ftp_dir__ which are all in the urlwrite.oct file.

Carnë

[1] http://hg.savannah.gnu.org/hgweb/octave/file/95bfa04ab514/scripts/%40ftp
[2] http://hg.savannah.gnu.org/hgweb/octave/file/95bfa04ab514/libinterp/dldfcn/urlwrite.cc