]>
git.saurik.com Git - apt.git/blob - apt-pkg/versionmatch.h
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: versionmatch.h,v 1.4 2001/05/29 03:07:12 jgg Exp $
4 /* ######################################################################
8 This module takes a matching string and a type and locates the version
9 record that satisfies the constraint described by the matching string.
12 Release: o=Debian,v=2.1*,c=main
17 Origin: ftp.debian.org
19 Release may be a complex type that can specify matches for any of:
20 Version (v= with prefix)
22 Archive (a=) eg, unstable, testing, stable
23 Codename (n=) e.g. etch, lenny, squeeze, sid
26 Binary Architecture (b=)
27 If there are no equals signs in the string then it is scanned in short
28 form - if it starts with a number it is Version otherwise it is an
29 Archive or a Codename.
31 Release may be a '*' to match all releases.
33 ##################################################################### */
35 #ifndef PKGLIB_VERSIONMATCH_H
36 #define PKGLIB_VERSIONMATCH_H
38 #include <apt-pkg/pkgcache.h>
39 #include <apt-pkg/cacheiterators.h>
43 #ifndef APT_8_CLEANER_HEADERS
54 std::string RelVerStr
;
55 bool RelVerPrefixMatch
;
56 std::string RelOrigin
;
57 std::string RelRelease
;
58 std::string RelCodename
;
59 std::string RelArchive
;
61 std::string RelComponent
;
62 std::string RelArchitecture
;
70 enum MatchType
{None
= 0,Version
,Release
,Origin
} Type
;
72 bool MatchVer(const char *A
,std::string B
,bool Prefix
) APT_PURE
;
73 bool ExpressionMatches(const char *pattern
, const char *string
);
74 bool ExpressionMatches(const std::string
& pattern
, const char *string
);
75 bool FileMatch(pkgCache::PkgFileIterator File
);
76 pkgCache::VerIterator
Find(pkgCache::PkgIterator Pkg
);
78 pkgVersionMatch(std::string Data
,MatchType Type
);