[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Patch #41] Do all rm's in one command with --mode=clean

From: Robert Boehne
Subject: Re: [Patch #41] Do all rm's in one command with --mode=clean
Date: Thu, 25 Oct 2001 14:43:23 -0500

Jeff Dubrule wrote:
> On Wed, Oct 24, 2001 at 09:21:48AM -0500, Robert Boehne wrote:
> >
> > Libtool saves a good guess for the maximum length
> > of command lines as max_cmd_len so if you wanted to
> > support removing files up to an average of 99 characters
> > you could divide max_cmd_len by 100 to get the number
> > of files to delete at a time.
> Ah...  This is new (i.e. later than the version I was patching, 1.4.2)
> > Hope that helps,
> Ayup.  I submitted a new patch to savannah.


This is closer, but the max_cmd_len isn't 1/4, it is 3/4.
If you get too close to the limit you could occasionally pass
expr an argument list that was greater than the system would
allow.  If that happens with this code it will be treated
as if the command was short enough to execute (rm'ing nothing).
Two fixes would be to make sure expr succeeds (same as when
doing piecewise shared object linking) or you could just
test against some fraction of max_cmd_len (1/2 or 1/4) just
to make sure you don't run over the limit very often.

+      # $max_cmd_len is actually 1/4 of the max command length, 
+      # so if we go a little over, it's OK...
+      if test `expr "X$rmfiles" : ".*"` -gt $max_cmd_len; then
+        $show "$rm $rmfiles"
+        $run $rm $rmfiles || exit_status=1
+       rmfiles=
+      fi
+    done

Are you having fun yet?  These little details really dealt
me fits when I wrote the piecewise linking code.  One more try
should get it.

Keep up the good work,


Robert Boehne             Software Engineer
Ricardo Software   Chicago Technical Center
TEL: (630)789-0003 x. 238
FAX: (630)789-0127
email:  address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]