mirror of
https://github.com/nix-community/nix-on-droid-app.git
synced 2025-11-08 11:36:11 +01:00
Set executable bits for files in EXECUTABLES.txt
Partial reimplementation of d3d8aebd1c.
This commit is contained in:
parent
6c2e5b59a3
commit
68530b31f0
1 changed files with 20 additions and 0 deletions
|
|
@ -183,6 +183,7 @@ final class TermuxInstaller {
|
|||
|
||||
final byte[] buffer = new byte[8096];
|
||||
final List<Pair<String, String>> symlinks = new ArrayList<>(50);
|
||||
final List<String> executables = new ArrayList<>(128);
|
||||
|
||||
final URL zipUrl = determineZipUrl(bootstrapURL);
|
||||
try (ZipInputStream zipInput = new ZipInputStream(zipUrl.openStream())) {
|
||||
|
|
@ -205,6 +206,12 @@ final class TermuxInstaller {
|
|||
return;
|
||||
}
|
||||
}
|
||||
} else if (zipEntry.getName().equals("EXECUTABLES.txt")) {
|
||||
BufferedReader executablesReader = new BufferedReader(new InputStreamReader(zipInput));
|
||||
String line;
|
||||
while ((line = executablesReader.readLine()) != null) {
|
||||
executables.add(line);
|
||||
}
|
||||
} else {
|
||||
String zipEntryName = zipEntry.getName();
|
||||
File targetFile = new File(TERMUX_STAGING_PREFIX_DIR_PATH, zipEntryName);
|
||||
|
|
@ -232,6 +239,19 @@ final class TermuxInstaller {
|
|||
}
|
||||
}
|
||||
|
||||
if (!executables.isEmpty()) {
|
||||
for (String executable : executables) {
|
||||
//noinspection OctalInteger
|
||||
try {
|
||||
Os.chmod(TERMUX_STAGING_PREFIX_DIR + "/" + executable, 0700);
|
||||
} catch (Throwable t) {
|
||||
Logger.logError(LOG_TAG, "EXECUTABLES error: " + TERMUX_STAGING_PREFIX_DIR + "/" + executable + t);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw new RuntimeException("Installer: no EXECUTABLES.txt found while extracting environment archive.");
|
||||
}
|
||||
|
||||
if (symlinks.isEmpty())
|
||||
throw new RuntimeException("No SYMLINKS.txt encountered");
|
||||
for (Pair<String, String> symlink : symlinks) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue