From ef7202a7c65d487baf38f8edca6c664c67c74314 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Sat, 19 Mar 2022 23:15:31 +0100 Subject: [PATCH] Correzione percorsi, creazione altre cartelle necessarie. --- build.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/build.py b/build.py index 6293434..be14453 100644 --- a/build.py +++ b/build.py @@ -68,7 +68,7 @@ class Build(object): #buildtarballs.extend([ x for x in self.__tarballs__ if ('helppack_'+ lang) in x ]) # Creating a subfolder - os.makedirs(os.path.join(self.__builddir__, self.__appname__, self.__appname__ + '.AppImage'), exist_ok = True) + os.makedirs(os.path.join(self.__builddir__, self.__appname__, self.__appname__ + '.AppDir'), exist_ok = True) # And then cd to the appname folder. os.chdir(os.path.join(self.__builddir__, self.__appname__)) @@ -77,18 +77,19 @@ class Build(object): subprocess.run("tar xzf ../%s" % archive, shell=True) # At this point, let's decompress the deb packages - os.chdir(os.path.join(self.__builddir__, self.__appname__, self.__appname__ + '.AppImage')) + os.chdir(os.path.join(self.__builddir__, self.__appname__, self.__appname__ + '.AppDir')) subprocess.run("find .. -iname '*.deb' -exec dpkg -x {} . \;", shell=True) # Changing desktop file subprocess.run("find . -iname startcenter.desktop -exec cp {} . \;", shell=True) subprocess.run("sed -i -e 's|Name=.*|Name=%s|g' startcenter.desktop" % self.__appname__, shell=True) subprocess.run("find . -name startcenter.png -path '*hicolor*48x48*' -exec cp {} \;", shell=True) - binaryname = subprocess.check_output("awk 'BEGIN { FS = \"=\" } /^Exec/ { print $2; exit }' startcenter.desktop | awk '{ print $1 }'", shell=True).strip('\n') - subprocess.run("rm -f usr/bin/%s" % binaryname, shell=True) - os.chdir(os.path.join(self.__builddir__, self.__appname__, self.__appname__ + '.AppImage', 'usr', 'bin')) + binaryname = subprocess.check_output("awk 'BEGIN { FS = \"=\" } /^Exec/ { print $2; exit }' startcenter.desktop | awk '{ print $1 }'", shell=True).decode('utf-8').strip('\n') + os.makedirs(os.path.join(self.__builddir__, self.__appname__, self.__appname__ + '.AppDir', 'usr', 'bin')) + + os.chdir(os.path.join(self.__builddir__, self.__appname__, self.__appname__ + '.AppDir', 'usr', 'bin')) subprocess.run("find ../../opt -name soffice -path '*programm*' -exec ln -s {} %si \;" % binaryname, shell=True) - os.chdir(os.path.join(self.__builddir__, self.__appname__, self.__appname__ + '.AppImage')) + os.chdir(os.path.join(self.__builddir__, self.__appname__, self.__appname__ + '.AppDir')) # Download AppRun from github apprunurl = "https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-{arch}".format(arch = self.__arch__) @@ -109,11 +110,7 @@ class Build(object): # Copying built image to final directory subprocess.run("find . -iname '*.AppImage' -exec cp {} %s \;" % outdir, shell = True) os.chdir('/tmp') - - def __del__(self): - """Destructor for the class.""" - # Cleanup - del self.__builddir__ + del self.__builddir__ if __name__ == '__main__':