Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Customize package not copy .svn .git etc?
@ 2012-02-07 16:45 Grant Edwards
  2012-02-07 17:08 ` Luca Ceresoli
  2012-02-07 17:12 ` Grant Edwards
  0 siblings, 2 replies; 5+ messages in thread
From: Grant Edwards @ 2012-02-07 16:45 UTC (permalink / raw)
  To: buildroot

Do other users of the customize package not use svn, git, CVS, etc?

I build from a subversion working copy, and customize.mk is copying
all of the .svn directories to the target.  I'm looking at
customize.mk, to leave out things like .svn and .git directories and
I'm a bit confused.  Here's what it looks like now:

CUST_DIR:=package/customize/source

$(BUILD_DIR)/.customize:
        rm -f $(BUILD_DIR)/series
        (cd $(CUST_DIR); \
        /bin/ls -d * > $(BUILD_DIR)/series || \
        touch $(BUILD_DIR)/series )
        for f in cat $(BUILD_DIR)/series; do \
               cp -af $(CUST_DIR)/$$f $(TARGET_DIR); \
        done
        rm -f $(BUILD_DIR)/series
        touch $@

I don't really understand the purpose of the "cd" command and the
"series" file.  Isn't this the same thing?

$(BUILD_DIR)/.customize:
        for f in $$(ls -d $(CUST_DIR)/*); do cp -af $$f $(TARGET_DIR); done
        touch $@

-- 
Grant Edwards               grant.b.edwards        Yow! ... this must be what
                                  at               it's like to be a COLLEGE
                              gmail.com            GRADUATE!!

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

* [Buildroot] Customize package not copy .svn .git etc?
  2012-02-07 16:45 [Buildroot] Customize package not copy .svn .git etc? Grant Edwards
@ 2012-02-07 17:08 ` Luca Ceresoli
  2012-02-07 17:54   ` Grant Edwards
  2012-02-07 17:12 ` Grant Edwards
  1 sibling, 1 reply; 5+ messages in thread
From: Luca Ceresoli @ 2012-02-07 17:08 UTC (permalink / raw)
  To: buildroot

Hi Grant,

Grant Edwards wrote:
> Do other users of the customize package not use svn, git, CVS, etc?

During the Buildroot Developers Day last Friday we agreed that the
customize package is not well-written and not satisfactory, thus it will
be deprecated in 2012.02 and removed in a following release.

A much better method to obtain the same result is to put your board
specific files in board/<company>/<project>/rootfs-additions/, and write
a command in the post-build script to copy these files onto the target
root filesystem.

For more details, see http://free-electrons.com/blog/elce-2011-videos/,
search for "Using Buildroot For a Real Project". There's a video of
Thomas Petazzoni with many best practices for using Buildroot.
My above suggestion comes from slide 24 of his presentation. Thanks
Thomas.

Ah, actually this won't solve your problem with some version control
systems such as Subversion < 1.7 or CVS which create hidden directories
for their metadata.
To solve this problem you should, in my personal order of preference:
- use git, which creates only one hidden dir in the project root, or
- upgrade to Subversion >= 1.7, which created only one dir as git
   does, or
- write your post-build script so that it bypasses .svn and CVS dirs,
   for example using the find command.

Luca

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

* [Buildroot] Customize package not copy .svn .git etc?
  2012-02-07 16:45 [Buildroot] Customize package not copy .svn .git etc? Grant Edwards
  2012-02-07 17:08 ` Luca Ceresoli
@ 2012-02-07 17:12 ` Grant Edwards
  2012-02-07 19:53   ` Arnout Vandecappelle
  1 sibling, 1 reply; 5+ messages in thread
From: Grant Edwards @ 2012-02-07 17:12 UTC (permalink / raw)
  To: buildroot

On 2012-02-07, Grant Edwards <grant.b.edwards@gmail.com> wrote:

>[...]
>
> I don't really understand the purpose of the "cd" command and the
> "series" file.  Isn't this the same thing?
>
> $(BUILD_DIR)/.customize:
>         for f in $$(ls -d $(CUST_DIR)/*); do cp -af $$f $(TARGET_DIR); done
>         touch $@

Or, now that I think about it, how about the even simpler:

$(BUILD_DIR)/.customize:
        cp -af $$(ls -d $(CUST_DIR)/*) $(TARGET_DIR)
        touch $@

The only difference is that the last one will produce an error and the
build will fail if $CUST_DIR is empty -- which wouldn't bother me at
all, but maybe there are others who enable the customize package but
don't give it any files to copy.

One option is to delete the unwanted files after the copy:

$(BUILD_DIR)/.customize:
        cp -af $$(ls -d $(CUST_DIR)/*) $(TARGET_DIR)
        rm -rf $$(find $(TARGET_DIR) -type d -name .svn)
        touch $@

The other obvious choice would be to use tar:

$(BUILD_DIR)/.customize:
        tar -c -f - -C $(CUST_DIR) --exclude-vcs --exclude-backup . | tar -x -f - -C $(TARGET_DIR)
        touch $@

I'd be happy to submit a patch containing the latter if everybody
agrees that they don't want vcs files, backup files, and lockfiles
copied.  It is specific to gnu tar -- I assume that's not a problem?

-- 
Grant Edwards               grant.b.edwards        Yow! The PILLSBURY DOUGHBOY
                                  at               is CRYING for an END to
                              gmail.com            BURT REYNOLDS movies!!

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

* [Buildroot] Customize package not copy .svn .git etc?
  2012-02-07 17:08 ` Luca Ceresoli
@ 2012-02-07 17:54   ` Grant Edwards
  0 siblings, 0 replies; 5+ messages in thread
From: Grant Edwards @ 2012-02-07 17:54 UTC (permalink / raw)
  To: buildroot

On 2012-02-07, Luca Ceresoli <luca@lucaceresoli.net> wrote:

> Grant Edwards wrote:
>> Do other users of the customize package not use svn, git, CVS, etc?
>
> During the Buildroot Developers Day last Friday we agreed that the
> customize package is not well-written and not satisfactory, thus it
> will be deprecated in 2012.02 and removed in a following release.

I guess I won't submit a patch for it then. :)

> A much better method to obtain the same result is to put your board
> specific files in board/<company>/<project>/rootfs-additions/, and
> write a command in the post-build script to copy these files onto the
> target root filesystem.

I'll put that on the list of things to do.

> Ah, actually this won't solve your problem with some version control
> systems such as Subversion < 1.7 or CVS which create hidden
> directories for their metadata. To solve this problem you should, in
> my personal order of preference:
>
> - use git, which creates only one hidden dir in the project root, or

Not an option.  We've spent the last several years moving from VSS to
SVN (and we're not finished yet).  Suggesting we now switch to git
would be futile (though I personally would like git just fine handling
branches in svn is clumsy compared to git).  The last time I checked
git wasn't well supported on Windows, and we have some windows
projects to worry about.

> - upgrade to Subversion >= 1.7, which created only one dir as git
>   does, or

That will happen eventually...

> - write your post-build script so that it bypasses .svn and CVS dirs,
>   for example using the find command.

That's probably "the right thing".

Thanks for the warning about customize going away.

-- 
Grant Edwards               grant.b.edwards        Yow! Now KEN and BARBIE
                                  at               are PERMANENTLY ADDICTED to
                              gmail.com            MIND-ALTERING DRUGS ...

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

* [Buildroot] Customize package not copy .svn .git etc?
  2012-02-07 17:12 ` Grant Edwards
@ 2012-02-07 19:53   ` Arnout Vandecappelle
  0 siblings, 0 replies; 5+ messages in thread
From: Arnout Vandecappelle @ 2012-02-07 19:53 UTC (permalink / raw)
  To: buildroot

On Tuesday 07 February 2012 18:12:17 Grant Edwards wrote:
> The other obvious choice would be to use tar:
> 
> $(BUILD_DIR)/.customize:
>         tar -c -f - -C $(CUST_DIR) --exclude-vcs --exclude-backup . | tar -x -f - -C $(TARGET_DIR)
>         touch $@
> 
> I'd be happy to submit a patch containing the latter if everybody
> agrees that they don't want vcs files, backup files, and lockfiles
> copied.  It is specific to gnu tar -- I assume that's not a problem?

 The tar way is indeed a good idea.  And if you use $(TAR) instead of
plain tar, it's guaranteed to be gnu tar.

 As Luca mentioned, customize will be deprecated in favour of the 
rootfs-additions approach.  We'll add this to the target/generic/Config.in
and target-finalize.  If you'd like to prepare a patch for that, you're
more than welcome!

 Regards,
 Arnout

-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
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:[~2012-02-07 19:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-07 16:45 [Buildroot] Customize package not copy .svn .git etc? Grant Edwards
2012-02-07 17:08 ` Luca Ceresoli
2012-02-07 17:54   ` Grant Edwards
2012-02-07 17:12 ` Grant Edwards
2012-02-07 19:53   ` Arnout Vandecappelle

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