All of lore.kernel.org
 help / color / mirror / Atom feed
* 'make distclean' silently removes empty files
@ 2011-07-28 12:54 David Howells
  2011-07-28 14:01 ` Arnaud Lacombe
  2011-08-10 11:16 ` [PATCH] kbuild: Do not delete empty files in make distclean Michal Marek
  0 siblings, 2 replies; 3+ messages in thread
From: David Howells @ 2011-07-28 12:54 UTC (permalink / raw)
  To: Michal Marek; +Cc: dhowells, arnd, linux-kbuild


Hi,

Can 'make distclean' please be altered to _not_ silently remove empty files,
especially ones that are checked into GIT and/or are mentioned in Makefiles as
being compilable.  By all means flag them as requiring removal, remove them
noisily or give an error.

A case in point is:

	arch/arm/mach-zynq/board_dt.c

which is an empty file checked into GIT.

Thanks,
David

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 'make distclean' silently removes empty files
  2011-07-28 12:54 'make distclean' silently removes empty files David Howells
@ 2011-07-28 14:01 ` Arnaud Lacombe
  2011-08-10 11:16 ` [PATCH] kbuild: Do not delete empty files in make distclean Michal Marek
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaud Lacombe @ 2011-07-28 14:01 UTC (permalink / raw)
  To: David Howells; +Cc: Michal Marek, arnd, linux-kbuild

Hi,

On Thu, Jul 28, 2011 at 8:54 AM, David Howells <dhowells@redhat.com> wrote:
>
> Hi,
>
> Can 'make distclean' please be altered to _not_ silently remove empty files,
> especially ones that are checked into GIT and/or are mentioned in Makefiles as
> being compilable.  By all means flag them as requiring removal, remove them
> noisily or give an error.
>
> A case in point is:
>
>        arch/arm/mach-zynq/board_dt.c
>
> which is an empty file checked into GIT.
>
For the record, it is deleted because of the zero size by:

distclean: mrproper
        @find $(srctree) $(RCS_FIND_IGNORE) \
                \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
                -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
                -o -name '.*.rej' -o -size 0 \
                -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \
                -type f -print | xargs rm -f

in the main makefile.

Could you try:

commit a73f6c8638a75d1bf1bb8b0ace82ddd3b9f0291b
Author: Arnaud Lacombe <lacombar@gmail.com>
Date:   Thu Jul 28 10:00:33 2011 -0400

    Makefile: do not delete zero-sized C file

diff --git a/Makefile b/Makefile
index d018956..e9ca6ec 100644
--- a/Makefile
+++ b/Makefile
@@ -1198,7 +1198,7 @@ distclean: mrproper
        @find $(srctree) $(RCS_FIND_IGNORE) \
                \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
                -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-               -o -name '.*.rej' -o -size 0 \
+               -o -name '.*.rej' -o \( -size 0 -a ! -name '*.c' \) \
                -o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \
                -type f -print | xargs rm -f

[space/tab mangled, but the change is obvious]

 - Arnaud

> Thanks,
> David
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] kbuild: Do not delete empty files in make distclean
  2011-07-28 12:54 'make distclean' silently removes empty files David Howells
  2011-07-28 14:01 ` Arnaud Lacombe
@ 2011-08-10 11:16 ` Michal Marek
  1 sibling, 0 replies; 3+ messages in thread
From: Michal Marek @ 2011-08-10 11:16 UTC (permalink / raw)
  To: dhowells; +Cc: arnd, linux-kbuild, lacombar

Commit 3d64b44 introduced an empty file under
arch/arm/mach-zynq/board_dt.c. While this was not intended and the file
was removed from the tree by a later commit, we really should only match
junk files by known name patterns and not their size.

Reported-by: David Howells <dhowells@redhat.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
---
 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index b4ca4e1..d714838 100644
--- a/Makefile
+++ b/Makefile
@@ -1198,7 +1198,7 @@ distclean: mrproper
 	@find $(srctree) $(RCS_FIND_IGNORE) \
 		\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
 		-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
-		-o -name '.*.rej' -o -size 0 \
+		-o -name '.*.rej' \
 		-o -name '*%' -o -name '.*.cmd' -o -name 'core' \) \
 		-type f -print | xargs rm -f
 
-- 
1.7.6


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-08-10 11:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-28 12:54 'make distclean' silently removes empty files David Howells
2011-07-28 14:01 ` Arnaud Lacombe
2011-08-10 11:16 ` [PATCH] kbuild: Do not delete empty files in make distclean Michal Marek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.