Skip to content
Open
Changes from 1 commit
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
Next Next commit
fix: dpkg find copyright
  • Loading branch information
bmsuseluda committed Dec 13, 2024
commit f7f3fb8f8da1544b90e6c13a18629b6bd404a104
8 changes: 5 additions & 3 deletions src/core/copyright/copyright_dpkgquery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ namespace linuxdeploy {
ldLog() << LD_DEBUG << "Canonical path" << realpath << "not equivalent to" << path << std::endl;
}

subprocess::subprocess proc{{"dpkg-query", "-S", realpath.c_str()}};
const auto filename = fs::path(realpath).filename();

subprocess::subprocess proc{{"dpkg-query", "-S", filename.c_str()}};

auto result = proc.run();

if (result.exit_code() != 0 || result.stdout_contents().empty()) {
ldLog() << LD_WARNING << "Could not find copyright files for file" << path << "using dpkg-query"
ldLog() << LD_WARNING << "Could not find copyright files for file" << realpath << "using dpkg-query"
<< std::endl;
return {};
}
Expand All @@ -35,7 +37,7 @@ namespace linuxdeploy {
return {copyrightFilePath};
}
} else {
ldLog() << LD_WARNING << "Could not find copyright files for file" << path << "using dpkg-query"
ldLog() << LD_WARNING << "Could not find copyright files for file" << realpath << "using dpkg-query"
<< std::endl;
}

Expand Down