[Git][reproducible-builds/reprotest][wip-specify-build-path] clean up build artifacts and build directory, needed when using

Vagrant Cascadian (@vagrant) gitlab at salsa.debian.org
Thu Feb 22 22:48:24 UTC 2024



Vagrant Cascadian pushed to branch wip-specify-build-path at Reproducible Builds / reprotest


Commits:
9b0f5dcb by Vagrant Cascadian at 2024-02-22T14:45:03-08:00
clean up build artifacts and build directory, needed when using
--vary=build_path.path=/somepath/

- - - - -


1 changed file:

- reprotest/__init__.py


Changes:

=====================================
reprotest/__init__.py
=====================================
@@ -224,9 +224,13 @@ class BuildContext(collections.namedtuple('_BuildContext',
             testbed.check_exec2(shell_copy_pattern(dist_base, self.testbed_src, artifact_pattern))
         except:
             # workaround when build_path.path is not the defaults
-            # FIXME needs to do cleanup of the files too
             os.makedirs(build.tree, exist_ok=True)
             testbed.check_exec2(shell_copy_pattern(dist_base, build.tree, artifact_pattern))
+            # clean up artifacts and build directory
+            testbed.check_exec2(['sh', '-ec', 'cd "%s" && rm -rvf %s' %
+                                 (build.tree, artifact_pattern)])
+            testbed.check_exec2(['sh', '-ec', 'rmdir -v %s' % build.tree])
+
         # FIXME: `touch` is needed because of the FIXME in build.faketime(). we can rm it after that is fixed
         testbed.check_exec2(['sh', '-ec',
             r"""cd "{0}" && touch -d at 0 . .. {1}""".format(dist_base, artifact_pattern)])



View it on GitLab: https://salsa.debian.org/reproducible-builds/reprotest/-/commit/9b0f5dcb3272332fc7c6a0bf13e21403e54f3acd

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/reprotest/-/commit/9b0f5dcb3272332fc7c6a0bf13e21403e54f3acd
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20240222/a0dbfde9/attachment.htm>


More information about the rb-commits mailing list