diff --git a/.gitignore b/.gitignore index b01942f..741973f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ build *.deb *.tgz -./I2P/ \ No newline at end of file +./I2P/ +i2pversion_override diff --git a/build.sh b/build.sh index e1836ae..4fea277 100755 --- a/build.sh +++ b/build.sh @@ -3,6 +3,10 @@ set -e . i2pversion +if [ -f i2pversion_override ]; then + . i2pversion_override +fi + JAVA=$(java --version | tr -d 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\n' | cut -d ' ' -f 2 | cut -d '.' -f 1 | tr -d '\n\t\- ') if [ "$JAVA" -lt "14" ]; then diff --git a/java/net/i2p/router/WindowsUpdatePostProcessor.java b/java/net/i2p/router/WindowsUpdatePostProcessor.java index 28e0deb..942a528 100644 --- a/java/net/i2p/router/WindowsUpdatePostProcessor.java +++ b/java/net/i2p/router/WindowsUpdatePostProcessor.java @@ -5,30 +5,33 @@ import java.util.*; import java.util.concurrent.TimeUnit; import static net.i2p.update.UpdateType.*; +import net.i2p.I2PAppContext; import net.i2p.update.UpdateType; import net.i2p.update.UpdatePostProcessor; +import net.i2p.util.Log; import net.i2p.util.SystemVersion; import java.lang.ProcessBuilder; import java.lang.Process; import java.lang.InterruptedException; + public class WindowsUpdatePostProcessor implements UpdatePostProcessor { private final Log _log = I2PAppContext.getGlobalContext().logManager().getLog(WindowsUpdatePostProcessor.class); protected Router i2pRouter = null; public void updateDownloadedandVerified(UpdateType type, int fileType, String version, File file) throws IOException { if (fileType == 6) { - newFile = moveUpdateInstaller(file); + File newFile = moveUpdateInstaller(file); runUpdateInstaller(newFile); } } private File moveUpdateInstaller(File file){ - RouterContext i2pContext = i2prouter.getRouterContext(); + RouterContext i2pContext = i2pRouter.getContext(); if (i2pContext != null) { File appDir = i2pContext.getAppDir(); - File newFile = new File(i2pContext.getAppDir().getAbsolutePath(), file.Name()); + File newFile = new File(i2pContext.getAppDir().getAbsolutePath(), file.getName()); file.renameTo(newFile); return newFile; } @@ -41,7 +44,7 @@ public class WindowsUpdatePostProcessor implements UpdatePostProcessor { pb.start(); } catch (IOException ex) { if (_log.shouldWarn()) - _log.warn("Unable to loop update-program in background. Update will fail." + xi2plocation); + _log.warn("Unable to loop update-program in background. Update will fail."); } }