Re: :action depend for D

Bram Moolenaar <[email protected]>
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
Lars Ivar Igesund wrote:

> > I'm sometimes using my notebook on a plane...
> 
> Well, they should get internet in the planes then :)

I tried, but couldn't get the cable through the security check. :-)

> > Please look at the current version in CVS and suggest how ddepcheck.d
> > can be added and compiled when necessary.  I think it needs to go into
> > the "tools" directory.
> 
> Ok, attached is the newest version of ddepcheck to be put into the tools
> dir.

I notice you use Global.aap_toolsdir.  That didn't exist yet!  I'll add
it to Global.py.  To be consistent I'll also add aap_modulesdir.

> Also attached is the patch for d.aap that builds ddepcheck in case it
> couldn't be downloaded. Possibly it looks a bit hairy, but it works.
> 
> Also, for the bootscript, could you add the files
> ddepcheck$OBJSUF and ddepcheck.map to the files to be deleted
> afterwards? (see the d.aap patch for what I mean.)

Apparently the compiler produces these files without asking.  It's OK to
delete them.  Just make sure the compiler won't overwrite something.

To make sure failure in compiling the program is detected, I suggest
using this:

	# If not downloaded, build it from local copy.
	:progsearch _top.DDEPCHECK ddepcheck

	@if not _top.DDEPCHECK:
	    bindir = "`Global.aap_bindir`"
	    toolsdir = "`Global.aap_toolsdir`"
	    :mkdir {force} $bindir
	    :print ddepcheck not found, building from: $toolsdir/ddepcheck.d
	    :progsearch dc dmd
	    :sys $dc -O -of$bindir`os.sep`ddepcheck$EXESUF $toolsdir`os.sep`ddepcheck.d
	    :del {q} ddepcheck$OBJSUF ddepcheck.map 
	    :progsearch _top.DDEPCHECK ddepcheck
	    @if not _top.DDEPCHECK:
		:error Building ddepcheck failed or the program cannot be found.

Now, there is one remaining problem: Aap may be installed on the system
and the directories are not writable by a normal user.  The best
solution I can think of is to offer the user a choice:

	- become root and install ddepcheck globally (using :asroot)
	- install for the current user only (in $HOME/bin)
	- quit


BTW: Is there a Vim syntax highlighting file for the D language?

-- 
Mynd you, m00se bites Kan be pretty nasti ...
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// 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: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
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.