Skip to content

Commit

Permalink
Upgrade to libdnf5 5.2 in Fedora 41.
Browse files Browse the repository at this point in the history
Also dnf is dnf5 by default so tests need to adapt to it.
  • Loading branch information
adelton committed Nov 10, 2024
1 parent 2ef4bab commit 8f4fe5b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ fedora-38, fedora-39, fedora-40 ]
os: [ fedora-latest, fedora-rawhide ]
steps:
- uses: actions/checkout@v2
- name: Set the right OS in the Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion libdnf-plugin-swidtags.spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Summary: Keeping SWID tags in sync with rpms installed via libdnf5-based tools
Name: libdnf5-plugin-swidtags
Version: 5.0.0
Version: 5.2.0
Release: 0%{?dist}
URL: https://github.com/swidtags/%{name}
Source0: https://github.com/swidtags/libdnf-plugin-swidtags/releases/download/libdnf-plugin-swidtags-%{version}/%{name}-%{version}.tar.gz
Expand Down
11 changes: 6 additions & 5 deletions swidtags_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

#include <libdnf5/plugin/iplugin.hpp>
#include <libdnf5/base/base.hpp>

#include <libxml++/parsers/textreader.h>
Expand All @@ -41,8 +42,8 @@ using namespace libdnf5;

namespace {

constexpr const char * PLUGIN_NAME = "swidtags";
constexpr plugin::Version PLUGIN_VERSION{5, 0, 0};
constexpr const char * PLUGIN_NAME { "swidtags" };
constexpr plugin::Version PLUGIN_VERSION{.major = 5, .minor = 2, .micro = 0};

constexpr const char * attrs[]{"author.name", "author.email", "description", nullptr};
constexpr const char * attrs_value[]{"Jan Pazdziora", "[email protected]", "Plugin to keep SWID tags in sync with rpms."};
Expand Down Expand Up @@ -290,7 +291,7 @@ static void remove_swidtag_file(const std::string &checksum, const int debug_lev

class Swidtags : public plugin::IPlugin {
public:
Swidtags(libdnf5::Base & base, libdnf5::ConfigParser &) : IPlugin(base) {}
Swidtags(libdnf5::plugin::IPluginData & data, libdnf5::ConfigParser &) : IPlugin(data) {}
virtual ~Swidtags() {
removed_packages_checksums.clear();
}
Expand Down Expand Up @@ -437,9 +438,9 @@ plugin::Version libdnf_plugin_get_version(void) {

plugin::IPlugin * libdnf_plugin_new_instance(
[[maybe_unused]] LibraryVersion library_version,
libdnf5::Base & base,
libdnf5::plugin::IPluginData & data,
libdnf5::ConfigParser & parser) try {
return new Swidtags(base, parser);
return new Swidtags(data, parser);
} catch (...) {
return nullptr;
}
Expand Down
8 changes: 4 additions & 4 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ else
fi
RUN_MICRODNF="$FAKECHROOT chroot $MICRODNF_ROOT"

cp -rp /var/cache/dnf ${MICRODNF_ROOT}var/cache
$FAKEROOT dnf --releasever "$( rpm --qf '%{version}\n' -q --whatprovides system-release )" --installroot $MICRODNF_ROOT --setopt=tsflags=noscripts --noplugins install --downloadonly -y filesystem
( cd $MICRODNF_ROOT && find var/cache/dnf -name 'filesystem*.rpm' | xargs rpm2cpio | cpio -id )
cp -rp /var/cache/libdnf5 ${MICRODNF_ROOT}var/cache
$FAKEROOT dnf --use-host-config --releasever "$( rpm --qf '%{version}\n' -q --whatprovides system-release )" --installroot $MICRODNF_ROOT --setopt=tsflags=noscripts --noplugins install --downloadonly -y filesystem
( cd $MICRODNF_ROOT && find var/cache/libdnf5 -name 'filesystem*.rpm' | xargs rpm2cpio | cpio -id )
chmod -R u+w $MICRODNF_ROOT
$FAKECHROOT $FAKEROOT dnf --releasever "$( rpm --qf '%{version}\n' -q --whatprovides system-release )" --installroot $MICRODNF_ROOT --setopt=tsflags=noscripts --disableplugin='*' install -y microdnf
$FAKECHROOT $FAKEROOT dnf --use-host-config --releasever "$( rpm --qf '%{version}\n' -q --whatprovides system-release )" --installroot $MICRODNF_ROOT --setopt=tsflags=noscripts --disableplugin='*' install -y microdnf

if ! [ -f ${MICRODNF_ROOT}usr/lib/os-release ] ; then
cp /usr/lib/os-release ${MICRODNF_ROOT}usr/lib/
Expand Down
4 changes: 2 additions & 2 deletions tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM registry.fedoraproject.org/fedora:38
RUN dnf install -y rpm-build make "dnf-command(builddep)" fakechroot /usr/bin/getopt
FROM registry.fedoraproject.org/fedora:41
RUN dnf install -y rpm-build make fakechroot /usr/bin/getopt
COPY . /src/
WORKDIR /src
RUN make srpm
Expand Down

0 comments on commit 8f4fe5b

Please sign in to comment.