* [PATCH 1/2] --cvs-exclude for mkfs.jffs2
@ 2005-11-29 2:26 Michael Richardson
2005-11-29 10:09 ` Wolfgang Denk
0 siblings, 1 reply; 9+ messages in thread
From: Michael Richardson @ 2005-11-29 2:26 UTC (permalink / raw)
To: linux-mtd
[-- Attachment #1: Type: text/plain, Size: 3218 bytes --]
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 <mcr@sandelman.ca>
---
util/mkfs.jffs2.c | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
applies-to: 078d53047fee81aaab9205a659805a07715076e5
092cb3518a5faa486e62a83796a280f3d45e1229
diff --git a/util/mkfs.jffs2.c b/util/mkfs.jffs2.c
index 7e60a3f..fe0cc63 100644
--- a/util/mkfs.jffs2.c
+++ b/util/mkfs.jffs2.c
@@ -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 *recursiv
continue;
}
+ /* 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
--
] ON HUMILITY: to err is human. To moo, bovine. | firewalls [
] Michael Richardson, Xelerance Corporation, Ottawa, ON |net architect[
] mcr@xelerance.com http://www.sandelman.ottawa.on.ca/mcr/ |device driver[
] panic("Just another Debian GNU/Linux using, kernel hacking, security guy"); [
[-- Attachment #2: Type: application/pgp-signature, Size: 480 bytes --]
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] --cvs-exclude for mkfs.jffs2
2005-11-29 2:26 [PATCH 1/2] --cvs-exclude for mkfs.jffs2 Michael Richardson
@ 2005-11-29 10:09 ` Wolfgang Denk
2005-11-29 10:41 ` Bernd Petrovitsch
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Wolfgang Denk @ 2005-11-29 10:09 UTC (permalink / raw)
To: Michael Richardson; +Cc: linux-mtd
In message <v0mzjofaup.fsf@marajade.sandelman.ca> 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
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
You can observe a lot just by watchin'. - Yogi Berra
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] --cvs-exclude for mkfs.jffs2
2005-11-29 10:09 ` Wolfgang Denk
@ 2005-11-29 10:41 ` Bernd Petrovitsch
2005-11-29 14:08 ` Jörn Engel
2005-11-29 15:18 ` Michael Richardson
2 siblings, 0 replies; 9+ messages in thread
From: Bernd Petrovitsch @ 2005-11-29 10:41 UTC (permalink / raw)
To: Michael Richardson; +Cc: linux-mtd
On Tue, 2005-11-29 at 11:09 +0100, Wolfgang Denk wrote:
> In message <v0mzjofaup.fsf@marajade.sandelman.ca> 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.
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.
> 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
--
Firmix Software GmbH http://www.firmix.at/
mobil: +43 664 4416156 fax: +43 1 7890849-55
Embedded Linux Development and Services
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] --cvs-exclude for mkfs.jffs2
2005-11-29 10:09 ` Wolfgang Denk
2005-11-29 10:41 ` Bernd Petrovitsch
@ 2005-11-29 14:08 ` Jörn Engel
2005-11-29 15:18 ` Michael Richardson
2 siblings, 0 replies; 9+ messages in thread
From: Jörn Engel @ 2005-11-29 14:08 UTC (permalink / raw)
To: Wolfgang Denk; +Cc: Michael Richardson, linux-mtd
On Tue, 29 November 2005 11:09:37 +0100, Wolfgang Denk wrote:
> In message <v0mzjofaup.fsf@marajade.sandelman.ca> 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
--
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] --cvs-exclude for mkfs.jffs2
2005-11-29 10:09 ` Wolfgang Denk
2005-11-29 10:41 ` Bernd Petrovitsch
2005-11-29 14:08 ` Jörn Engel
@ 2005-11-29 15:18 ` Michael Richardson
2005-11-29 17:08 ` Josh Boyer
2005-11-29 20:46 ` Wolfgang Denk
2 siblings, 2 replies; 9+ messages in thread
From: Michael Richardson @ 2005-11-29 15:18 UTC (permalink / raw)
To: linux-mtd
[-- Attachment #1: Type: text/plain, Size: 1399 bytes --]
>>>>> "Wolfgang" == Wolfgang Denk <wd@denx.de> writes:
Wolfgang> In message <v0mzjofaup.fsf@marajade.sandelman.ca> 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.
--
] ON HUMILITY: to err is human. To moo, bovine. | firewalls [
] Michael Richardson, Xelerance Corporation, Ottawa, ON |net architect[
] mcr@xelerance.com http://www.sandelman.ottawa.on.ca/mcr/ |device driver[
] panic("Just another Debian GNU/Linux using, kernel hacking, security guy"); [
[-- Attachment #2: Type: application/pgp-signature, Size: 480 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] --cvs-exclude for mkfs.jffs2
2005-11-29 15:18 ` Michael Richardson
@ 2005-11-29 17:08 ` Josh Boyer
2005-11-29 17:12 ` Josh Boyer
2005-11-29 20:46 ` Wolfgang Denk
1 sibling, 1 reply; 9+ messages in thread
From: Josh Boyer @ 2005-11-29 17:08 UTC (permalink / raw)
To: Michael Richardson; +Cc: linux-mtd
On 11/29/05, Michael Richardson <mcr@sandelman.ottawa.on.ca> wrote:
>
> >>>>> "Wolfgang" == Wolfgang Denk <wd@denx.de> writes:
> Wolfgang> In message <v0mzjofaup.fsf@marajade.sandelman.ca> 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.
I believe the answer is "not".
josh
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] --cvs-exclude for mkfs.jffs2
2005-11-29 17:08 ` Josh Boyer
@ 2005-11-29 17:12 ` Josh Boyer
2005-11-29 20:31 ` Michael Richardson
0 siblings, 1 reply; 9+ messages in thread
From: Josh Boyer @ 2005-11-29 17:12 UTC (permalink / raw)
To: Michael Richardson; +Cc: linux-mtd
On 11/29/05, Josh Boyer <jwboyer@gmail.com> wrote:
> On 11/29/05, Michael Richardson <mcr@sandelman.ottawa.on.ca> wrote:
> >
> > >>>>> "Wolfgang" == Wolfgang Denk <wd@denx.de> writes:
> > Wolfgang> In message <v0mzjofaup.fsf@marajade.sandelman.ca> 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.
>
> 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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] --cvs-exclude for mkfs.jffs2
2005-11-29 17:12 ` Josh Boyer
@ 2005-11-29 20:31 ` Michael Richardson
0 siblings, 0 replies; 9+ messages in thread
From: Michael Richardson @ 2005-11-29 20:31 UTC (permalink / raw)
To: linux-mtd
[-- Attachment #1: Type: text/plain, Size: 1303 bytes --]
>>>>> "Josh" == Josh Boyer <jwboyer@gmail.com> 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?]
--
] ON HUMILITY: to err is human. To moo, bovine. | firewalls [
] Michael Richardson, Xelerance Corporation, Ottawa, ON |net architect[
] mcr@xelerance.com http://www.sandelman.ottawa.on.ca/mcr/ |device driver[
] panic("Just another Debian GNU/Linux using, kernel hacking, security guy"); [
[-- Attachment #2: Type: application/pgp-signature, Size: 480 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/2] --cvs-exclude for mkfs.jffs2
2005-11-29 15:18 ` Michael Richardson
2005-11-29 17:08 ` Josh Boyer
@ 2005-11-29 20:46 ` Wolfgang Denk
1 sibling, 0 replies; 9+ messages in thread
From: Wolfgang Denk @ 2005-11-29 20:46 UTC (permalink / raw)
To: Michael Richardson; +Cc: linux-mtd
In message <v0sltfeb45.fsf@marajade.sandelman.ca> 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.
> 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
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
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
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2005-11-29 20:47 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-29 2:26 [PATCH 1/2] --cvs-exclude for mkfs.jffs2 Michael Richardson
2005-11-29 10:09 ` Wolfgang Denk
2005-11-29 10:41 ` Bernd Petrovitsch
2005-11-29 14:08 ` Jörn Engel
2005-11-29 15:18 ` Michael Richardson
2005-11-29 17:08 ` Josh Boyer
2005-11-29 17:12 ` Josh Boyer
2005-11-29 20:31 ` Michael Richardson
2005-11-29 20:46 ` Wolfgang Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox