Skip to content

Commit 82dbe89

Browse files
committed
Disable ‘checkPackage’ for Debian by default
It does produce more problems than solutions. Especially since we’re currently not fullfilling the requirements of lintian and there is no way for a user to make sure they are.
1 parent d1a54b2 commit 82dbe89

File tree

2 files changed

+23
-21
lines changed

2 files changed

+23
-21
lines changed

src/com/inet/gradle/setup/unix/deb/Deb.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,22 @@
2121

2222
/**
2323
* The deb Gradle task. It build a deb package for Debian / Ubuntu.
24-
*
24+
*
2525
* @author Stefan Heidrich
2626
*/
2727
public class Deb extends Unix {
2828

29-
private String priority;
29+
private String priority;
3030

31-
private String installSize;
31+
private String installSize;
3232

33-
private String recommends;
33+
private String recommends;
3434

35-
private String checkPackage;
35+
private boolean checkPackage = false;
3636

37-
private String maintainerEmail;
37+
private String maintainerEmail;
3838

39-
private String changes;
39+
private String changes;
4040

4141
public Deb() {
4242
super( "deb" );
@@ -67,19 +67,21 @@ public void setInstallSize( String installSize ) {
6767
this.installSize = installSize;
6868
}
6969

70+
@Override
7071
public String getRecommends() {
7172
return recommends;
7273
}
7374

75+
@Override
7476
public void setRecommends( String recommends ) {
7577
this.recommends = recommends;
7678
}
7779

78-
public String getCheckPackage() {
80+
public boolean shouldCheckPackage() {
7981
return checkPackage;
8082
}
8183

82-
public void setCheckPackage( String checkPackage ) {
84+
public void setCheckPackage( boolean checkPackage ) {
8385
this.checkPackage = checkPackage;
8486
}
8587

src/com/inet/gradle/setup/unix/deb/DebBuilder.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class DebBuilder extends AbstractBuilder<Deb, SetupBuilder> {
4545

4646
/**
4747
* Create a new instance
48-
*
48+
*
4949
* @param deb
5050
* the calling task
5151
* @param setup
@@ -241,7 +241,7 @@ private void setupEula() throws IOException {
241241

242242
/**
243243
* Creates the files and the corresponding script section for the specified service.
244-
*
244+
*
245245
* @param service
246246
* the service
247247
* @throws IOException
@@ -272,7 +272,7 @@ private void setupService( Service service ) throws IOException {
272272
String initScriptFile = "etc/init.d/" + serviceUnixName;
273273
initScript.writeTo( createFile( initScriptFile, true ) );
274274

275-
// copy a default service file if set
275+
// copy a default service file if set
276276
if( task.getDefaultServiceFile() != null ) {
277277
File serviceDestFile = new File( buildDir.getAbsolutePath(), "/etc/default/" + serviceUnixName );
278278
serviceDestFile.mkdirs();
@@ -290,7 +290,7 @@ private void setupService( Service service ) throws IOException {
290290

291291
/**
292292
* Creates the files and the corresponding scripts for the specified desktop starter.
293-
*
293+
*
294294
* @param starter
295295
* the desktop starter
296296
* @throws IOException
@@ -316,7 +316,7 @@ private void setupStarter( DesktopStarter starter ) throws IOException {
316316
if( index > -1 ) {
317317
iconName = iconName.substring( index + 1 );
318318
}
319-
// icons must be png files and should named like that
319+
// icons must be png files and should named like that
320320
if( !iconName.endsWith( ".png" ) ) {
321321
index = iconName.lastIndexOf( '.' );
322322
if( index > -1 ) {
@@ -366,7 +366,7 @@ private void setupStarter( DesktopStarter starter ) throws IOException {
366366
if( cwd.isEmpty() || cwd.equals( "." )) {
367367
fw.write( "Path=" + task.getInstallationRoot() + "\n" );
368368
} else {
369-
fw.write( "Path=" + cwd + "\n" );
369+
fw.write( "Path=" + cwd + "\n" );
370370
}
371371
}
372372
fw.write( "Terminal=false\n" );
@@ -393,14 +393,14 @@ private void setupStarter( DesktopStarter starter ) throws IOException {
393393
if( starter.getMimeTypes() != null ) {
394394
fw.write( " <mime-type type=\"" + starter.getMimeTypes() + "\">\n" );
395395
} else {
396-
fw.write( " <mime-type type=\"" + docType.getMimetype() + "\">\n" );
396+
fw.write( " <mime-type type=\"" + docType.getMimetype() + "\">\n" );
397397
}
398398

399399
fw.write( " <comment>" + setup.getApplication() + "</comment>\n" );
400400
fw.write( " <glob-deleteall/>\n" );
401401
fw.write( " <glob pattern=\"*." + extension + "\"/>\n" );
402402
fw.write( " </mime-type>\n" );
403-
fw.write( "</mime-info>\n" );
403+
fw.write( "</mime-info>\n" );
404404
}
405405

406406
controlBuilder.addTailScriptFragment( Script.POSTINST, "xdg-mime install \"" + task.getInstallationRoot() + "/" + simpleVendor + "-" + extension + ".xml\" || true" );
@@ -431,7 +431,7 @@ private void setupStarter( DesktopStarter starter ) throws IOException {
431431

432432
/**
433433
* Creates a file in the build path structure.
434-
*
434+
*
435435
* @param path
436436
* the path relative to the root of the build path
437437
* @param executable
@@ -456,7 +456,7 @@ private File createFile( String path, boolean executable ) throws IOException {
456456
* property is set to true
457457
*/
458458
private void checkDebianPackage() {
459-
if( task.getCheckPackage() == null || task.getCheckPackage().equalsIgnoreCase( "true" ) ) {
459+
if( task.shouldCheckPackage() ) {
460460
ArrayList<String> command = new ArrayList<>();
461461
command.add( "lintian" );
462462
// command.add( "-d" );
@@ -490,7 +490,7 @@ private void createDebianPackage() {
490490

491491
/**
492492
* Changes the permissions of all directories recursively inside the specified path to 755.
493-
*
493+
*
494494
* @param path
495495
* the path
496496
* @throws IOException
@@ -508,7 +508,7 @@ private void changeDirectoryPermissionsTo755( File path ) throws IOException {
508508

509509
/**
510510
* Changes the permissions of all files recursively inside the specified path to 644.
511-
*
511+
*
512512
* @param path
513513
* the path
514514
* @throws IOException

0 commit comments

Comments
 (0)