diff --git a/build.py b/build.py index f9757a4..6ff1393 100644 --- a/build.py +++ b/build.py @@ -77,13 +77,13 @@ class Build(object): self.__unpackbuild__('standard', False) # Run to build standard full help - self.__unpackbuild__('standard', True) + #self.__unpackbuild__('standard', True) # Build full no help - self.__unpackbuild__('full', False) + #self.__unpackbuild__('full', False) # Full with help - self.__unpackbuild__('full', True) + #self.__unpackbuild__('full', True) def __unpackbuild__(self, languageset = 'full', offlinehelp = False): # We start by filtering out tarballs from the list @@ -109,29 +109,28 @@ class Build(object): for archive in buildtarballs: subprocess.run("tar xzf {folder}/{archive}".format(folder = self.__downloaddir__, archive = archive), shell=True) - os.chdir(self.appimagedir) + os.chdir(self.appnamedir) # At this point, let's decompress the deb packages - subprocess.run("find .. -iname '*.deb' -exec dpkg -x {} . \;", shell=True) + subprocess.run("find .. -iname '*.deb' -exec dpkg -x {} . \;", shell=True, cwd=self.appimagedir) # Changing desktop file - subprocess.run("find . -iname startcenter.desktop -exec cp {} . \;", shell=True) + subprocess.run("find . -iname startcenter.desktop -exec cp {} . \;", shell=True, cwd=self.appimagedir) appname = 'LibreOffice' if not self.__query__ == 'daily' else 'LibreOfficeDev' - subprocess.run("sed -i -e 's:^Name=.*$:Name=%s:' startcenter.desktop" % appname, shell=True) + subprocess.run("sed -i -e 's:^Name=.*$:Name=%s:' startcenter.desktop" % appname, shell=True, cwd=self.appimagedir) - subprocess.run("find . -name '*startcenter.png' -path '*hicolor*48x48*' -exec cp {} . \;", shell=True) + subprocess.run("find . -name '*startcenter.png' -path '*hicolor*48x48*' -exec cp {} . \;", shell=True, cwd=self.appimagedir) # Find the name of the binary called in the desktop file. - binaryname = subprocess.check_output("awk 'BEGIN { FS = \"=\" } /^Exec/ { print $2; exit }' startcenter.desktop | awk '{ print $1 }'", shell=True).decode('utf-8').strip('\n') + binaryname = subprocess.check_output("awk 'BEGIN { FS = \"=\" } /^Exec/ { print $2; exit }' startcenter.desktop | awk '{ print $1 }'", shell=True, cwd=self.appimagedir).decode('utf-8').strip('\n') bindir=os.path.join(self.appimagedir, 'usr', 'bin') os.makedirs(bindir, exist_ok = True) - os.chdir(bindir) - subprocess.run("find ../../opt -name soffice -path '*programm*' -exec ln -s {} %s \;" % binaryname, shell=True) + subprocess.run("find ../../opt -iname soffice -path '*programm*' -exec ln -sf {} %s \;" % binaryname, shell=True, cwd=bindir) # Download AppRun from github - os.chdir(self.appimagedir) apprunurl = "https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-{arch}".format(arch = self.__arch__) - urllib.request.urlretrieve(apprunurl, 'AppRun') - os.chmod('AppRun', 0o755) + dest = os.path.join(self.appimagedir, 'AppRun') + urllib.request.urlretrieve(apprunurl, dest) + os.chmod(dest, 0o755) # Setting app version appversion = self.__version__ + '.' + languageset @@ -139,13 +138,11 @@ class Build(object): appversion += '.help' # Building app - os.chdir(self.appnamedir) subprocess.run("VERSION={version} ./appimagetool -v ./{appname}.AppDir/".format(version = appversion, appname = self.__appname__), shell=True) print("Built AppImage version {version}".format(version = appversion)) # Cleanup phase, before new run. - os.chdir(self.appnamedir) for deb in glob.glob(self.appnamedir + '/*.deb'): os.remove(deb) subprocess.run("find . -type d -maxdepth 1 -exec rm -rf {} \+", shell=True) @@ -167,7 +164,7 @@ class Build(object): def __del__(self): """Destructor""" - del self.__builddir__ + #del self.__builddir__ if __name__ == '__main__':