Merge lp:~charlesk/keeper/tar-creator-boogs into lp:keeper/devel

Proposed by Charles Kerr
Status: Needs review
Proposed branch: lp:~charlesk/keeper/tar-creator-boogs
Merge into: lp:keeper/devel
Diff against target: 90 lines (+21/-18)
1 file modified
src/tar/tar-creator.cpp (+21/-18)
To merge this branch: bzr merge lp:~charlesk/keeper/tar-creator-boogs
Reviewer Review Type Date Requested Status
unity-api-1-bot continuous-integration Needs Fixing
Unity API Team Pending
Review via email: mp+305842@code.launchpad.net

Commit message

Experimental branch, not for commit

Description of the change

I'm not getting enough traction on the lp:~charlesk/keeper/tar-creator-edge-cases branch, so this branch is a testing ground to add pieces from that branch to see what change is making the CI bot so unhappy.

To post a comment you must log in.
Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :
review: Needs Fixing (continuous-integration)
110. By Charles Kerr

re-enable libarchive's internal buffering

Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

PASSED: Continuous integration, rev:
https://jenkins.canonical.com/unity-api-1/job/lp-keeper-ci/79/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/667
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/673
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/488
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/488/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/488
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/488/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/488
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/488/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/488
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/488/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/488
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/488/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/488
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/488/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/488
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/488/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/488
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/488/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/488
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/488/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-keeper-ci/79/rebuild

review: Approve (continuous-integration)
Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

FAILED: Continuous integration, rev:110
https://jenkins.canonical.com/unity-api-1/job/lp-keeper-ci/80/
Executed test runs:
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build/668/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/674
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/489
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/489/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/489
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/489/artifact/output/*zip*/output.zip
    FAILURE: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/489/console
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/489
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/489/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/489
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/489/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/489
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/489/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/489
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/489/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/489
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/489/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/489
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/489/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-keeper-ci/80/rebuild

review: Needs Fixing (continuous-integration)

Unmerged revisions

110. By Charles Kerr

re-enable libarchive's internal buffering

109. By Charles Kerr

use new helper wrapped_archive_write_new() so that all our archive objects are created in a consistent way

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/tar/tar-creator.cpp'
2--- src/tar/tar-creator.cpp 2016-09-05 18:38:36 +0000
3+++ src/tar/tar-creator.cpp 2016-09-15 17:26:09 +0000
4@@ -68,10 +68,8 @@
5 // if this is the first step, create an archive
6 if (!step_archive_)
7 {
8- step_archive_.reset(archive_write_new(), [](struct archive* a){archive_write_free(a);});
9- archive_write_set_format_pax(step_archive_.get());
10- if (compress_)
11- archive_write_add_filter_xz(step_archive_.get());
12+qDebug() << "new archive";
13+ step_archive_ = wrapped_archive_write_new(compress_);
14 archive_write_open(step_archive_.get(), &step_buf_, nullptr, append_bytes_write_cb, nullptr);
15
16 step_file_.reset();
17@@ -202,20 +200,18 @@
18 {
19 ssize_t archive_size {};
20
21- auto a = archive_write_new();
22- archive_write_set_format_pax(a);
23- archive_write_open(a, &archive_size, nullptr, count_bytes_write_cb, nullptr);
24+ auto a = wrapped_archive_write_new(false);
25+ archive_write_open(a.get(), &archive_size, nullptr, count_bytes_write_cb, nullptr);
26
27 for (const auto& filename : filenames_)
28 {
29- add_file_header_to_archive(a, filename);
30+ add_file_header_to_archive(a.get(), filename);
31
32 // libarchive pads any missing data,
33 // so we don't need to call archive_write_data()
34 }
35
36- archive_write_close(a);
37- archive_write_free(a);
38+ archive_write_close(a.get());
39 return archive_size;
40 }
41
42@@ -223,14 +219,12 @@
43 {
44 ssize_t archive_size {};
45
46- auto a = archive_write_new();
47- archive_write_set_format_pax(a);
48- archive_write_add_filter_xz(a);
49- archive_write_open(a, &archive_size, nullptr, count_bytes_write_cb, nullptr);
50+ auto a = wrapped_archive_write_new(true);
51+ archive_write_open(a.get(), &archive_size, nullptr, count_bytes_write_cb, nullptr);
52
53 for (const auto& filename : filenames_)
54 {
55- add_file_header_to_archive(a, filename);
56+ add_file_header_to_archive(a.get(), filename);
57
58 // process the file
59 QFile file(filename);
60@@ -242,7 +236,7 @@
61 if (n_read == 0)
62 break;
63 if (n_read > 0)
64- archive_write_data(a, buf, size_t(n_read));
65+ archive_write_data(a.get(), buf, size_t(n_read));
66 if (n_read < 0) {
67 auto errstr = QStringLiteral("Reading '%1' returned %2 (%3)")
68 .arg(file.fileName())
69@@ -254,11 +248,20 @@
70 }
71 }
72
73- archive_write_close(a);
74- archive_write_free(a);
75+ archive_write_close(a.get());
76 return archive_size;
77 }
78
79+ static std::shared_ptr<struct archive> wrapped_archive_write_new(bool compress)
80+ {
81+ auto archive = archive_write_new();
82+ archive_write_set_format_pax(archive);
83+ //archive_write_set_bytes_per_block(archive, 0);
84+ if (compress)
85+ archive_write_add_filter_xz(archive);
86+ return std::shared_ptr<struct archive>(archive, [](struct archive* a){archive_write_free(a);});
87+ }
88+
89 const QStringList filenames_;
90 const bool compress_ {};
91

Subscribers

People subscribed via source and target branches

to all changes: