]> git.pld-linux.org Git - packages/poldek.git/blame - poldek-add-arch-match.patch
- rel .40; one more zlib fix
[packages/poldek.git] / poldek-add-arch-match.patch
CommitLineData
3ca8d788
BZ
1diff --git a/conf/poldek.conf b/conf/poldek.conf
2index 13b1e21..24c34a0 100644
3--- a/conf/poldek.conf
4+++ b/conf/poldek.conf
5@@ -130,9 +130,11 @@
6 choose equivalents manually = yes
7
8 # Prevent package listed from being upgraded if they are already installed.
9+# hold = kernel* foo*.i686 th-test:* *-smp-* th-ready:bar*.x86_64
10 hold = kernel*
11
12 # Ignore package list - packages fits given mask will be invisible.
13+# Masks are same as above.
14 # ignore = *-smp-* foo*
15 ignore = vserver-packages
16 #ignore =
17diff --git a/pkgscore.c b/pkgscore.c
18index f2a527c..0908410 100644
19--- a/pkgscore.c
20+++ b/pkgscore.c
21@@ -113,23 +113,28 @@ void pkgscore_match_init(struct pkgscore_s *psc, struct pkg *pkg)
22 n += n_snprintf(psc->pkgbuf, sizeof(psc->pkgbuf),
23 "%s:", pkg->pkgdir->name);
24
25+ // pkgname_off - size of pkgdir_name
26 psc->pkgname_off = n;
27+ // pkgbuf - "repo_name:name-ver-rel.arch"
28
29- pkg_snprintf(&psc->pkgbuf[n], sizeof(psc->pkgbuf) - n, pkg);
30+ n_snprintf(&psc->pkgbuf[n], sizeof(psc->pkgbuf) - n, "%s-%s-%s.%s", pkg->name, pkg->ver, pkg->rel, pkg_arch(pkg));
31 psc->pkg = pkg;
32 }
33
34
35-
36+// return 0 if not match
37 int pkgscore_match(struct pkgscore_s *psc, const char *mask)
38 {
39+ // match name
40 if (fnmatch(mask, psc->pkg->name, 0) == 0)
41 return 1;
42
43+ // match name-ver-rel.arch as string
44 if (psc->pkgname_off &&
45 fnmatch(mask, &psc->pkgbuf[psc->pkgname_off], 0) == 0)
46 return 1;
47
48+ // match "repo_name:name-ver-rel.arch" as string
49 return fnmatch(mask, psc->pkgbuf, 0) == 0;
50 }
51
This page took 0.20502 seconds and 4 git commands to generate.