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
1=== modified file 'debian/changelog'
2--- debian/changelog 2020-04-01 14:03:06 +0000
3+++ debian/changelog 2020-04-09 07:52:26 +0000
4@@ -1,6 +1,12 @@
5+launchpad-buildd (189) UNRELEASED; urgency=medium
6+
7+ * Fix closing tar files in OCI builds
8+
9+ -- Tom Wardill <tom.wardill@canonical.com> Wed, 08 Apr 2020 16:50:47 +0000
10+
11 launchpad-buildd (188) xenial; urgency=medium
12
13- * Fix cwd for OCI builds, allows Dockerfile parameter.
14+ * Fix cwd for OCI builds, allows Dockerfile parameter.
15
16 -- Tom Wardill <tom.wardill@canonical.com> Wed, 01 Apr 2020 14:02:00 +0000
17
18
19=== modified file 'lpbuildd/oci.py'
20--- lpbuildd/oci.py 2020-02-26 10:52:29 +0000
21+++ lpbuildd/oci.py 2020-04-09 07:52:26 +0000
22@@ -189,6 +189,9 @@
23 tar.extract(file, extract_path)
24 except Exception as e:
25 print(e)
26+ finally:
27+ if directory_tar is not None:
28+ directory_tar.close()
29
30 # We need these mapping files
31 sha_directory = tempfile.mkdtemp()

Subscribers

People subscribed via source and target branches