diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2000-08-05 18:03:16 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2000-08-05 18:03:16 +0000 |
commit | f3ea0a87be62670d780ee5b88d47cf73ccaf534c (patch) | |
tree | 6d345140404632136acf87b55a6162c120ce2937 /gendepslist2.cc | |
parent | f8776af6158bb82de3b381159e28fcb20daaff53 (diff) | |
download | rpmtools-f3ea0a87be62670d780ee5b88d47cf73ccaf534c.tar rpmtools-f3ea0a87be62670d780ee5b88d47cf73ccaf534c.tar.gz rpmtools-f3ea0a87be62670d780ee5b88d47cf73ccaf534c.tar.bz2 rpmtools-f3ea0a87be62670d780ee5b88d47cf73ccaf534c.tar.xz rpmtools-f3ea0a87be62670d780ee5b88d47cf73ccaf534c.zip |
no_comment
Diffstat (limited to 'gendepslist2.cc')
-rw-r--r-- | gendepslist2.cc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/gendepslist2.cc b/gendepslist2.cc index 9207e0e..810400c 100644 --- a/gendepslist2.cc +++ b/gendepslist2.cc @@ -73,6 +73,9 @@ typedef vector<string>::iterator ITv; typedef set<string>::iterator ITs; typedef map<string, set<string> >::iterator ITms; +bool start_with(const string &s, const char *prefix) { + return strncmp(s.c_str(), prefix, strlen(prefix)) == 0; +} @@ -164,9 +167,11 @@ void getRequires(FD_t fd, int current_hdlist) { hdlist2names[current_hdlist].insert(name); sizes[name] = get_int(header, RPMTAG_SIZE); - for (ITv p = l.begin(); p != l.end(); p++) { - ((*p)[0] == '/' ? frequires : requires)[name].push_back(*p); - ((*p)[0] == '/' ? all_frequires : all_requires).insert(*p); + for (ITv p = l.begin(); p != l.end(); p++) { + if (!start_with(*p, "rpmlib(")) { + ((*p)[0] == '/' ? frequires : requires)[name].push_back(*p); + ((*p)[0] == '/' ? all_frequires : all_requires).insert(*p); + } } headerFree(header); } @@ -174,10 +179,6 @@ void getRequires(FD_t fd, int current_hdlist) { for (ITs p = all_frequires.begin(); p != all_frequires.end(); p++) fprovided_by[*p] = *(new vector<string>); } -bool notfound(const string &s) { - return strncmp(s.c_str(), "NOTFOUND_", sizeof("NOTFOUND_") - 1) == 0; -} - void getProvides(FD_t fd, int current_hdlist) { map<string,bool> used; Header header; @@ -314,7 +315,7 @@ void printDepslist(ofstream *out1, ofstream *out2) { int l_best = 9999; for (ITs p = list.begin(); p != list.end(); p++) { - if (notfound(*p)) { + if (start_with(*p, "NOTFOUND_")) { list.erase(*p); continue; } @@ -359,7 +360,7 @@ void printDepslist(ofstream *out1, ofstream *out2) { verif(nb2hdlist[i], nb2hdlist[where[*k]], *p, *k); *out2 << where[*k]; } - } else if (notfound(*q)) { + } else if (start_with(*q, "NOTFOUND_")) { *out2 << " " << *q; } else { verif(nb2hdlist[i], nb2hdlist[where[*q]], *p, *q); |