diff -urN apt-0.5.15lorg3.95.git416.old/apt-pkg/pkgrecords.h apt-0.5.15lorg3.95.git416/apt-pkg/pkgrecords.h
--- apt-0.5.15lorg3.95.git416.old/apt-pkg/pkgrecords.h 2008-11-11 18:23:45.000000000 +0200
+++ apt-0.5.15lorg3.95.git416/apt-pkg/pkgrecords.h 2009-08-28 01:56:19.000000000 +0300
@@ -79,7 +79,9 @@
// CNC:2003-11-21
virtual bool HasFile(const char *File) {return false;}
-
+
+ virtual void FindFiles(const char *Mask, std::vector<string> &Files) {}
+
virtual ~Parser() {}
};
diff -urN apt-0.5.15lorg3.95.git416.old/apt-pkg/rpm/rpmhandler.cc apt-0.5.15lorg3.95.git416/apt-pkg/rpm/rpmhandler.cc
--- apt-0.5.15lorg3.95.git416.old/apt-pkg/rpm/rpmhandler.cc 2008-12-22 22:18:52.000000000 +0200
+++ apt-0.5.15lorg3.95.git416/apt-pkg/rpm/rpmhandler.cc 2009-08-28 02:05:33.000000000 +0300
@@ -138,6 +138,21 @@
return false;
}
+void RPMHandler::FindFiles(const char *Mask, std::vector<string> &Files)
+{
+ Files.clear();
+ if (*Mask == '\0')
+ return;
+
+ vector<string> PkgFiles;
+ FileList(PkgFiles);
+ for (vector<string>::iterator I = PkgFiles.begin(); I != PkgFiles.end(); I++) {
+ if ((*I).find(Mask) != string::npos) {
+ Files.push_back(*I);
+ }
+ }
+}
+
bool RPMHandler::InternalDep(const char *name, const char *ver, raptDepFlags flag)
{
if (strncmp(name, "rpmlib(", strlen("rpmlib(")) == 0) {
@@ -1288,6 +1303,21 @@
return false;
}
+void RPMRepomdHandler::FindFiles(const char *Mask, std::vector<string> &Files)
+{
+ Files.clear();
+ if (*Mask == '\0')
+ return;
+
+ vector<string> PkgFiles;
+ ShortFileList(PkgFiles);
+ for (vector<string>::iterator I = PkgFiles.begin(); I != PkgFiles.end(); I++) {
+ if ((*I).find(Mask) != string::npos) {
+ Files.push_back(*I);
+ }
+ }
+}
+
bool RPMRepomdHandler::ShortFileList(vector<string> &FileList)
{
xmlNode *format = XmlFindNode(NodeP, "format");
diff -urN apt-0.5.15lorg3.95.git416.old/apt-pkg/rpm/rpmhandler.h apt-0.5.15lorg3.95.git416/apt-pkg/rpm/rpmhandler.h
--- apt-0.5.15lorg3.95.git416.old/apt-pkg/rpm/rpmhandler.h 2008-12-22 20:39:07.000000000 +0200
+++ apt-0.5.15lorg3.95.git416/apt-pkg/rpm/rpmhandler.h 2009-08-28 01:56:40.000000000 +0300
@@ -110,6 +110,8 @@
virtual bool HasFile(const char *File);
+ virtual void FindFiles(const char *Mask, std::vector<string> &Files);
+
RPMHandler() : iOffset(0), iSize(0) {}
virtual ~RPMHandler() {}
};
@@ -316,6 +318,7 @@
virtual string SourceRpm();
virtual bool HasFile(const char *File);
+ virtual void FindFiles(const char *Mask, std::vector<string> &Files);
virtual bool ShortFileList(vector<string> &FileList);
virtual bool PRCO(unsigned int Type, vector<Dependency*> &Deps);
diff -urN apt-0.5.15lorg3.95.git416.old/apt-pkg/rpm/rpmrecords.cc apt-0.5.15lorg3.95.git416/apt-pkg/rpm/rpmrecords.cc
--- apt-0.5.15lorg3.95.git416.old/apt-pkg/rpm/rpmrecords.cc 2008-12-22 22:18:52.000000000 +0200
+++ apt-0.5.15lorg3.95.git416/apt-pkg/rpm/rpmrecords.cc 2009-08-28 01:56:53.000000000 +0300
@@ -361,6 +361,11 @@
return Handler->HasFile(File);
}
+void rpmRecordParser::FindFiles(const char *Mask, std::vector<string> &Files)
+{
+ return Handler->FindFiles(Mask, Files);
+}
+
#endif /* HAVE_RPM */
// vim:sts=3:sw=3
diff -urN apt-0.5.15lorg3.95.git416.old/apt-pkg/rpm/rpmrecords.h apt-0.5.15lorg3.95.git416/apt-pkg/rpm/rpmrecords.h
--- apt-0.5.15lorg3.95.git416.old/apt-pkg/rpm/rpmrecords.h 2008-11-17 21:22:52.000000000 +0200
+++ apt-0.5.15lorg3.95.git416/apt-pkg/rpm/rpmrecords.h 2009-08-28 01:56:26.000000000 +0300
@@ -63,6 +63,8 @@
virtual bool HasFile(const char *File);
+ virtual void FindFiles(const char *Mask, std::vector<string> &Files);
+
rpmRecordParser(string File,pkgCache &Cache);
~rpmRecordParser();
};
diff -urN apt-0.5.15lorg3.95.git416.old/cmdline/cmdline.cc apt-0.5.15lorg3.95.git416/cmdline/cmdline.cc
--- apt-0.5.15lorg3.95.git416.old/cmdline/cmdline.cc 2008-11-11 18:23:45.000000000 +0200
+++ apt-0.5.15lorg3.95.git416/cmdline/cmdline.cc 2009-08-28 02:10:08.000000000 +0300
@@ -1792,16 +1792,22 @@
pkgCache::VerIterator Ver = Pkg.VersionList();
for (; Ver.end() == false; Ver++) {
pkgRecords::Parser &Parse = Recs.Lookup(Ver.FileList());
- if (Parse.HasFile(*I)) {
- cout << *I << " " << Pkg.Name() << "-" << Ver.VerStr() << endl;
+ vector<string> Files;
+ Parse.FindFiles(*I, Files);
+ vector<string>::iterator F = Files.begin();
+ for (; F != Files.end(); F++) {
+ cout << Pkg.Name() << "-" << Ver.VerStr() << ": " << *F << endl;
}
}
} else {
pkgCache::VerIterator Ver = Plcy.GetCandidateVer(Pkg);
if (Ver.end() == false) {
pkgRecords::Parser &Parse = Recs.Lookup(Ver.FileList());
- if (Parse.HasFile(*I)) {
- cout << *I << " " << Pkg.Name() << "-" << Ver.VerStr() << endl;
+ vector<string> Files;
+ Parse.FindFiles(*I, Files);
+ vector<string>::iterator F = Files.begin();
+ for (; F != Files.end(); F++) {
+ cout << Pkg.Name() << "-" << Ver.VerStr() << ": " << *F << endl;
}
}
}