diff options
author | Julian Andres Klode <jak@debian.org> | 2016-09-01 00:53:40 +0200 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2016-09-01 00:53:40 +0200 |
commit | 265c3312bd1b329dc9b54c754da46621d9019c11 (patch) | |
tree | e1c740747f84f793ee2b6ab4ffaffbc9f76cd575 /apt-pkg/policy.cc | |
parent | 28f0867d99398a23296ead313112402c51d4e876 (diff) | |
parent | 317bb39f3cd6626c74f25d7bdf2907f1b235f553 (diff) |
Merge tag '1.3_rc3' into ubuntu/master
apt Debian release 1.3~rc3
Diffstat (limited to 'apt-pkg/policy.cc')
-rw-r--r-- | apt-pkg/policy.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc index ff59fb0ac..3dd6ddac4 100644 --- a/apt-pkg/policy.cc +++ b/apt-pkg/policy.cc @@ -180,14 +180,13 @@ void pkgPolicy::CreatePin(pkgVersionMatch::MatchType Type,string Name, Name.erase(found); } - // Allow pinning by wildcards - // TODO: Maybe we should always prefer specific pins over non- - // specific ones. - if (Name[0] == '/' || Name.find_first_of("*[?") != string::npos) + // Allow pinning by wildcards - beware of package names looking like wildcards! + // TODO: Maybe we should always prefer specific pins over non-specific ones. + if ((Name[0] == '/' && Name[Name.length() - 1] == '/') || Name.find_first_of("*[?") != string::npos) { pkgVersionMatch match(Data, Type); for (pkgCache::GrpIterator G = Cache->GrpBegin(); G.end() != true; ++G) - if (match.ExpressionMatches(Name, G.Name())) + if (Name != G.Name() && match.ExpressionMatches(Name, G.Name())) { if (Arch.empty() == false) CreatePin(Type, string(G.Name()).append(":").append(Arch), Data, Priority); |