Merge lp:~twom/launchpad-buildd/close-directory-tar into lp:launchpad-buildd

Proposed by Tom Wardill
Status: Merged
Approved by: Colin Watson
Approved revision: 417
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: lp:~twom/launchpad-buildd/close-directory-tar
Merge into: lp:launchpad-buildd
Diff against target: 31 lines (+10/-1)
2 files modified
debian/changelog (+7/-1)
lpbuildd/oci.py (+3/-0)
To merge this branch: bzr merge lp:~twom/launchpad-buildd/close-directory-tar
Reviewer Review Type Date Requested Status
Colin Watson Approve
Ioana Lasc Approve
Review via email: mp+381975@code.launchpad.net

Commit message

Always close the directory tar if we have one

Description of the change

The last tar that was created was closed. This lead to a corrupt file being created.
Cause it to always be closed if it's been opened.

To post a comment you must log in.
Revision history for this message
Ioana Lasc (ilasc) :
review: Approve
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2020-04-01 14:03:06 +0000
+++ debian/changelog 2020-04-09 07:52:26 +0000
@@ -1,6 +1,12 @@
1launchpad-buildd (189) UNRELEASED; urgency=medium
2
3 * Fix closing tar files in OCI builds
4
5 -- Tom Wardill <tom.wardill@canonical.com> Wed, 08 Apr 2020 16:50:47 +0000
6
1launchpad-buildd (188) xenial; urgency=medium7launchpad-buildd (188) xenial; urgency=medium
28
3 * Fix cwd for OCI builds, allows Dockerfile parameter. 9 * Fix cwd for OCI builds, allows Dockerfile parameter.
410
5 -- Tom Wardill <tom.wardill@canonical.com> Wed, 01 Apr 2020 14:02:00 +000011 -- Tom Wardill <tom.wardill@canonical.com> Wed, 01 Apr 2020 14:02:00 +0000
612
713
=== modified file 'lpbuildd/oci.py'
--- lpbuildd/oci.py 2020-02-26 10:52:29 +0000
+++ lpbuildd/oci.py 2020-04-09 07:52:26 +0000
@@ -189,6 +189,9 @@
189 tar.extract(file, extract_path)189 tar.extract(file, extract_path)
190 except Exception as e:190 except Exception as e:
191 print(e)191 print(e)
192 finally:
193 if directory_tar is not None:
194 directory_tar.close()
192195
193 # We need these mapping files196 # We need these mapping files
194 sha_directory = tempfile.mkdtemp()197 sha_directory = tempfile.mkdtemp()

Subscribers

People subscribed via source and target branches