|
From: <chr...@us...> - 2009-04-04 08:46:49
|
Revision: 5213
http://jnode.svn.sourceforge.net/jnode/?rev=5213&view=rev
Author: chrisboertien
Date: 2009-04-04 08:46:39 +0000 (Sat, 04 Apr 2009)
Log Message:
-----------
Fixed help issues with archive commands
Signed-off-by: Chris <chr...@gm...>
Modified Paths:
--------------
trunk/fs/descriptors/org.jnode.fs.command.archive.xml
trunk/fs/src/fs/org/jnode/fs/command/archive/ArchiveCommand.java
trunk/fs/src/fs/org/jnode/fs/command/archive/BUnzipCommand.java
trunk/fs/src/fs/org/jnode/fs/command/archive/BZip.java
trunk/fs/src/fs/org/jnode/fs/command/archive/BZipCommand.java
trunk/fs/src/fs/org/jnode/fs/command/archive/GUnzipCommand.java
trunk/fs/src/fs/org/jnode/fs/command/archive/GZip.java
trunk/fs/src/fs/org/jnode/fs/command/archive/GZipCommand.java
trunk/fs/src/fs/org/jnode/fs/command/archive/TarCommand.java
trunk/fs/src/fs/org/jnode/fs/command/archive/UnzipCommand.java
trunk/fs/src/fs/org/jnode/fs/command/archive/ZCatCommand.java
trunk/fs/src/fs/org/jnode/fs/command/archive/Zip.java
trunk/fs/src/fs/org/jnode/fs/command/archive/ZipCommand.java
Modified: trunk/fs/descriptors/org.jnode.fs.command.archive.xml
===================================================================
--- trunk/fs/descriptors/org.jnode.fs.command.archive.xml 2009-04-03 05:36:41 UTC (rev 5212)
+++ trunk/fs/descriptors/org.jnode.fs.command.archive.xml 2009-04-04 08:46:39 UTC (rev 5213)
@@ -33,7 +33,8 @@
<extension point="org.jnode.shell.syntaxes">
<syntax alias="tar">
<sequence>
- <alternatives description="tar operations">
+ <optionSet description="tar options">
+ <!-- Tar Operations -->
<option argLabel="doAppend" shortName="r" longName="append" />
<option argLabel="doCreate" shortName="c" longName="create" />
<option argLabel="doConcat" shortName="A" longName="concatenate" />
@@ -42,29 +43,31 @@
<option argLabel="doExtract" shortName="x" longName="extract" />
<option argLabel="doList" shortName="t" longName="list" />
<option argLabel="doUpdate" shortName="u" longName="update" />
- </alternatives>
- <optionSet description="tar options">
+ <!-- Tar Global Options -->
+ <option argLabel="archive" shortName="f" longName="file" />
<option argLabel="backup" longName="backup" />
<option argLabel="bzip" shortName="j" longName="bzip2" />
- <option argLabel="debug" longName="debug" />
- <option argLabel="dir" shortName="C" longName="directory" />
- <option argLabel="exclude" longName="exclude" label="pattern" />
- <option argLabel="file" shortName="f" longName="file" />
<option argLabel="fileList" shortName="T" longName="files-from"/>
<option argLabel="gzip" shortName="z" longName="gzip" />
<option argLabel="interact" shortName="w" longName="interactive" />
<option argLabel="keep_old" shortName="k" longName="keep-old-files" />
<option argLabel="keep_new" longName="keep-newer-files" />
- <option argLabel="noRecurse" longName="no-recursion" />
- <option argLabel="recurse" longName="recursion" />
<option argLabel="removeFiles" longName="remove-files" />
<option argLabel="showTotals" longName="totals" />
<option argLabel="suffix" longName="suffix" />
- <option argLabel="stdout" shortName="O" longName="to-stdout" />
<option argLabel="unlink" longName="unlink" />
- <option argLabel="verbose" shortName="v" longName="verbose" />
<option argLabel="verify" shortName="W" longName="verify" />
<option argLabel="xfile" shortName="X" longName="exclude-from"/>
+ <!-- Tar Path Parser Options -->
+ <!-- These need to be changed out of here once the syntax allows for specifying positional arguments. -->
+ <option argLabel="exclude" longName="exclude" label="pattern" />
+ <option argLabel="noRecurse" longName="no-recursion" />
+ <option argLabel="recurse" longName="recursion" />
+ <option argLabel="dir" shortName="C" longName="directory" />
+ <!-- ArchiveCommand -->
+ <option argLabel="verbose" shortName="v" longName="verbose" />
+ <option argLabel="debug" longName="debug" />
+ <option argLabel="stdout" shortName="O" longName="to-stdout" />
<!--
<option argLabel="minDate" shortName="N" longName="newer" />
<option argLabel="minMTime" longName="newer-mtime" />
@@ -79,19 +82,22 @@
<empty description="compress standard input to standard output" />
<sequence description="compress files">
<optionSet>
+ <!-- GZipCommand -->
+ <option argLabel="c1" shortName="1" longName="fast" />
+ <option argLabel="c9" shortName="9" longName="best" />
<option argLabel="decompress" shortName="d" longName="decompress" />
+ <!-- GZip -->
+ <option argLabel="test" shortName="t" longName="test" />
+ <option argLabel="list" shortName="l" longName="list" />
+ <option argLabel="recurse" shortName="r" longName="recursive" />
<option argLabel="noname" shortName="n" longName="no-name" />
<option argLabel="name" shortName="N" longName="name" />
+ <!-- ArchiveCommand -->
<option argLabel="stdout" shortName="c" longName="stdout" />
<option argLabel="force" shortName="f" longName="force" />
<option argLabel="quiet" shortName="q" longName="quiet" />
<option argLabel="verbose" shortName="v" longName="verbose" />
- <option argLabel="c1" shortName="1" longName="fast" />
<option argLabel="debug" longName="debug" />
- <option argLabel="recurse" shortName="r" longName="recursive" />
- <option argLabel="test" shortName="t" longName="test" />
- <option argLabel="list" shortName="l" longName="list" />
- <option argLabel="c9" shortName="9" longName="best" />
</optionSet>
<optional eager="true"><option argLabel="suffix" shortName="S" longName="suffix" /></optional>
<repeat minCount="1">
@@ -103,16 +109,18 @@
<empty description="decompress standard input to standard output" />
<sequence description="decompress files">
<optionSet>
- <option argLabel="debug" longName="debug" />
- <option argLabel="recurse" shortName="r" longName="recursive" />
+ <!-- GZip -->
<option argLabel="test" shortName="t" longName="test" />
<option argLabel="list" shortName="l" longName="list" />
+ <option argLabel="recurse" shortName="r" longName="recursive" />
<option argLabel="noname" shortName="n" longName="no-name" />
<option argLabel="name" shortName="N" longName="name" />
+ <!-- ArchiveCommand -->
<option argLabel="stdout" shortName="c" longName="stdout" />
<option argLabel="force" shortName="f" longName="force" />
<option argLabel="quiet" shortName="q" longName="quiet" />
<option argLabel="verbose" shortName="v" longName="verbose" />
+ <option argLabel="debug" longName="debug" />
</optionSet>
<optional eager="true"><option argLabel="suffix" shortName="S" longName="suffix" /></optional>
<repeat minCount="1">
@@ -122,16 +130,9 @@
</syntax>
<syntax alias="zcat">
<empty description="decompress standard input to standard output" />
- <sequence description="decompress files to standard output">
- <optionSet>
- <option argLabel="quiet" shortName="q" longName="quiet" />
- <option argLabel="verbose" shortName="v" longName="verbose" />
- <option argLabel="debug" longName="debug" />
- </optionSet>
- <repeat minCount="1">
- <argument argLabel="files" />
- </repeat>
- </sequence>
+ <repeat minCount="1">
+ <argument argLabel="files" />
+ </repeat>
</syntax>
<syntax alias="zip">
</syntax>
@@ -141,16 +142,7 @@
<empty description="compress stdin to stdout" />
<sequence description="compress files">
<optionSet>
- <option argLabel="stdout" shortName="c" longName="stdout" />
- <option argLabel="decompress" shortName="d" longName="decompress" />
- <option argLabel="compress" shortName="z" longName="compress" />
- <option argLabel="test" shortName="t" longName="test" />
- <option argLabel="force" shortName="f" longName="force" />
- <option argLabel="keep" shortName="k" longName="keep" />
- <option argLabel="small" shortName="s" longName="small" />
- <option argLabel="verbose" shortName="v" longName="verbose" />
- <option argLabel="quiet" shortName="q" longName="quiet" />
- <option argLabel="debug" longName="debug" />
+ <!-- BZipCommand -->
<option argLabel="c1" shortName="1" longName="fast" />
<option argLabel="c2" shortName="2" />
<option argLabel="c3" shortName="3" />
@@ -160,6 +152,18 @@
<option argLabel="c7" shortName="7" />
<option argLabel="c8" shortName="8" />
<option argLabel="c9" shortName="9" longName="best" />
+ <!-- BZip -->
+ <option argLabel="decompress" shortName="d" longName="decompress" />
+ <option argLabel="compress" shortName="z" longName="compress" />
+ <option argLabel="test" shortName="t" longName="test" />
+ <option argLabel="keep" shortName="k" longName="keep" />
+ <option argLabel="small" shortName="s" longName="small" />
+ <!-- ArchiveCommand -->
+ <option argLabel="stdout" shortName="c" longName="stdout" />
+ <option argLabel="force" shortName="f" longName="force" />
+ <option argLabel="verbose" shortName="v" longName="verbose" />
+ <option argLabel="quiet" shortName="q" longName="quiet" />
+ <option argLabel="debug" longName="debug" />
</optionSet>
<repeat>
<argument argLabel="files" />
@@ -170,11 +174,15 @@
<empty description="decompress stdin to stdout" />
<sequence description="decompress files">
<optionSet>
- <option argLabel="stdout" shortName="c" longName="stdout" />
+ <!-- BZip -->
+ <option argLabel="compress" shortName="z" longName="compress"/>
+ <option argLabel="decompress" shortName="d" longName="decompress"/>
<option argLabel="test" shortName="t" longName="test" />
- <option argLabel="force" shortName="f" longName="force" />
<option argLabel="keep" shortName="k" longName="keep" />
<option argLabel="small" shortName="s" longName="small" />
+ <!-- ArchiveCommand -->
+ <option argLabel="stdout" shortName="c" longName="stdout" />
+ <option argLabel="force" shortName="f" longName="force" />
<option argLabel="verbose" shortName="v" longName="verbose" />
<option argLabel="quiet" shortName="q" longName="quiet" />
<option argLabel="debug" longName="debug" />
Modified: trunk/fs/src/fs/org/jnode/fs/command/archive/ArchiveCommand.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/command/archive/ArchiveCommand.java 2009-04-03 05:36:41 UTC (rev 5212)
+++ trunk/fs/src/fs/org/jnode/fs/command/archive/ArchiveCommand.java 2009-04-04 08:46:39 UTC (rev 5213)
@@ -86,29 +86,28 @@
protected ArchiveCommand(String s) {
super(s);
- registerArguments(Quiet, Verbose, Debug, Stdout, Force);
}
- public void execute() {
+ public void execute(String command) {
stdoutWriter = getOutput().getPrintWriter();
stderrWriter = getError().getPrintWriter();
stdinReader = getInput().getReader();
stdin = getInput().getInputStream();
stdout = getOutput().getOutputStream();
- if (Quiet.isSet()) {
- outMode = 0;
- } else {
- if (Verbose.isSet()) {
- outMode |= OUT_NOTICE;
- }
- if (Debug.isSet()) {
- outMode |= OUT_DEBUG;
- }
+ if (command.equals("zcat") || command.equals("bzcat")) return;
+
+ if (!command.equals("tar")) {
+ if (Quiet.isSet()) outMode = 0;
+ force = Force.isSet();
}
if (!use_stdout) use_stdout = Stdout.isSet();
- force = Force.isSet();
+
+ if (outMode != 0) {
+ if (Verbose.isSet()) outMode |= OUT_NOTICE;
+ if (Debug.isSet()) outMode |= OUT_DEBUG;
+ }
}
protected void createStreamBuffer(int size) {
Modified: trunk/fs/src/fs/org/jnode/fs/command/archive/BUnzipCommand.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/command/archive/BUnzipCommand.java 2009-04-03 05:36:41 UTC (rev 5212)
+++ trunk/fs/src/fs/org/jnode/fs/command/archive/BUnzipCommand.java 2009-04-04 08:46:39 UTC (rev 5213)
@@ -24,11 +24,14 @@
public BUnzipCommand() {
super("decompresses data in bzip2 format");
- registerArguments();
+ // from ArchiveCommand
+ registerArguments(Quiet, Verbose, Stdout, Force, Debug);
+ // from BZip
+ registerArguments(Compress, Decompress, Files, Keep, Small, Test);
}
public void execute() {
compress = false;
- super.execute();
+ super.execute("bunzip2");
}
}
Modified: trunk/fs/src/fs/org/jnode/fs/command/archive/BZip.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/command/archive/BZip.java 2009-04-03 05:36:41 UTC (rev 5212)
+++ trunk/fs/src/fs/org/jnode/fs/command/archive/BZip.java 2009-04-04 08:46:39 UTC (rev 5213)
@@ -53,29 +53,33 @@
protected final FlagArgument Small = new FlagArgument("small", Argument.OPTIONAL, help_small);
protected final FlagArgument Test = new FlagArgument("test", Argument.OPTIONAL, help_test);
- protected int clevel = 9;
+ protected int clevel;
protected boolean keep;
+ protected boolean small;
public BZip(String s) {
super(s);
- registerArguments(Compress, Decompress, Files, Keep, Small, Test);
createStreamBuffer(4096);
}
- public void execute() {
- super.execute();
+ public void execute(String command) {
+ super.execute(command);
- if (compress && Decompress.isSet()) {
- compress = false;
- }
- if (!compress && Compress.isSet()) {
- compress = true;
- }
+ small = Small.isSet();
- keep = Keep.isSet();
-
- if (!keep && use_stdout) {
- keep = true;
+ if (!command.equals("bzcat")) {
+ if (compress && Decompress.isSet()) {
+ compress = false;
+ }
+ if (!compress && Compress.isSet()) {
+ compress = true;
+ }
+
+ keep = Keep.isSet();
+
+ if (!keep && use_stdout) {
+ keep = true;
+ }
}
try {
Modified: trunk/fs/src/fs/org/jnode/fs/command/archive/BZipCommand.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/command/archive/BZipCommand.java 2009-04-03 05:36:41 UTC (rev 5212)
+++ trunk/fs/src/fs/org/jnode/fs/command/archive/BZipCommand.java 2009-04-04 08:46:39 UTC (rev 5213)
@@ -40,11 +40,26 @@
public BZipCommand() {
super("compresses data with bzip2");
+ // from ArchiveCommand
+ registerArguments(Quiet, Verbose, Stdout, Force, Debug);
+ // from BZip
+ registerArguments(Compress, Decompress, Files, Keep, Small, Test);
registerArguments(C1, C2, C3, C4, C5, C6, C7, C8, C9);
}
public void execute() {
compress = true;
- super.execute();
+ if (C1.isSet()) clevel = 1;
+ if (C2.isSet()) clevel = 2;
+ if (C3.isSet()) clevel = 3;
+ if (C4.isSet()) clevel = 4;
+ if (C5.isSet()) clevel = 5;
+ if (C6.isSet()) clevel = 6;
+ if (C7.isSet()) clevel = 7;
+ if (C8.isSet()) clevel = 8;
+ if (C9.isSet()) clevel = 9;
+ else clevel = 6;
+
+ super.execute("bzip2");
}
}
Modified: trunk/fs/src/fs/org/jnode/fs/command/archive/GUnzipCommand.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/command/archive/GUnzipCommand.java 2009-04-03 05:36:41 UTC (rev 5212)
+++ trunk/fs/src/fs/org/jnode/fs/command/archive/GUnzipCommand.java 2009-04-04 08:46:39 UTC (rev 5213)
@@ -36,10 +36,14 @@
public GUnzipCommand() {
super("decompresses files/data");
+ // from ArchiveCommand
+ registerArguments(Quiet, Verbose, Debug, Force, Stdout);
+ // from GZip
+ registerArguments(Files, List, NoName, Name, Recurse, Test, Suffix);
}
public void execute() {
compress = false;
- super.execute();
+ super.execute("gunzip");
}
}
Modified: trunk/fs/src/fs/org/jnode/fs/command/archive/GZip.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/command/archive/GZip.java 2009-04-03 05:36:41 UTC (rev 5212)
+++ trunk/fs/src/fs/org/jnode/fs/command/archive/GZip.java 2009-04-04 08:46:39 UTC (rev 5213)
@@ -49,29 +49,30 @@
private static final String help_test = "test compressed file integrity";
private static final String help_file = "the files to compress, use stdin if FILE is '-' or no files are listed";
- private final FileArgument Files = new FileArgument("files", Argument.OPTIONAL | Argument.MULTIPLE, help_file);
- private final FlagArgument List = new FlagArgument("list", Argument.OPTIONAL, help_list);
- private final FlagArgument NoName = new FlagArgument("noname", Argument.OPTIONAL, help_noname);
- private final FlagArgument Name = new FlagArgument("name", Argument.OPTIONAL, help_name);
- private final FlagArgument Recurse = new FlagArgument("recurse", Argument.OPTIONAL, help_recurse);
- private final FlagArgument Test = new FlagArgument("test", Argument.OPTIONAL, help_test);
- private final StringArgument Suffix = new StringArgument("suffix", Argument.OPTIONAL, help_suffix);
+ protected final FileArgument Files = new FileArgument("files", Argument.OPTIONAL | Argument.MULTIPLE, help_file);
+ protected final FlagArgument List = new FlagArgument("list", Argument.OPTIONAL, help_list);
+ protected final FlagArgument NoName = new FlagArgument("noname", Argument.OPTIONAL, help_noname);
+ protected final FlagArgument Name = new FlagArgument("name", Argument.OPTIONAL, help_name);
+ protected final FlagArgument Recurse = new FlagArgument("recurse", Argument.OPTIONAL, help_recurse);
+ protected final FlagArgument Test = new FlagArgument("test", Argument.OPTIONAL, help_test);
+ protected final StringArgument Suffix = new StringArgument("suffix", Argument.OPTIONAL, help_suffix);
protected String suffix = ".gz";
protected boolean recurse;
protected GZip(String s) {
super(s);
- registerArguments(Files, List, NoName, Name, Recurse, Test, Suffix);
createStreamBuffer(4096);
}
- public void execute() {
- super.execute();
+ public void execute(String command) {
+ super.execute(command);
- if (Suffix.isSet()) suffix = Suffix.getValue();
+ if (!command.equals("zcat")) {
+ if (Suffix.isSet()) suffix = Suffix.getValue();
- recurse = Recurse.isSet();
+ recurse = Recurse.isSet();
+ }
try {
if (compress) {
Modified: trunk/fs/src/fs/org/jnode/fs/command/archive/GZipCommand.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/command/archive/GZipCommand.java 2009-04-03 05:36:41 UTC (rev 5212)
+++ trunk/fs/src/fs/org/jnode/fs/command/archive/GZipCommand.java 2009-04-04 08:46:39 UTC (rev 5213)
@@ -45,11 +45,15 @@
public GZipCommand() {
super("compresses and decompresses files/data");
+ // from ArchiveCommand
+ registerArguments(Quiet, Verbose, Debug, Force, Stdout);
+ // from GZip
+ registerArguments(Files, List, NoName, Name, Recurse, Test, Suffix);
registerArguments(Decompress, C1, C9);
}
public void execute() {
compress = !Decompress.isSet();
- super.execute();
+ super.execute("gzip");
}
}
Modified: trunk/fs/src/fs/org/jnode/fs/command/archive/TarCommand.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/command/archive/TarCommand.java 2009-04-03 05:36:41 UTC (rev 5212)
+++ trunk/fs/src/fs/org/jnode/fs/command/archive/TarCommand.java 2009-04-04 08:46:39 UTC (rev 5213)
@@ -207,11 +207,11 @@
private static final String help_list = "list the contents of an archive";
private static final String help_update = "only append files that are newer than the copy in the archive";
+ private static final String help_archive = "use the given archive";
private static final String help_backup = "backup files instead of overwriting";
private static final String help_bzip = "compress the archive with bzip2";
private static final String help_dir = "change to directory";
private static final String help_exclude = "exclude files matching <pattern>";
- private static final String help_file = "use the given archive";
private static final String help_file_list = "get names to extract or archive from <file>";
private static final String help_gzip = "compress the archive with gzip";
private static final String help_interact = "ask for confirmation for every action";
@@ -224,7 +224,8 @@
private static final String help_stdout = "extract files to stdout";
private static final String help_suffix = "append <suffix> to backup files (default ~)";
private static final String help_totals = "display total bytes written after creating the archive";
- private static final String help_unlink = "when extracting, delete files if they exist";
+ private static final String help_unlink = "when extracting, delete files if they exist. This is the default" +
+ "action and is used to override other options if they were set";
private static final String help_verbose = "list files processed";
private static final String help_verify = "verify the archive after writing it";
private static final String help_xfile = "exclude files matching patterns in <file>";
@@ -263,7 +264,7 @@
private final FlagArgument UseBzip = new FlagArgument("bzip", Argument.OPTIONAL, help_bzip);
private final FileArgument ChangeDir = new FileArgument("dir", Argument.OPTIONAL, help_dir);
private final StringArgument Exclude = new StringArgument("exclude", Argument.OPTIONAL, help_exclude);
- private final FileArgument Archive = new FileArgument("file", Argument.OPTIONAL, help_file);
+ private final FileArgument Archive = new FileArgument("archive", Argument.OPTIONAL, help_archive);
private final FileArgument FileList = new FileArgument("fileList", Argument.OPTIONAL, help_file_list);
private final FlagArgument UseGzip = new FlagArgument("gzip", Argument.OPTIONAL, help_gzip);
private final FlagArgument Interact = new FlagArgument("interact", Argument.OPTIONAL, help_interact);
@@ -302,36 +303,42 @@
public TarCommand() {
super("Create/Modify/Extract tape archives");
- registerArguments(DoAppend, DoConcat, DoCreate, DoDelete, DoDiff, DoExtract, DoList, DoUpdate,
- Backup, UseBzip, ChangeDir, Exclude, Archive, FileList, UseGzip, Interact, KeepNew, Unlink,
- KeepOld, NoRecurse, Recurse, RemoveFiles, ShowTotals, Suffix, Verify, Paths, ExcludeFile);
+ // from ArchiveCommand
+ registerArguments(Verbose, Debug, Stdout);
+
+ // tar Operations
+ registerArguments(DoAppend, DoConcat, DoCreate, DoDelete, DoDiff, DoExtract, DoList, DoUpdate);
+
+ // tar Global Options
+ registerArguments(Backup, Suffix, UseBzip, UseGzip, Archive, FileList, ExcludeFile, Interact, KeepNew, KeepOld,
+ Unlink, RemoveFiles, ShowTotals, Verify, Paths);
+ // tar Parsing Options
+ registerArguments(ChangeDir, Exclude, NoRecurse, Recurse);
}
// TODO Allow working directory to be changed
public void execute() {
- super.execute();
+ super.execute("tar");
if (!checkMode()) {
fatal(err_options, 1);
}
+ if (Archive.isSet()) archive = Archive.getValue();
if (Suffix.isSet()) suffix = Suffix.getValue();
if (Exclude.isSet()) exclude = Exclude.getValue();
if (ExcludeFile.isSet()) excludeFile = ExcludeFile.getValue();
if (FileList.isSet()) fileList = FileList.getValue();
- backup = Backup.isSet();
- bzip = UseBzip.isSet();
- gzip = UseGzip.isSet();
- interact = Interact.isSet();
- verify = Verify.isSet();
- showTotals = ShowTotals.isSet();
- keepOld = KeepOld.isSet();
- keepNew = KeepNew.isSet();
- recurse = !NoRecurse.isSet();
- unlink = Unlink.isSet();
- if (Archive.isSet()) archive = Archive.getValue();
- else error("No archive given");
- //if (!(pipeInOut = !Archive.isSet())) archive = Archive.getValue();
+ backup = Backup.isSet();
+ bzip = UseBzip.isSet();
+ gzip = UseGzip.isSet();
+ interact = Interact.isSet();
+ verify = Verify.isSet();
+ showTotals = ShowTotals.isSet();
+ keepOld = KeepOld.isSet();
+ keepNew = KeepNew.isSet();
+ recurse = !NoRecurse.isSet();
+ unlink = Unlink.isSet();
try {
if ((mode & TAR_REQ_ARCH) != 0 && archive == null) {
@@ -427,7 +434,7 @@
tout = appendTarOutputStream();
// Concatenate new archives
- for(File arch : archives) {
+ for (File arch : archives) {
if ((in = openFileRead(arch)) == null) {
continue;
}
@@ -495,7 +502,7 @@
InputStream in;
TarInputStream tin;
TarEntry entry;
- TreeMap<String,Long> entries = new TreeMap();
+ TreeMap<String, Long> entries = new TreeMap();
if ((in = openFileRead(archive)) == null) {
fatal(" ", 1);
@@ -675,6 +682,7 @@
* Sets up a TarOutputStream suitable for appending new entries.
*/
private TarOutputStream appendTarOutputStream() throws IOException {
+ // FIXME this isnt working.
OutputStream out;
InputStream in;
TarOutputStream tout;
@@ -762,7 +770,7 @@
/**
* Wraps an InputStream with a decompression stream for reading compressed archives.
*/
- private InputStream wrapInputStream( InputStream in ) throws IOException {
+ private InputStream wrapInputStream(InputStream in) throws IOException {
if (decompress == USE_BZIP) {
return new CBZip2InputStream(in);
}
@@ -777,7 +785,7 @@
/**
* Wraps an OutputStream with a compression stream for writing compressed archives.
*/
- private OutputStream wrapOutputStream( OutputStream out ) throws IOException {
+ private OutputStream wrapOutputStream(OutputStream out) throws IOException {
if (compress == USE_BZIP) {
return new CBZip2OutputStream(out);
}
Modified: trunk/fs/src/fs/org/jnode/fs/command/archive/UnzipCommand.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/command/archive/UnzipCommand.java 2009-04-03 05:36:41 UTC (rev 5212)
+++ trunk/fs/src/fs/org/jnode/fs/command/archive/UnzipCommand.java 2009-04-04 08:46:39 UTC (rev 5213)
@@ -20,12 +20,6 @@
package org.jnode.fs.command.archive;
-import org.jnode.shell.AbstractCommand;
-import org.jnode.shell.syntax.Argument;
-import org.jnode.shell.syntax.FileArgument;
-import org.jnode.shell.syntax.FlagArgument;
-import org.jnode.shell.syntax.StringArgument;
-
/**
* @author chris boertien
*/
@@ -37,6 +31,6 @@
}
public void execute() {
- super.execute();
+ super.execute("unzip");
}
}
Modified: trunk/fs/src/fs/org/jnode/fs/command/archive/ZCatCommand.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/command/archive/ZCatCommand.java 2009-04-03 05:36:41 UTC (rev 5212)
+++ trunk/fs/src/fs/org/jnode/fs/command/archive/ZCatCommand.java 2009-04-04 08:46:39 UTC (rev 5213)
@@ -28,11 +28,13 @@
public ZCatCommand() {
super("decompresses files to standard output");
+ // from GZip
+ registerArguments(Files);
}
public void execute() {
use_stdout = true;
compress = false;
- super.execute();
+ super.execute("zcat");
}
}
Modified: trunk/fs/src/fs/org/jnode/fs/command/archive/Zip.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/command/archive/Zip.java 2009-04-03 05:36:41 UTC (rev 5212)
+++ trunk/fs/src/fs/org/jnode/fs/command/archive/Zip.java 2009-04-04 08:46:39 UTC (rev 5213)
@@ -51,8 +51,8 @@
super(s);
}
- public void execute() {
- super.execute();
+ public void execute(String command) {
+ super.execute(command);
}
void extract() throws IOException {
Modified: trunk/fs/src/fs/org/jnode/fs/command/archive/ZipCommand.java
===================================================================
--- trunk/fs/src/fs/org/jnode/fs/command/archive/ZipCommand.java 2009-04-03 05:36:41 UTC (rev 5212)
+++ trunk/fs/src/fs/org/jnode/fs/command/archive/ZipCommand.java 2009-04-04 08:46:39 UTC (rev 5213)
@@ -20,12 +20,6 @@
package org.jnode.fs.command.archive;
-import org.jnode.shell.AbstractCommand;
-import org.jnode.shell.syntax.Argument;
-import org.jnode.shell.syntax.FileArgument;
-import org.jnode.shell.syntax.FlagArgument;
-import org.jnode.shell.syntax.StringArgument;
-
/**
* @author chris boertien
*/
@@ -52,6 +46,6 @@
}
public void execute() {
- super.execute();
+ super.execute("zip");
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|