Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apt: Fix matching gstreamer pkgs where the only modifier is ()(64bit) #810

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions backends/apt/gst-matcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,21 @@ GstMatcher::GstMatcher(gchar **values)
if (!opt.empty()) {
size_t start_pos = 0;
// This is hardcoded in pk-gstreamer-install, so we also hardcode it here
const string x86_64 = "()(64bit";
const string x86_64 = ")(64bit";

if (ends_with(opt.c_str(), x86_64.c_str())) {
// We hardcode 64bit -> amd64 here
arch = "amd64";
// -1 -> remove the last )
opt.erase(opt.end() - x86_64.length() - 1, opt.end());
opt.erase(opt.end() - x86_64.length(), opt.end());
}

// Replace all ")(" with "," - convert from input to serialized caps format
while ((start_pos = opt.find(")(", start_pos)) != string::npos) {
if (start_pos == opt.length()-2) {
// Avoid trailing comma
opt.erase(start_pos, 2);
break;
}
opt.replace(start_pos, 2, ",");
start_pos++;
}
Expand Down
4 changes: 3 additions & 1 deletion backends/apt/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ c_args = ['-DG_LOG_DOMAIN="PackageKit-APT"',
'-DDATADIR="@0@"'.format(join_paths(get_option('prefix'), get_option('datadir'))),
]

shared_module(
packagekit_backend_apt_module = shared_module(
'pk_backend_apt',
'pk-backend-apt.cpp',
'acqpkitstatus.cpp',
Expand Down Expand Up @@ -116,3 +116,5 @@ if get_option('systemd')
install_dir: systemd_user_unit_dir,
)
endif

subdir('tests')
Loading