cvs commit: src Makefile.inc1

Dag-Erling Smørgrav des at des.no
Mon May 14 14:44:21 UTC 2007


Alexander Leidinger <Alexander at Leidinger.net> writes:
> Dag-Erling Smorgrav <des at FreeBSD.org> writes:
> >   Log:
> >   Greatly speed up {check,delete}-old* by replacing make loops with sh loops.
> How much faster?

A *lot* faster.  Makefile loops are extremely slow.  The speedup was so
great that I didn't even bother measuring it.

> Some review:
>
> Why did you remove the echo?

which echo?  about schg?  it was completely bogus.

feel free to re-add it, but only if you also add logic to check whether
the file actually has the schg flag set before running chflags.

> Why do you redirect stderr of chflags to /dev/null?

because chflags will complain if your /usr is on a file system which
does not support flags, such as NFS or ZFS.

> Why did you change the removal logic?

because it was broken; it would always ask twice about files which you
chose not to delete.

> The way it was before:
>  - rm (without -i if requested)
>  - if rm fails do a chflags and rm again (bug: if user says no in the
> interactive mode, the chlags is done regardless)
>  - tell the user about the stuff we do (removing flags)
>  - it aborts on a failure of the second rm (AFAIR)
>
> The way it is now:
>  - for every file do a chflags without notifying the user, don't tell
> about problems
>  - rm (without -i if requested)
>  - bug(?): ${DESTDIR} in the rm line

no, this is intentional, and in fact the original code had it too.

>  - doesn't abort on rm failure

that was not intentional...  I forgot to remove the || true.

>  - has the same bug that it chflags even if the user doesn't want to
> rm the file

yes, but at least it doesn't ask twice.

DES
-- 
Dag-Erling Smørgrav - des at des.no


More information about the cvs-src mailing list