Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

println -> info/warn

  • Loading branch information...
commit 3a1738a334cfd5b959371fa25c6bec8420e69592 1 parent b4cac02
@tcurdt authored
View
3  src/main/java/org/vafer/jdeb/Console.java
@@ -22,6 +22,7 @@
*/
public interface Console {
- void println( String s );
+ void info(String s);
+ void warn(String s);
}
View
34 src/main/java/org/vafer/jdeb/Processor.java
@@ -122,11 +122,11 @@ public PackageDescriptor createDeb( final File[] pControlFiles, final DataProduc
tempData = File.createTempFile("deb", "data");
tempControl = File.createTempFile("deb", "control");
- console.println("Building data");
+ console.info("Building data");
final StringBuilder md5s = new StringBuilder();
final BigInteger size = buildData(pData, tempData, md5s, compression);
- console.println("Building control");
+ console.info("Building control");
final PackageDescriptor packageDescriptor = buildControl(pControlFiles, size, md5s, tempControl);
if (!packageDescriptor.isValid()) {
@@ -259,7 +259,7 @@ public ChangesDescriptor createChanges( final PackageDescriptor pPackageDescript
return changesDescriptor;
}
- console.println("Signing changes with key " + pKey);
+ console.info("Signing changes with key " + pKey);
final InputStream input = new ByteArrayInputStream(changesBytes);
@@ -311,7 +311,7 @@ private PackageDescriptor buildControl( final File[] pControlFiles, final BigInt
}
if (!isDefaultExcludes) {
- console.println("Found directory '" + file + "' in the control directory. Maybe you are pointing to wrong dir?");
+ console.info("Found directory '" + file + "' in the control directory. Maybe you are pointing to wrong dir?");
}
continue;
}
@@ -349,7 +349,7 @@ private PackageDescriptor buildControl( final File[] pControlFiles, final BigInt
if (debFullName != null && debEmail != null) {
final String maintainer = debFullName + " <" + debEmail + ">";
packageDescriptor.set("Maintainer", maintainer);
- console.println("Using maintainer '" + maintainer + "' from the environment variables.");
+ console.info("Using maintainer '" + maintainer + "' from the environment variables.");
}
} else {
@@ -434,7 +434,7 @@ public void onEachDir( String dirname, String linkname, String user, int uid, St
// createParentDirectories, including about a possible bug.)
createDirectory(dirname, user, uid, group, gid, mode, 0);
- console.println("dir: " + dirname);
+ console.info("dir: " + dirname);
}
public void onEachFile( InputStream inputStream, String filename, String linkname, String user, int uid, String group, int gid, int mode, long size ) throws IOException {
@@ -463,17 +463,17 @@ public void onEachFile( InputStream inputStream, String filename, String linknam
tarOutputStream.closeEntry();
- console.println(
+ console.info(
"file:" + entry.getName() +
- " size:" + entry.getSize() +
- " mode:" + entry.getMode() +
- " linkname:" + entry.getLinkName() +
- " username:" + entry.getUserName() +
- " userid:" + entry.getUserId() +
- " groupname:" + entry.getGroupName() +
- " groupid:" + entry.getGroupId() +
- " modtime:" + entry.getModTime() +
- " md5: " + md5
+ " size:" + entry.getSize() +
+ " mode:" + entry.getMode() +
+ " linkname:" + entry.getLinkName() +
+ " username:" + entry.getUserName() +
+ " userid:" + entry.getUserId() +
+ " groupname:" + entry.getGroupName() +
+ " groupid:" + entry.getGroupId() +
+ " modtime:" + entry.getModTime() +
+ " md5: " + md5
);
// append to file md5 list
@@ -569,7 +569,7 @@ private void createParentDirectories(String dirname, String user, int uid, Strin
tarOutputStream.close();
}
- console.println("Total size: " + dataSize);
+ console.info("Total size: " + dataSize);
return dataSize.count;
}
View
5 src/main/java/org/vafer/jdeb/ant/DebAntTask.java
@@ -185,11 +185,14 @@ public void execute() {
dataProducers.toArray(data);
final Processor processor = new Processor(new Console() {
- public void println(String s) {
+ public void info(String s) {
if (verbose) {
log(s);
}
}
+ public void warn(String s) {
+ log(s);
+ }
}, null);
final PackageDescriptor packageDescriptor;
View
6 src/main/java/org/vafer/jdeb/maven/DebMaker.java
@@ -220,7 +220,7 @@ public void makeDeb() throws PackagingException {
final PackageDescriptor packageDescriptor;
try {
- console.println("Creating debian package: " + deb);
+ console.info("Creating debian package: " + deb);
packageDescriptor = processor.createDeb(controlFiles, data, deb, compression);
@@ -235,7 +235,7 @@ public void makeDeb() throws PackagingException {
return;
}
- console.println("Creating changes file: " + changesOut);
+ console.info("Creating changes file: " + changesOut);
// for now only support reading the changes form a textfile provider
changesProvider = new TextfileChangesProvider(new FileInputStream(changesIn), packageDescriptor);
@@ -254,7 +254,7 @@ public void makeDeb() throws PackagingException {
return;
}
- console.println("Saving changes to file: " + changesSave);
+ console.info("Saving changes to file: " + changesSave);
changesProvider.save(new FileOutputStream(changesSave));
View
5 src/main/java/org/vafer/jdeb/maven/DebMojo.java
@@ -360,9 +360,12 @@ public void produce(final DataConsumer receiver) {
}
Console infoConsole = new Console() {
- public void println(String s) {
+ public void info(String s) {
getLog().info(s);
}
+ public void warn(String s) {
+ getLog().warn(s);
+ }
};
try {
View
4 src/test/java/org/vafer/jdeb/DataProducerTestCase.java
@@ -37,7 +37,9 @@
public void testCreation() throws Exception {
final Processor processor = new Processor(new Console() {
- public void println(String s) {
+ public void info(String s) {
+ }
+ public void warn(String s) {
}
}, null);
View
4 src/test/java/org/vafer/jdeb/ProcessorTestCase.java
@@ -31,7 +31,9 @@
*/
public void testBuildDataWithFileSet() throws Exception {
Processor processor = new Processor(new Console() {
- public void println(String s) {
+ public void info(String s) {
+ }
+ public void warn(String s) {
}
}, null);
Please sign in to comment.
Something went wrong with that request. Please try again.