Author: dmacvicar
Date: Fri Aug 10 16:08:40 2007
New Revision: 6604
URL: http://svn.opensuse.org/viewcvs/zypp?rev=6604&view=rev
Log:
reduce diff
Modified:
trunk/libzypp/zypp/parser/plaindir/RepoParser.cc
Modified: trunk/libzypp/zypp/parser/plaindir/RepoParser.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/parser/plaindir/RepoParser.cc?rev=6604&r1=6603&r2=6604&view=diff
==============================================================================
--- trunk/libzypp/zypp/parser/plaindir/RepoParser.cc (original)
+++ trunk/libzypp/zypp/parser/plaindir/RepoParser.cc Fri Aug 10 16:08:40 2007
@@ -11,6 +11,7 @@
#include "zypp/base/Logger.h"
#include "zypp/base/Iterator.h"
#include "zypp/base/String.h"
+#include "zypp/base/Regex.h"
#include
#include
@@ -154,17 +155,15 @@
list<string> filenames = header->tag_filenames();
pkg->deps[Dep::PROVIDES] = header->tag_provides ( filerequires );
+ static str::smatch what;
+ static const str::regex filenameRegex( "/(s?bin|lib(64)?|etc)/|^/usr/(games/|share/(dict/words|magic\\.mime)$)|^/opt/gnome/games/",
+ str::regex::optimize|str::regex::nosubs );
+
for (list<string>::const_iterator filename = filenames.begin();
filename != filenames.end();
++filename)
{
- if (str::contains(*filename, "/bin/")
- || str::contains(*filename, "/sbin")
- || str::contains(*filename, "/lib") || str::contains(*filename, "/lib64/")
- || str::contains(*filename, "/etc/")
- || str::startsWith(*filename, "/usr/games")
- || str::startsWith(*filename, "/usr/share/dict/words")
- || str::startsWith(*filename, "/opt/gnome/games/"))
+ if ( str::regex_match( *filename, what, filenameRegex ) )
{
try {
pkg->deps[Dep::PROVIDES].insert(capability::buildFile( ResTraits<Package>::kind, *filename ));
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org