Re: :install and :update

Bram Moolenaar <[email protected]>
Newsgroups gmane.comp.tools.aap.user
Message-ID <[email protected]>
Tim Hemel wrote:

> I am using aap to create an OS image. It consists of several
> components, which I gave their own subdir with their own aap recipe. I
> call them from a top recipe as follows:
> 
>         @for d in expand2list(_no.Subdirs):
>                 :print $d
>                 :execute {pass} $d/main.aap install
> 
> One of the subdirs contains a C program, that I let aap compile, using
> :program. However, when I run the top recipe, after succesfully installing
> everything from my subdirs, it gives the following message:
> 
> Aap: Error in recipe "Default target" line 1: :update failed for "mini_httpd"
> 
> Now that is interesting, because I never specified the :update command
> somewhere. It must be implicit then, but the manual is not very clear about
> this (or I must have overlooked something). From the command reference it
> checks whether a program needs to be updated. Exactly what does this do,
> what is the intent and how dows it work?

You must have used "mini_httpd" somewhere.  Perhaps you used the TARGET
variable?  This is still used as the default target.  It's a leftover
from an old version (and is going to be removed some day).

General rule: Uppercase variable names are defined by Aap.  Use
lowercase for your own variables.

> I could perhaps use it for the the rest of my recipe, because
> currently all the programs are still copied to my target directory
> without a check if they were installed before or not. I tried to
> implement this test using something akin to the freebsd ports
> collection, i.e. touching a file .install_done or something, but that
> is not really what I would like. If :update could do this, or of
> someone has a good suggestion on how to do that with aap, please let
> me know.

It depends on how you specify that the files are to be copied.  When
using a dependency it should be handled automatically.  If you have an
"install" target with a list of copy commands it won't work like that.

You could make an "install" target with a list of ":update" commands,
but you probably might as well have "install" list them as sources.

	install:  $root/bin/myprog $root/etc/my.conf

	$root/bin/myprog: myprog
		:copy {f} $source $target
	
	$root/etc/my.conf: my.conf
		:copy {f} $source $target

-- 
From "know your smileys":
 *<|:-)	Santa Claus (Ho Ho Ho)

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///          Creator of Vim - Vi IMproved -- http://www.Vim.org          \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\  Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html  ///


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.