List Info

Thread: adding files to clean




adding files to clean
user name
2007-01-03 13:15:34
this mail bounced the first time, sorry if it ends up
double-posted.

does the solution below seem correct?

thx
dxc

common.Clean doesn't appear to be conditioned on --clean:

actions piecemeal together existing Clean
{
     $(RM) "$(>)"
}

I got a variation of the code I sent earlier (see below) to
work.  with 
this I can say

rm-on-clean *~ relative/path/blah.txt name.txt ;  # etc

and it seems to work, including files and directories with
whitespace in 
them.  if you insist, you can give a file like
"x\y.txt" on linux, and 
it seems to correctly get flipped, so I assume the opposite
would happen 
with unix-style paths on windows.  I don't have a windows
box though, so 
I'm not sure about that.

the major problem I had was getting it to work in
subdirectory Jamfiles. 
  does the code look right?  it seems to work, but it seems
awfully 
complicated to do something simple.  the idea is to flip the
'/' or '\' 
first, then build the full path to the (possible) pattern,
then glob, 
then delete the files.

it won't delete things over in the install directories
because these are 
not generated files, but I don't care about that since I
will typically 
just wipe them from the top.


----snip----
  rule rm-on-clean ( files * )
{
     if "$(files)"
     {
         local argv = [ modules.peek : ARGV ] ;

         if "clean" in $(argv) ||
"--clean" in $(argv)
         {
             local cmd ;

             if [ os.on-windows ]
             {
                 cmd = "del /f /q" ;
             }
             else
             {
                 cmd = "rm -f" ;
             }

             local native_names ;

             # flip the leaning toothpicks before expansion

             for local name in $(files)
             {
                 local normalized = [ path.make $(name) ] ;
                 native_names += [ path.native $(normalized)
] ;
             }

             local caller  = [ utility.caller-file ] ;
             local dirname = [ path.parent $(caller) ] ;

             for local name in $(native_names)
             {
                 local del_list = [ path.glob $(dirname) :
$(name) ] ;

                 for local file in $(del_list)
                 {
                     if [ path.exists $(file) ]
                     {
                         ECHO "$(cmd) $(file)" ;
                         SHELL "$(cmd)
"$(file)"" ;
                     }
                 }
             }
         }
     }
}
----snip----
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
adding files to clean
user name
2007-01-06 11:31:08
On Wednesday 03 January 2007 16:15, david x callaway wrote:
> this mail bounced the first time, sorry if it ends up
double-posted.
> 
> does the solution below seem correct?

>          if "clean" in $(argv) ||
"--clean" in $(argv)

Well, it does not handle --clean-all. I'll try to put up a
better version now.

- Volodya


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build
Re: adding files to clean
user name
2007-01-11 02:36:30
Pada hari Kamis, tanggal 11/01/2007 pukul 08:57 +0200, ext
maemo-developers-bouncesmaemo.org menulis:
> Hi,
> 
> This won't work - run-standalone.sh reads
/etc/osso-af-init/locale and
> sets the language according to it. 

Also you need ja locale. 
You can grab it from Locale Extras project[0] in garage.

[0].
htt
ps://garage.maemo.org/projects/locales-extras/
_______________________________________________
maemo-developers mailing list
maemo-developersmaemo.org
h
ttps://maemo.org/mailman/listinfo/maemo-developers

Re: adding files to clean
user name
2007-01-11 02:36:30
[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )