Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This file documents all notable changes to https://github.com/devonfw/IDEasy[IDE

Release with new features and bugfixes:

* https://github.com/devonfw/IDEasy/issues/796[#796]: Fix `ide <tool>` install on macOS for `.pkg` Payloads in cpio format (e.g. AWS CLI)
* https://github.com/devonfw/IDEasy/issues/1552[#1552]: User-defined MAVEN_ARGS appends and no longer overwrites IDEasy's defaults
* https://github.com/devonfw/IDEasy/issues/1833[#1833]: No settings repo update with missing `.commit.id`
* https://github.com/devonfw/IDEasy/issues/1693[#1693]: Fix behavior when there's no settings repo (.../settings/.git)
Expand Down
13 changes: 11 additions & 2 deletions cli/src/main/java/com/devonfw/tools/ide/io/FileAccessImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -933,15 +933,24 @@ public void extractMsi(Path file, Path targetDir) {
public void extractPkg(Path file, Path targetDir) {

LOG.info("Extracting PKG file {} to {}", file, targetDir);
assert this.context.getSystemInfo().isMac();
Path tmpDirPkg = createTempDir("ide-pkg-");
ProcessContext pc = this.context.newProcess();
// we might also be able to use cpio from commons-compression instead of external xar...
pc.executable("xar").addArgs("-C", tmpDirPkg, "-xf", file).run();
Path contentPath = findFirst(tmpDirPkg, p -> p.getFileName().toString().equals("Payload"), true);
extractTar(contentPath, targetDir, TarCompression.GZ);
extractPkgPayloadWithSystemTar(contentPath, targetDir);
delete(tmpDirPkg);
}

private void extractPkgPayloadWithSystemTar(Path payload, Path targetDir) {

mkdirs(targetDir);
ProcessContext pc = this.context.newProcess();
pc.executable("/usr/bin/tar");
pc.addArgs("-xf", payload, "-C", targetDir);
pc.run();
}

@Override
public void compress(Path dir, OutputStream out, String path) {

Expand Down
Loading