From 0b74a03789034a600b4217df91054c64f935bc7b Mon Sep 17 00:00:00 2001 From: Ryan Cicchiello Date: Thu, 12 Apr 2018 19:32:20 -0400 Subject: [PATCH] Fixed problem with zip file not keeping permissions --- libaris/res/edu/rpi/aris/VERSION | 2 +- libaris/src/edu/rpi/aris/Update.java | 4 ++-- packaging/extra/server/bin/aris-server | 1 + packaging/extra/server/bin/aris-update | 1 + 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libaris/res/edu/rpi/aris/VERSION b/libaris/res/edu/rpi/aris/VERSION index 54a00221..5c49468d 100644 --- a/libaris/res/edu/rpi/aris/VERSION +++ b/libaris/res/edu/rpi/aris/VERSION @@ -1 +1 @@ -0.0.42 +0.0.43 diff --git a/libaris/src/edu/rpi/aris/Update.java b/libaris/src/edu/rpi/aris/Update.java index d3fabc33..e9e9f789 100644 --- a/libaris/src/edu/rpi/aris/Update.java +++ b/libaris/src/edu/rpi/aris/Update.java @@ -169,10 +169,10 @@ private void unzipFile(File file) throws IOException { ZipEntry entry = entries.nextElement(); File entryDestination = new File(Update.UPDATE_DOWNLOAD_DIR, entry.getName()); if (entry.isDirectory()) { - if (!entryDestination.mkdirs()) + if (!entryDestination.exists() && !entryDestination.mkdirs()) throw new IOException("Failed to unzip file: " + file.getCanonicalPath()); } else { - if (!entryDestination.getParentFile().mkdirs()) + if (!entryDestination.getParentFile().exists() && !entryDestination.getParentFile().mkdirs()) throw new IOException("Failed to unzip file: " + file.getCanonicalPath()); try (InputStream in = zipFile.getInputStream(entry); OutputStream out = new FileOutputStream(entryDestination)) { diff --git a/packaging/extra/server/bin/aris-server b/packaging/extra/server/bin/aris-server index f77a2e7b..6078dcdf 100755 --- a/packaging/extra/server/bin/aris-server +++ b/packaging/extra/server/bin/aris-server @@ -45,6 +45,7 @@ run_aris() { echo -n Updating aris ... rm -rf /usr/lib/aris/* cp -r $TMP/aris-update/* /usr/lib/aris + chmod +x /usr/lib/aris/bin/* echo " Done" fi done diff --git a/packaging/extra/server/bin/aris-update b/packaging/extra/server/bin/aris-update index 16fa847f..c9b04d90 100755 --- a/packaging/extra/server/bin/aris-update +++ b/packaging/extra/server/bin/aris-update @@ -43,6 +43,7 @@ update_aris() { echo -n Updating aris ... rm -rf /usr/lib/aris/* cp -r $TMP/aris-update/* /usr/lib/aris + chmod +x /usr/lib/aris/bin/* echo " Done" fi }