From c8e7610ca914d80d60fda5111d520ff06186a38b Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Fri, 23 Dec 2016 13:08:09 +0100 Subject: [PATCH] Set the patch paths relative to the script, not the cwd. This way, we can run the script from everywhere. --- kiwix-build.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kiwix-build.py b/kiwix-build.py index 1cb4fa2..0505752 100755 --- a/kiwix-build.py +++ b/kiwix-build.py @@ -16,6 +16,7 @@ REMOTE_PREFIX = 'http://download.kiwix.org/dev/' SOURCE_DIR = pj(os.getcwd(), "SOURCE") ARCHIVE_DIR = pj(os.getcwd(), "ARCHIVE") +SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) ################################################################################ ##### UTILS @@ -175,7 +176,7 @@ class ReleaseDownloadMixin: def _patch(self, log): if not hasattr(self, 'patch'): raise SkipCommand() - with open(pj('patches', self.patch), 'r') as patch_input: + with open(pj(SCRIPT_DIR, 'patches', self.patch), 'r') as patch_input: run_command("patch -p1", self.source_path, log, input=patch_input) def prepare(self, options):