--cvs-exclude for mkfs.jffs2
PATCH 1/2 --cvs-exclude for mkfs.jffs2
This adds an option to ignore CVS directories.
We keep bunch of our system that are hard to recreated easily from source in CVS, and we don't really want to waste space with CVS/Entries, etc.
Man page in following patch.
Signoff: Michael Richardson <[email protected]>
---
util/mkfs.jffs2.c | 28 ++++++++++++++++++++++++++++ 1 files changed, 28 insertions(+), 0 deletions(-)
applies-to: 078d53047fee81aaab9205a659805a07715076e5 092cb3518a5faa486e62a83796a280f3d45e1229
util/mkfs.jffs2.c +28 -0
@@ -69,6 +69,14 @@#undef crc32#include "crc32.h" +#ifndef TRUE +#define TRUE 1 +#endif +#ifndef FALSE +#define FALSE 0 +#endif + +/* Do not use the wierd XPG version of basename */ #undef basename
@@ -101,6 +109,7 @@ static int verbose = 0;static int squash_uids =0 ;static int squash_perms =0 ;static int fake_times =0 ; +static int CVSexclude = FALSE;int target_endian = __BYTE_ORDER;static const char *const app_name ="mkfs.jffs2" ;static const char *const memory_exhausted ="memory exhausted" ;
@@ -391,6 +400,15 @@ static struct filesystem_entry *recursivcontinue ; } +/* ignore the CVS directories */ +if (CVSexclude && + (strcmp (dp->d_name,"CVS" )==0 + ||strcmp (dp->d_name,".KEEP_ME" )==0 + )) { +free (dp); +continue ; + } +asprintf (&hpath,"%s/%s" , hostpath, dp->d_name);if (lstat (hpath, &sb)) {perror_msg_and_die ("%s" , hpath);
@@ -1171,6 +1189,7 @@ static struct option long_options[] = { {"disable-compressor", 1, NULL, 'x'}, {"test-compression", 0, NULL, 't'}, {"compressor-priority", 1, NULL, 'y'}, + {"cvs-exclude", 0, NULL, 'C'}, {"incremental", 1, NULL, 'i'}, {NULL, 0, NULL, 0} };
@@ -1183,6 +1202,7 @@ static char *helptext =" not specified, the output is padded to the end of\n" " the final erase block\n" " -r, -d, --root=DIR Build file system from directory DIR (default: cwd)\n" +" --cvs-exclude Ignore CVS directories, and .KEEP_ME files\n" " -s, --pagesize=SIZE Use page size (max data node size) SIZE (default: 4KiB)\n" " -e, --eraseblock=SIZE Use erase block size SIZE (default: 64KiB)\n" " -c, --eraseblock-header=SIZE Size of eraseblock header (default 28)\n"
@@ -1388,6 +1408,10 @@ int main(int argc, char **argv) rootdir =xstrdup (optarg);break ; +case 'C' : + CVSexclude = TRUE; +break ; +case 's' : page_size =strtol (optarg,NULL ,0 );break ;
@@ -1548,6 +1572,10 @@ int main(int argc, char **argv)if (!(cwd =getcwd (0 ,GETCWD_SIZE )))perror_msg_and_die ("getcwd failed" ); +if (verbose) { +printf ("Initializing image from %s (%s)\n" , rootdir, cwd); + } +if (in_fd !=-1 )parse_image ();
---
0.99.9.GIT
Signature · 4 lines
] ON HUMILITY: to err is human. To moo, bovine. | firewalls [ ] Michael Richardson, Xelerance Corporation, Ottawa, ON |net architect[ ] [email protected] http://www.sandelman.ottawa.on.ca/mcr/ |device driver[ ] panic("Just another Debian GNU/Linux using, kernel hacking, security guy"); [
Quoted 2 lines · In message <[email protected]> you wrote:
This adds an option to ignore CVS directories.
This doesn't make sense to me. You can and should use "cvs export" to create the directory trees you want to package.
You use CVS, others use GIT, or Subversion, or ClearCase, or Monotone, or darcs, or ... - it would not be really practical to add special rules for everybody's favorite tool.
Best regards,
Wolfgang Denk
Signature · 3 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected] You can observe a lot just by watchin'. - Yogi Berra
Quoted 1 line · Wolfgang Denk
In message <[email protected]> you wrote:
[...]
Quoted 4 lines
Quoted 1 line
This adds an option to ignore CVS directories.
This doesn't make sense to me. You can and should use "cvs export" to create the directory trees you want to package.
Or do a find \( -name CVS -o -name .svn \) -print0 | xargs -0r rm -rf before.
Especially the name .KEEP_ME is not even standardized (more .keep IIRC) - not even in the CVS world AFAIK.
Quoted 3 lines
You use CVS, others use GIT, or Subversion, or ClearCase, or Monotone, or darcs, or ... - it would not be really practical to add special rules for everybody's favorite tool.
Ar at least name and implement the option as '--exclude' similar to tar and diff.
Bernd
Signature · 3 lines
Firmix Software GmbH http://www.firmix.at/
mobil: +43 664 4416156 fax: +43 1 7890849-55
Embedded Linux Development and ServicesQuoted 10 lines · Wolfgang Denk
Quoted 2 lines · In message <[email protected]> you wrote:
This adds an option to ignore CVS directories.
This doesn't make sense to me. You can and should use "cvs export" to create the directory trees you want to package.
You use CVS, others use GIT, or Subversion, or ClearCase, or Monotone, or darcs, or ... - it would not be really practical to add special rules for everybody's favorite tool.
More importantly. People may actually want to _keep_ the magical subdirectories.
Write one tool to do one thing and do it well. Applies here as well.
Jörn
Signature · 4 lines
I've never met a human being who would want to read 17,000 pages of documentation, and if there was, I'd kill him to get him out of the gene pool. -- Joseph Costello
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
"Wolfgang" == Wolfgang Denk <[email protected]> writes:
Wolfgang> In message <[email protected]> you wrote:
>> This adds an option to ignore CVS directories.
Wolfgang> This doesn't make sense to me. You can and should use "cvs Wolfgang> export" to create the directory trees you want to package.
yes, one could do that. I chose not to.
It isn't like I forced this option to be on.
cvs export requires that I actually check my changes in before I can test
them, which causes a lot of needless churn.
It may also mean that developers in my team will check in debug statements
and forget to remove them.
Wolfgang> You use CVS, others use GIT, or Subversion, or ClearCase, or Wolfgang> Monotone, or darcs, or ... - it would not be really practical Wolfgang> to add special rules for everybody's favorite tool.
It would very much be practical to do this.
I'd rather have a more general --exclude.
Of course, you argue for removing equivalent options from rsync and other
things. Accept the patch or not.
Signature · 4 lines
] ON HUMILITY: to err is human. To moo, bovine. | firewalls [ ] Michael Richardson, Xelerance Corporation, Ottawa, ON |net architect[ ] [email protected] http://www.sandelman.ottawa.on.ca/mcr/ |device driver[ ] panic("Just another Debian GNU/Linux using, kernel hacking, security guy"); [
Quoted 20 lines · Michael Richardson
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
"Wolfgang" == Wolfgang Denk <[email protected]> writes:
Wolfgang> In message <[email protected]> you wrote:
>> This adds an option to ignore CVS directories.Wolfgang> This doesn't make sense to me. You can and should use "cvs Wolfgang> export" to create the directory trees you want to package.
yes, one could do that. I chose not to.
It isn't like I forced this option to be on.cvs export requires that I actually check my changes in before I can test
them, which causes a lot of needless churn.
It may also mean that developers in my team will check in debug statements
and forget to remove them.Wolfgang> You use CVS, others use GIT, or Subversion, or ClearCase, or Wolfgang> Monotone, or darcs, or ... - it would not be really practical Wolfgang> to add special rules for everybody's favorite tool.
Quoted 5 lines
It would very much be practical to do this.
I'd rather have a more general --exclude.Of course, you argue for removing equivalent options from rsync and other
things. Accept the patch or not.
I believe the answer is "not".
josh
Quoted 21 lines · Josh Boyer
Quoted 20 lines · Michael Richardson
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
"Wolfgang" == Wolfgang Denk <[email protected]> writes:
Wolfgang> In message <[email protected]> you wrote:
>> This adds an option to ignore CVS directories.Wolfgang> This doesn't make sense to me. You can and should use "cvs Wolfgang> export" to create the directory trees you want to package.
yes, one could do that. I chose not to.
It isn't like I forced this option to be on.cvs export requires that I actually check my changes in before I can test
them, which causes a lot of needless churn.
It may also mean that developers in my team will check in debug statements
and forget to remove them.Wolfgang> You use CVS, others use GIT, or Subversion, or ClearCase, or Wolfgang> Monotone, or darcs, or ... - it would not be really practical Wolfgang> to add special rules for everybody's favorite tool.
Quoted 7 lines
Quoted 5 lines
It would very much be practical to do this.
I'd rather have a more general --exclude.Of course, you argue for removing equivalent options from rsync and other
things. Accept the patch or not.I believe the answer is "not".
To clarify, the answer is no because you've hard coded this exclude stuff in the tool itself. Making a more generic --exclude which reads what to exclude from a file might be an option that is acceptable. Then for your specific case you could simply have "CVS" and ".KEEP_ME" listed there.
josh
Quoted 3 lines
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
"Josh" == Josh Boyer <[email protected]> writes:
I believe the answer is "not".
Josh> To clarify, the answer is no because you've hard coded this exclude Josh> stuff in the tool itself. Making a more generic --exclude which Josh> reads what to exclude from a file might be an option that is Josh> acceptable. Then for your specific case you could simply have "CVS" Josh> and ".KEEP_ME" listed there.
Thank you --- I appreciate constructive feedback!
I'm happy to do a proper --exclude. I would have rather done it that way to
begin with, but it was hard to hack up in a moment. I posted because I wanted to clear my queue of patches.
I would propose, like rsync:
--exclude=glob
--exclude-from=FILE
--scm-exclude=FILE
Last one could be set to, for instance:
--scm-exclude=.cvsignore
(and could occur multiple times)
[did my patch to create jffs2cpio make it out?]
Signature · 4 lines
] ON HUMILITY: to err is human. To moo, bovine. | firewalls [ ] Michael Richardson, Xelerance Corporation, Ottawa, ON |net architect[ ] [email protected] http://www.sandelman.ottawa.on.ca/mcr/ |device driver[ ] panic("Just another Debian GNU/Linux using, kernel hacking, security guy"); [
Quoted 7 lines · In message <[email protected]> you wrote:
Wolfgang> You use CVS, others use GIT, or Subversion, or ClearCase, or Wolfgang> Monotone, or darcs, or ... - it would not be really practical Wolfgang> to add special rules for everybody's favorite tool.
It would very much be practical to do this.
I'd rather have a more general --exclude.
Now *this* is something completely different. If you implement generic exclude feature, like the "--exclude=PATTERN" optioon in GNU tar, than this would be really useful.
Just hard-coding a specific directory name is nothing else but a quick and dirty hack and should IMHO not be accepted for public code.
Quoted 2 lines
Of course, you argue for removing equivalent options from rsync and other
things. Accept the patch or not.
Note that "rsync and other things" do not hard-code any specific names.
My vote is clear: this patch should not be accepted as is.
Best regards,
Wolfgang Denk
Signature · 6 lines
Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected] But it's real. And if it's real it can be affected ... we may not be able to break it, but, I'll bet you credits to Navy Beans we can put a dent in it. -- deSalle, "Catspaw", stardate 3018.2