Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [git commit] Makefile: simplify target skeleton copying
@ 2013-03-26  7:33 Peter Korsgaard
  2013-03-28  7:15 ` Arnout Vandecappelle
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Korsgaard @ 2013-03-26  7:33 UTC (permalink / raw)
  To: buildroot

commit: http://git.buildroot.net/buildroot/commit/?id=13c07c79a401a8821b3224bc00c60c097f011add
branch: http://git.buildroot.net/buildroot/commit/?id=refs/heads/master

We already use the .root stamp file to remember if we have copied the
skeleton, so we can remove the /bin check.

Likewise, we should always have a TARGET_SKELETON (or explicitly error
out otherwise), so remove that check as well.

Finally, now that we're using rsync to do the copy, we might as well
use its exclude support instead of cleaning up unwanted files afterwards.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
---
 Makefile |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index 62311ed..c95bb1e 100644
--- a/Makefile
+++ b/Makefile
@@ -429,14 +429,9 @@ endif
 
 $(BUILD_DIR)/.root:
 	mkdir -p $(TARGET_DIR)
-	if ! [ -d "$(TARGET_DIR)/bin" ]; then \
-		if [ -d "$(TARGET_SKELETON)" ]; then \
-			rsync -au $(TARGET_SKELETON)/ $(TARGET_DIR)/; \
-		fi; \
-	fi
+	rsync -au --exclude=.empty --exclude=CVS --exclude=.svn --exclude='*~' \
+		$(TARGET_SKELETON)/ $(TARGET_DIR)/
 	cp support/misc/target-dir-warning.txt $(TARGET_DIR_WARNING_FILE)
-	-find $(TARGET_DIR) -type d -name CVS -print0 -o -name .svn -print0 | xargs -0 rm -rf
-	-find $(TARGET_DIR) -type f \( -name .empty -o -name '*~' \) -print0 | xargs -0 rm -rf
 	touch $@
 
 $(TARGET_DIR): $(BUILD_DIR)/.root

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

* [Buildroot] [git commit] Makefile: simplify target skeleton copying
  2013-03-26  7:33 [Buildroot] [git commit] Makefile: simplify target skeleton copying Peter Korsgaard
@ 2013-03-28  7:15 ` Arnout Vandecappelle
  2013-03-28  8:07   ` Peter Korsgaard
  0 siblings, 1 reply; 5+ messages in thread
From: Arnout Vandecappelle @ 2013-03-28  7:15 UTC (permalink / raw)
  To: buildroot

On 26/03/13 08:33, Peter Korsgaard wrote:
> +	rsync -au --exclude=.empty --exclude=CVS --exclude=.svn --exclude='*~' \
> +		$(TARGET_SKELETON)/ $(TARGET_DIR)/

  Since TARGET_SKELETON can be configured to point to a git- or 
mercurial-controlled directory, I'd want to exclude those as well. How 
about the --cvs-exclude --include core that ThomasDS introduced?

  Regards,
  Arnout

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

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

* [Buildroot] [git commit] Makefile: simplify target skeleton copying
  2013-03-28  7:15 ` Arnout Vandecappelle
@ 2013-03-28  8:07   ` Peter Korsgaard
  2013-03-28  8:13     ` Thomas De Schampheleire
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Korsgaard @ 2013-03-28  8:07 UTC (permalink / raw)
  To: buildroot

>>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:

 Arnout> On 26/03/13 08:33, Peter Korsgaard wrote:
 >> +	rsync -au --exclude=.empty --exclude=CVS --exclude=.svn --exclude='*~' \
 >> +		$(TARGET_SKELETON)/ $(TARGET_DIR)/

 Arnout>  Since TARGET_SKELETON can be configured to point to a git- or
 Arnout> mercurial-controlled directory, I'd want to exclude those as well. How
 Arnout> about the --cvs-exclude --include core that ThomasDS introduced?

We can do that as well. I was a bit afraid of excluding files people
wanted to keep, so I kept it how it was - But yes, like likelyhood is
quite small.

Care to send a patch to do this?

-- 
Bye, Peter Korsgaard

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

* [Buildroot] [git commit] Makefile: simplify target skeleton copying
  2013-03-28  8:07   ` Peter Korsgaard
@ 2013-03-28  8:13     ` Thomas De Schampheleire
  2013-03-28  8:20       ` Arnout Vandecappelle
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas De Schampheleire @ 2013-03-28  8:13 UTC (permalink / raw)
  To: buildroot

Hi,


On Thu, Mar 28, 2013 at 9:07 AM, Peter Korsgaard <jacmet@sunsite.dk> wrote:

> >>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be> writes:
>
>  Arnout> On 26/03/13 08:33, Peter Korsgaard wrote:
>  >> +   rsync -au --exclude=.empty --exclude=CVS --exclude=.svn
> --exclude='*~' \
>  >> +           $(TARGET_SKELETON)/ $(TARGET_DIR)/
>
>  Arnout>  Since TARGET_SKELETON can be configured to point to a git- or
>  Arnout> mercurial-controlled directory, I'd want to exclude those as
> well. How
>  Arnout> about the --cvs-exclude --include core that ThomasDS introduced?
>
> We can do that as well. I was a bit afraid of excluding files people
> wanted to keep, so I kept it how it was - But yes, like likelyhood is
> quite small.
>
> Care to send a patch to do this?
>

Is this really needed?
I was thinking about this as well, but later had the following reasoning
(which could be wrong): for svn, if I recall correctly, there is a .svn in
each subdirectory. This is not the case for .git or .hg (which only exist
in the root of the repository). If one can assume that no-one puts the
skeleton in a repository, the exclusion of .svn is enough.

Moreover, the --cvs-exclude option cannot be used in this case, as it also
removes object files. In my version of rsync, this is the exclusion list
used by --cvs-exclude:

RCS SCCS CVS CVS.adm RCSLOG cvslog.* tags TAGS .make.state .nse_depinfo *~
#* .#* ,* _$* *$ *.old *.bak *.BAK *.orig *.rej .del-* *.a *.olb *.o *.obj
*.so *.exe *.Z *.elc *.ln core .svn/ .git/ .hg/ .bzr/

Best regards,
Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20130328/6750a2f0/attachment.html>

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

* [Buildroot] [git commit] Makefile: simplify target skeleton copying
  2013-03-28  8:13     ` Thomas De Schampheleire
@ 2013-03-28  8:20       ` Arnout Vandecappelle
  0 siblings, 0 replies; 5+ messages in thread
From: Arnout Vandecappelle @ 2013-03-28  8:20 UTC (permalink / raw)
  To: buildroot

On 28/03/13 09:13, Thomas De Schampheleire wrote:
> Hi,
>
>
> On Thu, Mar 28, 2013 at 9:07 AM, Peter Korsgaard <jacmet@sunsite.dk
> <mailto:jacmet@sunsite.dk>> wrote:
>
>      >>>>> "Arnout" == Arnout Vandecappelle <arnout@mind.be
>     <mailto:arnout@mind.be>> writes:
>
>       Arnout> On 26/03/13 08:33, Peter Korsgaard wrote:
>       >> +   rsync -au --exclude=.empty --exclude=CVS --exclude=.svn
>     --exclude='*~' \
>       >> +           $(TARGET_SKELETON)/ $(TARGET_DIR)/
>
>       Arnout>  Since TARGET_SKELETON can be configured to point to a git- or
>       Arnout> mercurial-controlled directory, I'd want to exclude those
>     as well. How
>       Arnout> about the --cvs-exclude --include core that ThomasDS
>     introduced?
>
>     We can do that as well. I was a bit afraid of excluding files people
>     wanted to keep, so I kept it how it was - But yes, like likelyhood is
>     quite small.
>
>     Care to send a patch to do this?


  Yes, I care to send a patch, but if you look at my track record for 
submitting infrastructural patches in the last couple of months, don't 
hold your breath.



> Is this really needed?
> I was thinking about this as well, but later had the following reasoning
> (which could be wrong): for svn, if I recall correctly, there is a .svn
> in each subdirectory. This is not the case for .git or .hg (which only
> exist in the root of the repository). If one can assume that no-one puts
> the skeleton in a repository, the exclusion of .svn is enough.

  I had one customer who put their overlay in a separate repository. (OK 
in that particular case it was a subversion repository, but it _could_ 
have been a git/hg repository as well).


> Moreover, the --cvs-exclude option cannot be used in this case, as it
> also removes object files. In my version of rsync, this is the exclusion
> list used by --cvs-exclude:
>
> RCS SCCS CVS CVS.adm RCSLOG cvslog.* tags TAGS .make.state .nse_depinfo
> *~ #* .#* ,* _$* *$ *.old *.bak *.BAK *.orig *.rej .del-* *.a *.olb *.o
> *.obj *.so *.exe *.Z *.elc *.ln core .svn/ .git/ .hg/ .bzr/

  Ouch, that sucks.

  How about:

- Create an rsync-filter file in the support directory;

- Create an RSYNC variable that has the option to use that file;

- Use the RSYNC variable everywhere instead of rsync;

- Document this;

- (optionally) add a Kconfig option to specify additional rsync filters.


  Regards,
  Arnout
-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

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

end of thread, other threads:[~2013-03-28  8:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-26  7:33 [Buildroot] [git commit] Makefile: simplify target skeleton copying Peter Korsgaard
2013-03-28  7:15 ` Arnout Vandecappelle
2013-03-28  8:07   ` Peter Korsgaard
2013-03-28  8:13     ` Thomas De Schampheleire
2013-03-28  8:20       ` Arnout Vandecappelle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox