Skip to content

Commit dada390

Browse files
Fix 463 and rename appimage (#481)
* Updated appimagetool download url * Added version to appimage name to reflect README correctly * fixed rpm file not being renamed after generation
1 parent a873fe5 commit dada390

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

src/main/java/io/github/fvarrui/javapackager/packagers/GenerateAppImage.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111
import java.io.IOException;
1212

1313
public class GenerateAppImage extends ArtifactGenerator<LinuxPackager> {
14-
15-
private static final int IMAGETOOL_VERSION = 13;
16-
private static final String IMAGETOOL_URL = "https://github.com/AppImage/AppImageKit/releases/download/" + IMAGETOOL_VERSION + "/appimagetool-%s.AppImage";
14+
15+
private static final String IMAGETOOL_URL = "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-%s.AppImage";
1716

1817
public GenerateAppImage() {
1918
super("AppImage");
@@ -41,12 +40,13 @@ protected File doApply(LinuxPackager packager) throws Exception {
4140
File appFolder = packager.getAppFolder();
4241
File outputFolder = packager.getOutputDirectory();
4342
String name = packager.getName();
43+
String version = packager.getVersion();
4444
File executable = packager.getExecutable();
4545
File assetsFolder = packager.getAssetsFolder();
4646
File iconFile = packager.getIconFile();
4747

4848
// output AppImage file
49-
File appImage = new File(outputFolder, name + ".AppImage");
49+
File appImage = new File(outputFolder, name + "_" + version + ".AppImage");
5050

5151
// AppDir folder
5252
File appDir = new File(assetsFolder, "AppDir");

src/main/java/io/github/fvarrui/javapackager/packagers/GenerateRpm.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ protected File doApply(LinuxPackager packager) throws Exception {
9393
builder.build(outputDirectory);
9494

9595
// renames generated RPM file if created
96-
String suffix = "-1." + arch + ".rpm";
96+
String suffix = "-1." + getRpmArchString(arch) + ".rpm";
9797
File originalRpm = new File(outputDirectory, name + "-" + version + suffix);
9898
File rpm = null;
9999
if (originalRpm.exists()) {
@@ -129,4 +129,10 @@ private void addDirectory(Builder builder, String parentPath, File directory, Li
129129
}
130130
}
131131

132+
private String getRpmArchString(Architecture arch) {
133+
if (arch == null) return "null";
134+
135+
return arch.toString().toLowerCase(); // Without Locale to match the redline_rpm way of handling conversion
136+
}
137+
132138
}

0 commit comments

Comments
 (0)