Port to APT 1.9.0
ClosedPublic

Authored by klode on Jun 19 2019, 10:19 AM.

Details

Summary

Ignore missing apt-inst library, merged into apt-pkg in apt 1.9

Include additional headers needed in apt 1.9

APT 1.9 dropped some includes from headers, so we actually
need to include the headers we're using.

Use std::string instead of string

APT 1.9 drops a few "using" uses in headers, so we have to use
the namespaced name now.

Port to APT::Upgrade

Port pin writing to pkgTagSection::Write()

Use GetCandidateVersion() instead of GetCandidateVer()

GetCandidateVer() never actually returned the correct candidate,
so this probably also fixes something.

src/package.cpp: Use candidate version's section

Packages do not really have a section, this moved to Version a few
years ago (they can differ between versions). Let's just use the
candidate's section, if there is one.

Port Package::md5Sum()

Probably want to export HashStringList instead

Port pkgAcquire setup to use constructor

The Setup() method went away, use the constructor instead.

Use all hashes in aptWorker when acquiring files

Seriously

worker: Include unistd.h for usleep()

usleep() is defined in that header, but the header is not
included.

Read CurrentSize from CurrentItem rather than worker

APT 1.9.0 moves CurrentSize to items, so we use CurrentItem
for now - but that should go away so we can have multiple
current items for http/2 later.

Use ActiveSubprocess instead of Mode

Use APT::Progress::PackageManager for install progress

Diff Detail

Repository
R548 QAPT Library
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
klode created this revision.Jun 19 2019, 10:19 AM
Owners added a reviewer: Restricted Owners Package.Jun 19 2019, 10:19 AM
klode requested review of this revision.Jun 19 2019, 10:19 AM

I hope I did everything right, first time I used this. After running arc diff, my local branch is messed up and has a new commit description for the last commit, wgich became:

commit 74a1a56888f2035b46283003b0d83455a22bb06f
Author: Julian Andres Klode <julian.klode@canonical.com>
Date:   Wed Jun 19 12:01:15 2019 +0200

    Port to APT 1.9.0
    
    Summary:
    Ignore missing apt-inst library, merged into apt-pkg in apt 1.9
    
    Include additional headers needed in apt 1.9
    
    APT 1.9 dropped some includes from headers, so we actually
    need to include the headers we're using.
    
    Use std::string instead of string
    
    APT 1.9 drops a few "using" uses in headers, so we have to use
    the namespaced name now.
    
    Port to APT::Upgrade
    
    Port pin writing to pkgTagSection::Write()
    
    Use GetCandidateVersion() instead of GetCandidateVer()
    
    GetCandidateVer() never actually returned the correct candidate,
    so this probably also fixes something.
    
    src/package.cpp: Use candidate version's section
    
    Packages do not really have a section, this moved to Version a few
    years ago (they can differ between versions). Let's just use the
    candidate's section, if there is one.
    
    Port Package::md5Sum()
    
    Probably want to export HashStringList instead
    
    Port pkgAcquire setup to use constructor
    
    The Setup() method went away, use the constructor instead.
    
    Use all hashes in aptWorker when acquiring files
    
    Seriously
    
    worker: Include unistd.h for usleep()
    
    usleep() is defined in that header, but the header is not
    included.
    
    Read CurrentSize from CurrentItem rather than worker
    
    APT 1.9.0 moves CurrentSize to items, so we use CurrentItem
    for now - but that should go away so we can have multiple
    current items for http/2 later.
    
    Use ActiveSubprocess instead of Mode
    
    Use APT::Progress::PackageManager for install progress
    
    Reviewers: O3 libqapt & debconf-kde
    
    Differential Revision: https://phabricator.kde.org/D21896
sitter added a subscriber: sitter.Jun 19 2019, 1:22 PM

Not your fault, arc is just garbage and squashes all commits into a single diff. One of many reasons why KDE is preparing a migration to gitlab.
I think you can simply checkout back to the object id listed in git reflog to get back to the original history. If you push that to github or somewhere we can simply merge that instead of the squashed commit arc created.

Review-wise it makes little difference. Unfortunately I don't think I'll get it done today, so it will have to wait until Monday unless someone else wants to review the changes. At glance this looks good to go though.

apol accepted this revision.Jun 19 2019, 5:17 PM
This revision is now accepted and ready to land.Jun 19 2019, 5:17 PM
sitter accepted this revision.Jun 24 2019, 11:21 AM
This revision was automatically updated to reflect the committed changes.