This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
fastjar -i option
- From: Thomas Fitzsimmons <fitzsim at redhat dot com>
- To: java-patches at gcc dot gnu dot org
- Date: Tue, 07 Feb 2006 11:26:52 -0500
- Subject: fastjar -i option
Hi,
This patch fixes this bug:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=159095
The -i option may be useful as an optimization for applets so it may be
useful to implement eventually, but for now I think we should add a
no-op -i option for the sake of command-line compatibility with jar.
Does this patch look OK?
Tom
2006-02-07 Thomas Fitzsimmons <fitzsim@redhat.com>
* jartool.h (ACTION_INDEX): New macro.
* jartool.c (main): Handle -i option.
* fastjar.texi (Invoking fastjar): Add description of -i option.
Index: jartool.c
===================================================================
--- jartool.c (revision 110559)
+++ jartool.c (working copy)
@@ -321,7 +321,7 @@
#define OPT_HELP LONG_OPT (0)
/* This holds all options. */
-#define OPTION_STRING "-ctxuvVf:m:C:0ME@"
+#define OPTION_STRING "-ctxuvVf:m:C:0MiE@"
/* Define the MANIFEST content here to have it easier with calculations
below. This is for the case we create an empty MANIFEST.MF. */
@@ -407,6 +407,9 @@
case 'M':
manifest = FALSE;
break;
+ case 'i':
+ action = ACTION_INDEX;
+ break;
case OPT_HELP:
help(argv[0]);
@@ -424,6 +427,13 @@
}
}
+ if(verbose && action == ACTION_INDEX)
+ fprintf(stderr, "Warning: '-i' option is currently a no-op\n");
+
+ /* FIXME: implement -i option. */
+ if(action == ACTION_INDEX)
+ exit(0);
+
/* We might have seen `--'. In this case we want to make sure that
all following options are handled as file names. */
while (optind < argc)
@@ -2249,6 +2259,8 @@
printf("\
-m FILE include manifest information from specified manifest file\n\
-M Do not create a manifest file for the entries\n\
+ -i generate an index of the packages in this jar\n\
+ and its Class-Path\n\
-v generate verbose output on standard output\n\
-V, --version display version information\n\
");
Index: jartool.h
===================================================================
--- jartool.h (revision 110559)
+++ jartool.h (working copy)
@@ -63,6 +63,7 @@
#define ACTION_EXTRACT 2
#define ACTION_UPDATE 3
#define ACTION_LIST 4
+#define ACTION_INDEX 5
#define TRUE 1
#define FALSE 0
Index: fastjar.texi
===================================================================
--- fastjar.texi (revision 110559)
+++ fastjar.texi (working copy)
@@ -150,6 +150,10 @@
@item -M
Do not create a manifest file for the entries.
+@item -i
+Generate an index of the packages in this jar and its Class-Path
+(currently a no-op for jar command-line compatibility).
+
@item -0
Store only; use no ZIP compression.