diff options
author | Julian Andres Klode <jak@debian.org> | 2023-03-06 09:23:20 +0000 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2023-03-06 09:23:20 +0000 |
commit | 278f542caf92750aed06dae88f066fa01f3f09ac (patch) | |
tree | a6d93d465bff1f11c81575d3e397a9da359798f7 | |
parent | a4aa4c61498fd542ff65b340157db3a4a0a87f60 (diff) | |
parent | 557aed9806b59bebac33f4589bafc25fcb8a2728 (diff) |
Merge branch 'pu/never-sections-matching' into 'main'
Fix permissions && change section matching in config files to be more gitignore style rightmost match
See merge request apt-team/apt!286
-rw-r--r-- | apt-pkg/depcache.cc | 4 | ||||
-rw-r--r-- | cmdline/apt-mark.cc | 4 | ||||
-rwxr-xr-x | test/integration/test-apt-get-update-sourceslist-warning | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index b19d180a4..322bf1bbe 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -90,10 +90,10 @@ static bool SectionInSubTree(char const * const SubTree, std::string_view Needle { if (ConfigValueInSubTree(SubTree, Needle)) return true; - auto const sub = Needle.find('/'); + auto const sub = Needle.rfind('/'); if (sub == std::string_view::npos) { - std::string special{"<undefined>/"}; + std::string special{"/"}; special.append(Needle); return ConfigValueInSubTree(SubTree, special); } diff --git a/cmdline/apt-mark.cc b/cmdline/apt-mark.cc index 46d3ca5b8..3f3b008ba 100644 --- a/cmdline/apt-mark.cc +++ b/cmdline/apt-mark.cc @@ -163,10 +163,10 @@ static bool SectionInSubTree(char const * const SubTree, std::string_view Needle { if (ConfigValueInSubTree(SubTree, Needle)) return true; - auto const sub = Needle.find('/'); + auto const sub = Needle.rfind('/'); if (sub == std::string_view::npos) { - std::string special{"<undefined>/"}; + std::string special{"/"}; special.append(Needle); return ConfigValueInSubTree(SubTree, special); } diff --git a/test/integration/test-apt-get-update-sourceslist-warning b/test/integration/test-apt-get-update-sourceslist-warning index 60c8d7308..02e1ccb29 100755 --- a/test/integration/test-apt-get-update-sourceslist-warning +++ b/test/integration/test-apt-get-update-sourceslist-warning @@ -21,11 +21,11 @@ Architectures: amd64 Components: main contrib non-free non-free-firmware Description: Debian x.y Bookworm - Not Released EOF -chmod 644 rootdir/var/lib/apt/lists/example.org_debian_dists_bookworm_Release touch rootdir/var/lib/apt/lists/example.org_debian_dists_bookworm_main_binary-amd64_Packages touch rootdir/var/lib/apt/lists/example.org_debian_dists_bookworm_contrib_binary-amd64_Packages touch rootdir/var/lib/apt/lists/example.org_debian_dists_bookworm_non-free_binary-amd64_Packages touch rootdir/var/lib/apt/lists/example.org_debian_dists_bookworm_non-free-firmware_binary-amd64_Packages +find rootdir/var/lib/apt/lists/ -type f -exec chmod 644 {} \; NOTESURL='https://www.debian.org/releases/bookworm/amd64/release-notes/ch-information.html#non-free-split' BOILERPLATE='Reading package lists... |