Customize package not copy .svn .git etc?
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 $@Signature · 3 lines
Grant Edwards grant.b.edwards Yow! ... this must be what
at it's like to be a COLLEGE
gmail.com GRADUATE!!Hi Grant,
Quoted 1 line · Grant Edwards
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
Quoted 6 lines · Luca Ceresoli
Quoted 1 line · Grant Edwards
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. :)
Quoted 4 lines
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.
Quoted 6 lines
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.
Quoted 2 lines
- upgrade to Subversion >= 1.7, which created only one dir as git does, or
That will happen eventually...
Quoted 2 lines
- 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.
Signature · 3 lines
Grant Edwards grant.b.edwards Yow! Now KEN and BARBIE
at are PERMANENTLY ADDICTED to
gmail.com MIND-ALTERING DRUGS ...Quoted 8 lines · Grant Edwards
[...]
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?
Signature · 3 lines
Grant Edwards grant.b.edwards Yow! The PILLSBURY DOUGHBOY
at is CRYING for an END to
gmail.com BURT REYNOLDS movies!!Quoted 9 lines · 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
Signature · 6 lines
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