From 5df2c5dbdb336da71119f6c59393c08220bbbab3 Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Sat, 7 Jan 2023 00:59:38 +0100 Subject: [PATCH 1/2] Ancora sul build. Aggiunte stringhe per debugging. --- loaih/build.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/loaih/build.py b/loaih/build.py index 804fe0a..abfb12e 100644 --- a/loaih/build.py +++ b/loaih/build.py @@ -80,6 +80,9 @@ class Build(loaih.RemoteBuild): def calculate(self): """Calculate exclusions and other variables.""" + + print("--- Calculate Phase ---") + # AppName if self.query in { 'prerelease', 'daily' }: self.appname = 'LibreOfficeDev' @@ -132,6 +135,9 @@ class Build(loaih.RemoteBuild): def check(self): """Checking if the requested AppImage has been already built.""" + + print("--- Check Phase ---") + if len(self.appimagefilename) != 2: self.calculate() @@ -184,6 +190,9 @@ class Build(loaih.RemoteBuild): def download(self): """Downloads the contents of the URL as it was a folder.""" + + print("--- Download Phase ---") + print(f"Started downloads for {self.version}. Please wait.") for arch in self.arch: # Checking if a valid path has been provided @@ -227,6 +236,8 @@ class Build(loaih.RemoteBuild): def build(self): """Building all the versions.""" + print("--- Building Phase ---") + for arch in self.arch: if self.built[arch]: # Already built for arch or path not available. User has already been warned. @@ -364,8 +375,6 @@ class Build(loaih.RemoteBuild): ), env={ "VERSION": self.appversion }, check=True) print(f"Built AppImage version {self.appversion}") - # Setting it to built. - self.built[arch] = True # Cleanup phase, before new run. for deb in glob.glob(self.appnamedir + '/*.deb'): @@ -378,6 +387,9 @@ class Build(loaih.RemoteBuild): def checksums(self): """Create checksums of the built versions.""" # Skip checksum if initally the build was already found in the storage directory + + print("--- Checksum Phase ---") + if all(self.built[arch] for arch in self.arch): return @@ -386,6 +398,7 @@ class Build(loaih.RemoteBuild): if self.built[arch]: for item in [ self.appimagefilename[arch], self.zsyncfilename[arch] ]: # For any built arch, find out if a file exist. + print(f"DEBUG: checkumming {item}.") self.__create_checksum__(item) From 0a18586201c8e93c3245e4eb570730083694d62f Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Sat, 7 Jan 2023 01:03:21 +0100 Subject: [PATCH 2/2] Aggiunta testo per fasi. Rivista procedura. --- loaih/build.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/loaih/build.py b/loaih/build.py index abfb12e..a0f021d 100644 --- a/loaih/build.py +++ b/loaih/build.py @@ -395,11 +395,15 @@ class Build(loaih.RemoteBuild): os.chdir(self.appnamedir) for arch in self.arch: - if self.built[arch]: + if not self.built[arch]: + # Here's the contrary. A newly built package has not yet been + # marked as built. for item in [ self.appimagefilename[arch], self.zsyncfilename[arch] ]: - # For any built arch, find out if a file exist. - print(f"DEBUG: checkumming {item}.") - self.__create_checksum__(item) + itempath = os.path.join(self.appnamedir, item) + if os.path.exists(itempath): + # For any built arch, find out if a file exist. + print(f"DEBUG: checkumming {item}.") + self.__create_checksum__(item) def __create_checksum__(self, file): @@ -418,7 +422,7 @@ class Build(loaih.RemoteBuild): def publish(self): """Moves built versions to definitive storage.""" - print("DEBUG: reached publish.") + print("--- Publish Phase ---") if all(self.built[arch] for arch in self.arch): # All files are already present in the full_path @@ -454,6 +458,9 @@ class Build(loaih.RemoteBuild): def generalize_and_link(self, chdir = 'default'): """Creates the needed generalized files if needed.""" + + print("--- Generalize and Link Phase ---") + # If called with a pointed version, no generalize and link necessary. if not self.branch_version: return