Barrie Stott | 1 Jul 2003 18:37
Picon

Use of clean with directories

A simple question. I am happy with Clean for getting rid of files but
don't know how to get rid of directories. Can someone help, please?

Barrie.

Matt Armstrong | 1 Jul 2003 19:24

Re: Use of clean with directories

Barrie Stott wrote:

>A simple question. I am happy with Clean for getting rid of files but
>don't know how to get rid of directories. Can someone help, please?
>
There is no built-in rule for deleting directories.  That is something you have to create yourself.  I don't
personally have a thought-out example.

Diane Holt | 1 Jul 2003 19:56
Picon
Favicon

Re: Use of clean with directories

I'm wondering why you'd bother -- if you want the whole thing gone,
'rm -rf *' would do the job easier.

Diane

--- Matt Armstrong <matt <at> lickey.com> wrote:
> Barrie Stott wrote:
> 
> >A simple question. I am happy with Clean for getting rid of files but
> >don't know how to get rid of directories. Can someone help, please?
> >
> There is no built-in rule for deleting directories.  That is something
> you have to create yourself.  I don't personally have a thought-out
> example.
> 
> 
> _______________________________________________
> jamming mailing list  -  jamming <at> perforce.com
> http://maillist.perforce.com/mailman/listinfo/jamming

=====
(holtdl <at> yahoo.com)

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

Hoff, Todd | 1 Jul 2003 21:49

ideas on getting data and time in jamrules?

Is there a good way to get current date and time
in jamrules (windoze platform)? I've looked around
for a solution but have not found one.

The time stamp would be redirected to a source file
so it can be displayed as part of the build information.

thanx

Barrie Stott | 2 Jul 2003 15:29
Picon

Re: Use of clean with directories

Many thanks to those who replied. With some reluctance, I had
temporarily overridden the definition of RM as `rm -f' in Jambase to
`rm -rf' in my Jamfile; perhaps I would have been happier if I had had
the sense not to remove each file in a to-be-cleaned directory as well
as the directory itself. I was particularly pleased with the more
rounded solution posted by Eric Sunshine. It just has a feeling of
rightness about it.

No reply needed.

Barrie.

Eric Sunshine | 7 Jul 2003 09:58
Favicon

Re: Use of clean with directories

Barrie Stott wrote:
> A simple question. I am happy with Clean for getting rid of files but
> don't know how to get rid of directories. Can someone help, please?

For the Crystal Space project (http://crystal.sf.net/), I handled this issue
by creating a CleanDir rule which parallels the existing Clean rule.  The
code looks like this:

------ >8 cut here 8< ------
DELTREE ?= "rm -rf" ;

# CleanDir <tag> : <dir> ...
#   Forcibly delete a set of directories, even if they are not empty.
#   Tag is one of the standard targets used with the "Clean" rule, such as
#   "clean" or "distclean".
rule CleanDir
{
  Always $(<) ;
  NotFile $(<) ;
  NoCare $(>) ;
}

actions piecemeal together existing CleanDir
{
  $(DELTREE) $(>)
}
------ >8 cut here 8< ------

You use the CleanDir rule just like you would use Clean.  For example:

(Continue reading)

Hoff, Todd | 14 Jul 2003 23:01

jamdate and spaces

$(JAMDATE) worked as the time stamp, thanx, but i must also pass
in a time stamp from the build system if it is built from the build system.

The jam date time stamp looks like:
"Mon Jul 14 13:52:32 2003"

My time stamp looks like:

Hoff, Todd | 14 Jul 2003 23:14

RE: jamdate and spaces

Sorry, my fat fingers sent the email early...

$(JAMDATE) worked as the time stamp, thanx, but i must also pass
in a time stamp from the build system if it is built from the 
build system.

The jam date time stamp looks like:
 "Mon Jul 14 13:52:32 2003"

My time stamp looks like:
   2003-07 14:11:0:7

When i use it to generate a build info file it looks like:
 static char* pBuild_time = "2003-07"; "14:11:0:7";   

Jam is treating it like a list because of a space i guess. There
was some email in the archive about this, but i never saw a resolution.
Is there a way to treat it like a scalar?

In the jamdate string has a bunch of spaces in it, yet it doesn't get
treated like a list. Does jam know a variable was assigned from jam date
and then treats it like a scalar?

thanx

Harri Porten | 15 Jul 2003 00:28
Picon
Favicon

Re: RE: jamdate and spaces

"Hoff, Todd" wrote:
> 
> My time stamp looks like:
>    2003-07 14:11:0:7
> 
> When i use it to generate a build info file it looks like:
>  static char* pBuild_time = "2003-07"; "14:11:0:7";
> 
> Jam is treating it like a list because of a space i guess. There
> was some email in the archive about this, but i never saw a resolution.
> Is there a way to treat it like a scalar?

Surround the value by double quotes, e.g. "2003-07 14:11:0:7". This way
it won't be split.

Harri.

Vladimir Prus | 24 Jul 2003 15:03
Picon
Favicon

TEMPORARY bug?

Hello,
suppose I have the following Jamfile:

   DEPENDS all : a ;
   DEPENDS a : b ;
   DEPENDS b : c ;

   TEMPORARY b ;

    actions copy
    {
       cp $(>) $(<)
    }

    copy a : b ;
    copy b : c ;

If "c" initially exists, and I run "jam -fJamfile", everything's OK. But on 
all other invocations, jam recreates "a" over and over. Is this a bug?

This reproduces on a freshly "p4 sync"-ed sources from public depot.

- Volodya


Gmane