Mailinglist Archive: zypp-commit (500 mails)
| < Previous | Next > |
[zypp-commit] r5945 - in /branches/REFACTORING-10_3/libzypp/zypp/parser: TagParser.cc susetags/ContentFileReader.cc susetags/FileReaderBaseImpl.h susetags/PackagesLangFileReader.cc susetags/RepoParser.cc
- From: mlandres@xxxxxxxxxxxxxxxx
- Date: Tue, 10 Jul 2007 12:16:39 -0000
- Message-id: <20070710121639.939DA26926@xxxxxxxxxxxxxxxx>
Author: mlandres
Date: Tue Jul 10 14:16:39 2007
New Revision: 5945
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5945&view=rev
Log:
explicitly test whether input files exist, throw when parsing a bad stream. parse language data.
Modified:
branches/REFACTORING-10_3/libzypp/zypp/parser/TagParser.cc
branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/ContentFileReader.cc
branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/FileReaderBaseImpl.h
branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/PackagesLangFileReader.cc
branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/RepoParser.cc
Modified: branches/REFACTORING-10_3/libzypp/zypp/parser/TagParser.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/parser/TagParser.cc?rev=5945&r1=5944&r2=5945&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/parser/TagParser.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/parser/TagParser.cc Tue Jul 10 14:16:39 2007
@@ -199,6 +199,12 @@
void TagParser::parse( const InputStream & input_r, const ProgressData::ReceiverFnc & fnc_r )
{
MIL << "Start parsing " << input_r << endl;
+ if ( ! input_r.stream() )
+ {
+ std::ostringstream s;
+ s << "Can't read bad stream: " << input_r;
+ ZYPP_THROW( ParseException( s.str() ) );
+ }
_inputname = input_r.name();
beginParse();
Modified: branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/ContentFileReader.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/ContentFileReader.cc?rev=5945&r1=5944&r2=5945&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/ContentFileReader.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/ContentFileReader.cc Tue Jul 10 14:16:39 2007
@@ -289,6 +289,12 @@
const ProgressData::ReceiverFnc & fnc_r )
{
MIL << "Start parsing " << input_r << endl;
+ if ( ! input_r.stream() )
+ {
+ std::ostringstream s;
+ s << "Can't read bad stream: " << input_r;
+ ZYPP_THROW( ParseException( s.str() ) );
+ }
beginParse();
_pimpl->_inputname = input_r.name();
Modified: branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/FileReaderBaseImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/FileReaderBaseImpl.h?rev=5945&r1=5944&r2=5945&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/FileReaderBaseImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/FileReaderBaseImpl.h Tue Jul 10 14:16:39 2007
@@ -20,6 +20,7 @@
#include "zypp/parser/susetags/FileReaderBase.h"
#include "zypp/parser/ParseException.h"
#include "zypp/data/ResolvableData.h"
+#include "zypp/PathInfo.h"
using std::endl;
Modified: branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/PackagesLangFileReader.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/PackagesLangFileReader.cc?rev=5945&r1=5944&r2=5945&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/PackagesLangFileReader.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/PackagesLangFileReader.cc Tue Jul 10 14:16:39 2007
@@ -10,8 +10,9 @@
*
*/
#include <iostream>
+#include "zypp/base/Easy.h"
#include "zypp/base/Logger.h"
-
+#include "zypp/base/LogTools.h"
#include "zypp/parser/susetags/PackagesLangFileReader.h"
#include "zypp/parser/susetags/FileReaderBaseImpl.h"
Modified: branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/RepoParser.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/RepoParser.cc?rev=5945&r1=5944&r2=5945&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/RepoParser.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/RepoParser.cc Tue Jul 10 14:16:39 2007
@@ -10,9 +10,12 @@
*
*/
#include <iostream>
+#include "zypp/base/Easy.h"
#include "zypp/base/Logger.h"
+#include "zypp/base/LogTools.h"
#include "zypp/base/Iterator.h"
#include "zypp/base/String.h"
+#include "zypp/base/Gettext.h"
#include "zypp/parser/susetags/FileReaderBaseImpl.h"
#include "zypp/parser/susetags/RepoParser.h"
@@ -77,8 +80,6 @@
void consumePkg( const data::Package_Ptr & data_r )
{
- //SEC << "[Package]" << data_r << endl;
-
// prepend location with 'datadir'
Pathname tofix( data_r->repositoryLocation.filename() );
data_r->repositoryLocation.setFilename( _datadir / tofix );
@@ -102,8 +103,6 @@
void consumeSrcPkg( const data::SrcPackage_Ptr & data_r )
{
- //SEC << "[SrcPackage]" << data_r << endl;
-
// prepend location with 'datadir'
Pathname tofix( data_r->repositoryLocation.filename() );
data_r->repositoryLocation.setFilename( _datadir / tofix );
@@ -124,6 +123,30 @@
newid );
}
+ void consumePkgLang( const data::Package_Ptr & data_r )
+ {
+ data::RecordId id = idMapGet( makeSharedIdent( ResTraits<Package>::kind,
+ data_r->name,
+ data_r->edition,
+ data_r->arch ) );
+ if ( id != data::noRecordId )
+ {
+ _consumer.updatePackageLang( id, data_r );
+ }
+ }
+
+ void consumeSrcPkgLang( const data::SrcPackage_Ptr & data_r )
+ {
+ data::RecordId id = idMapGet( makeSharedIdent( ResTraits<SrcPackage>::kind,
+ data_r->name,
+ data_r->edition,
+ data_r->arch ) );
+ if ( id != data::noRecordId )
+ {
+ _consumer.updatePackageLang( id, data_r );
+ }
+ }
+
void consumePat( const data::Pattern_Ptr & data_r )
{
//SEC << "[Pattern]" << data_r << endl;
@@ -134,7 +157,28 @@
public:
- bool isPatternFile( const std::string & name_r ) const
+ Pathname assertMandatoryFile( const Pathname & file_r ) const
+ {
+ PathInfo inputfile( _reporoot / file_r );
+ if ( ! inputfile.isFile() )
+ {
+ ZYPP_THROW( ParseException( _reporoot.asString() + ": " + _("Required file is missing: ") + file_r.asString() ) );
+ }
+ return inputfile.path();
+ }
+
+ Pathname getOptionalFile( const Pathname & file_r ) const
+ {
+ PathInfo inputfile( _reporoot / file_r );
+ if ( ! inputfile.isFile() )
+ {
+ WAR << _reporoot << ": Skip optional file: " << file_r.asString() << endl;
+ return Pathname();
+ }
+ return inputfile.path();
+ }
+
+ bool isPatternFile( const std::string & name_r ) const
{
return( name_r.size() > 4 && name_r.substr( name_r.size() - 4 ) == ".pat" );
}
@@ -147,7 +191,16 @@
it != _repoIndex->metaFileChecksums.end(); ++it )
{
if ( it->first == searchFor )
- return true; // got it
+ {
+ // got it
+ PathInfo inputfile( _reporoot / _descrdir / searchFor );
+ if ( ! inputfile.isFile() )
+ {
+ WAR << "Known and desired file is not on disk: " << inputfile << endl;
+ }
+ else
+ return true; // got it
+ }
}
return false; // not found
}
@@ -177,18 +230,18 @@
{
return; // now return...
}
-
// ...or parse
_parsedLocales.insert( toParse ); // don't try again.
-#warning DISABLED PACKAGES.LANG PARSING
- return;
- PackagesLangFileReader reader;
- reader.setLocale( toParse );
- reader.setPkgConsumer( bind( &Impl::consumePkg, this, _1 ) );
- reader.setSrcPkgConsumer( bind( &Impl::consumeSrcPkg, this, _1 ) );
- reader.parse( _descrdir / ("packages." + toParse.code()) );
-
+ Pathname inputfile( getOptionalFile( _descrdir / ("packages." + toParse.code()) ) );
+ if ( ! inputfile.empty() )
+ {
+ PackagesLangFileReader reader;
+ reader.setLocale( toParse );
+ reader.setPkgConsumer( bind( &Impl::consumePkgLang, this, _1 ) );
+ reader.setSrcPkgConsumer( bind( &Impl::consumeSrcPkgLang, this, _1 ) );
+ reader.parse( inputfile );
+ }
if ( ! _ticks.incr() )
ZYPP_THROW( AbortRequestException() );
}
@@ -222,7 +275,8 @@
private: // these (and _ticks) are actually scoped per parse() run.
RepoIndex_Ptr _repoIndex;
data::Product_Ptr _prodData;
- Pathname _descrdir; // full path
+ Pathname _reporoot; // full path
+ Pathname _descrdir; // path below reporoot
Pathname _datadir; // path below reporoot
/** Translations processed by \ref parseLocaleIf so far.*/
@@ -250,15 +304,17 @@
{
_prodData = 0;
_repoIndex = 0;
+ _reporoot = reporoot_r;
_descrdir = _datadir = Pathname();
_parsedLocales.clear();
// Content file first to get the repoindex
{
+ Pathname inputfile( assertMandatoryFile( "content" ) );
ContentFileReader content;
content.setProductConsumer( bind( &Impl::consumeProd, this, _1 ) );
content.setRepoIndexConsumer( bind( &Impl::consumeIndex, this, _1 ) );
- content.parse( reporoot_r / "content" );
+ content.parse( inputfile );
}
if ( ! _repoIndex )
{
@@ -267,8 +323,8 @@
DBG << _repoIndex << endl;
// Prepare parsing
- _descrdir = reporoot_r / _repoIndex->descrdir; // full path
- _datadir = _repoIndex->datadir; // path below reporoot
+ _descrdir = _repoIndex->descrdir; // path below reporoot
+ _datadir = _repoIndex->datadir; // path below reporoot
_ticks.name( "Parsing susetags repo at " + reporoot_r.asString() );
_ticks.range( _repoIndex->metaFileChecksums.size() );
@@ -277,19 +333,22 @@
// Start with packages
{
+ Pathname inputfile( assertMandatoryFile( _descrdir / "packages" ) );
PackagesFileReader reader;
reader.setPkgConsumer( bind( &Impl::consumePkg, this, _1 ) );
reader.setSrcPkgConsumer( bind( &Impl::consumeSrcPkg, this, _1 ) );
- reader.parse( _descrdir / "packages" );
+ reader.parse( inputfile );
}
if ( ! _ticks.incr() )
ZYPP_THROW( AbortRequestException() );
- // Now process packages.lang
- // Always parse 'en'. For each wanted locale at least
- // some fallback, if locale is not present.
+ // Now process packages.lang. Always parse 'en'.
+ // At least packages.en is mandatory, because the file might
+ // contain license texts.
+ assertMandatoryFile( _descrdir / "packages.en" );
parseLocaleIf( Locale("en") );
- parseLocaleIf( Locale("de_DE") );
+ // For each wanted locale at least
+ // some fallback, if locale is not present.
parseLocaleIf( ZConfig().defaultTextLocale() );
// Now process the rest of RepoIndex
@@ -298,9 +357,13 @@
{
if ( isPatternFile( it->first ) )
{
- PatternFileReader reader;
- reader.setConsumer( bind( &Impl::consumePat, this, _1 ) );
- reader.parse( _descrdir / it->first );
+ Pathname inputfile( getOptionalFile( _descrdir / it->first) );
+ if ( ! inputfile.empty() )
+ {
+ PatternFileReader reader;
+ reader.setConsumer( bind( &Impl::consumePat, this, _1 ) );
+ reader.parse( inputfile );
+ }
}
if ( ! _ticks.incr() )
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx
Date: Tue Jul 10 14:16:39 2007
New Revision: 5945
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5945&view=rev
Log:
explicitly test whether input files exist, throw when parsing a bad stream. parse language data.
Modified:
branches/REFACTORING-10_3/libzypp/zypp/parser/TagParser.cc
branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/ContentFileReader.cc
branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/FileReaderBaseImpl.h
branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/PackagesLangFileReader.cc
branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/RepoParser.cc
Modified: branches/REFACTORING-10_3/libzypp/zypp/parser/TagParser.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/parser/TagParser.cc?rev=5945&r1=5944&r2=5945&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/parser/TagParser.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/parser/TagParser.cc Tue Jul 10 14:16:39 2007
@@ -199,6 +199,12 @@
void TagParser::parse( const InputStream & input_r, const ProgressData::ReceiverFnc & fnc_r )
{
MIL << "Start parsing " << input_r << endl;
+ if ( ! input_r.stream() )
+ {
+ std::ostringstream s;
+ s << "Can't read bad stream: " << input_r;
+ ZYPP_THROW( ParseException( s.str() ) );
+ }
_inputname = input_r.name();
beginParse();
Modified: branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/ContentFileReader.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/ContentFileReader.cc?rev=5945&r1=5944&r2=5945&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/ContentFileReader.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/ContentFileReader.cc Tue Jul 10 14:16:39 2007
@@ -289,6 +289,12 @@
const ProgressData::ReceiverFnc & fnc_r )
{
MIL << "Start parsing " << input_r << endl;
+ if ( ! input_r.stream() )
+ {
+ std::ostringstream s;
+ s << "Can't read bad stream: " << input_r;
+ ZYPP_THROW( ParseException( s.str() ) );
+ }
beginParse();
_pimpl->_inputname = input_r.name();
Modified: branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/FileReaderBaseImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/FileReaderBaseImpl.h?rev=5945&r1=5944&r2=5945&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/FileReaderBaseImpl.h (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/FileReaderBaseImpl.h Tue Jul 10 14:16:39 2007
@@ -20,6 +20,7 @@
#include "zypp/parser/susetags/FileReaderBase.h"
#include "zypp/parser/ParseException.h"
#include "zypp/data/ResolvableData.h"
+#include "zypp/PathInfo.h"
using std::endl;
Modified: branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/PackagesLangFileReader.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/PackagesLangFileReader.cc?rev=5945&r1=5944&r2=5945&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/PackagesLangFileReader.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/PackagesLangFileReader.cc Tue Jul 10 14:16:39 2007
@@ -10,8 +10,9 @@
*
*/
#include <iostream>
+#include "zypp/base/Easy.h"
#include "zypp/base/Logger.h"
-
+#include "zypp/base/LogTools.h"
#include "zypp/parser/susetags/PackagesLangFileReader.h"
#include "zypp/parser/susetags/FileReaderBaseImpl.h"
Modified: branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/RepoParser.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/RepoParser.cc?rev=5945&r1=5944&r2=5945&view=diff
==============================================================================
--- branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/RepoParser.cc (original)
+++ branches/REFACTORING-10_3/libzypp/zypp/parser/susetags/RepoParser.cc Tue Jul 10 14:16:39 2007
@@ -10,9 +10,12 @@
*
*/
#include <iostream>
+#include "zypp/base/Easy.h"
#include "zypp/base/Logger.h"
+#include "zypp/base/LogTools.h"
#include "zypp/base/Iterator.h"
#include "zypp/base/String.h"
+#include "zypp/base/Gettext.h"
#include "zypp/parser/susetags/FileReaderBaseImpl.h"
#include "zypp/parser/susetags/RepoParser.h"
@@ -77,8 +80,6 @@
void consumePkg( const data::Package_Ptr & data_r )
{
- //SEC << "[Package]" << data_r << endl;
-
// prepend location with 'datadir'
Pathname tofix( data_r->repositoryLocation.filename() );
data_r->repositoryLocation.setFilename( _datadir / tofix );
@@ -102,8 +103,6 @@
void consumeSrcPkg( const data::SrcPackage_Ptr & data_r )
{
- //SEC << "[SrcPackage]" << data_r << endl;
-
// prepend location with 'datadir'
Pathname tofix( data_r->repositoryLocation.filename() );
data_r->repositoryLocation.setFilename( _datadir / tofix );
@@ -124,6 +123,30 @@
newid );
}
+ void consumePkgLang( const data::Package_Ptr & data_r )
+ {
+ data::RecordId id = idMapGet( makeSharedIdent( ResTraits<Package>::kind,
+ data_r->name,
+ data_r->edition,
+ data_r->arch ) );
+ if ( id != data::noRecordId )
+ {
+ _consumer.updatePackageLang( id, data_r );
+ }
+ }
+
+ void consumeSrcPkgLang( const data::SrcPackage_Ptr & data_r )
+ {
+ data::RecordId id = idMapGet( makeSharedIdent( ResTraits<SrcPackage>::kind,
+ data_r->name,
+ data_r->edition,
+ data_r->arch ) );
+ if ( id != data::noRecordId )
+ {
+ _consumer.updatePackageLang( id, data_r );
+ }
+ }
+
void consumePat( const data::Pattern_Ptr & data_r )
{
//SEC << "[Pattern]" << data_r << endl;
@@ -134,7 +157,28 @@
public:
- bool isPatternFile( const std::string & name_r ) const
+ Pathname assertMandatoryFile( const Pathname & file_r ) const
+ {
+ PathInfo inputfile( _reporoot / file_r );
+ if ( ! inputfile.isFile() )
+ {
+ ZYPP_THROW( ParseException( _reporoot.asString() + ": " + _("Required file is missing: ") + file_r.asString() ) );
+ }
+ return inputfile.path();
+ }
+
+ Pathname getOptionalFile( const Pathname & file_r ) const
+ {
+ PathInfo inputfile( _reporoot / file_r );
+ if ( ! inputfile.isFile() )
+ {
+ WAR << _reporoot << ": Skip optional file: " << file_r.asString() << endl;
+ return Pathname();
+ }
+ return inputfile.path();
+ }
+
+ bool isPatternFile( const std::string & name_r ) const
{
return( name_r.size() > 4 && name_r.substr( name_r.size() - 4 ) == ".pat" );
}
@@ -147,7 +191,16 @@
it != _repoIndex->metaFileChecksums.end(); ++it )
{
if ( it->first == searchFor )
- return true; // got it
+ {
+ // got it
+ PathInfo inputfile( _reporoot / _descrdir / searchFor );
+ if ( ! inputfile.isFile() )
+ {
+ WAR << "Known and desired file is not on disk: " << inputfile << endl;
+ }
+ else
+ return true; // got it
+ }
}
return false; // not found
}
@@ -177,18 +230,18 @@
{
return; // now return...
}
-
// ...or parse
_parsedLocales.insert( toParse ); // don't try again.
-#warning DISABLED PACKAGES.LANG PARSING
- return;
- PackagesLangFileReader reader;
- reader.setLocale( toParse );
- reader.setPkgConsumer( bind( &Impl::consumePkg, this, _1 ) );
- reader.setSrcPkgConsumer( bind( &Impl::consumeSrcPkg, this, _1 ) );
- reader.parse( _descrdir / ("packages." + toParse.code()) );
-
+ Pathname inputfile( getOptionalFile( _descrdir / ("packages." + toParse.code()) ) );
+ if ( ! inputfile.empty() )
+ {
+ PackagesLangFileReader reader;
+ reader.setLocale( toParse );
+ reader.setPkgConsumer( bind( &Impl::consumePkgLang, this, _1 ) );
+ reader.setSrcPkgConsumer( bind( &Impl::consumeSrcPkgLang, this, _1 ) );
+ reader.parse( inputfile );
+ }
if ( ! _ticks.incr() )
ZYPP_THROW( AbortRequestException() );
}
@@ -222,7 +275,8 @@
private: // these (and _ticks) are actually scoped per parse() run.
RepoIndex_Ptr _repoIndex;
data::Product_Ptr _prodData;
- Pathname _descrdir; // full path
+ Pathname _reporoot; // full path
+ Pathname _descrdir; // path below reporoot
Pathname _datadir; // path below reporoot
/** Translations processed by \ref parseLocaleIf so far.*/
@@ -250,15 +304,17 @@
{
_prodData = 0;
_repoIndex = 0;
+ _reporoot = reporoot_r;
_descrdir = _datadir = Pathname();
_parsedLocales.clear();
// Content file first to get the repoindex
{
+ Pathname inputfile( assertMandatoryFile( "content" ) );
ContentFileReader content;
content.setProductConsumer( bind( &Impl::consumeProd, this, _1 ) );
content.setRepoIndexConsumer( bind( &Impl::consumeIndex, this, _1 ) );
- content.parse( reporoot_r / "content" );
+ content.parse( inputfile );
}
if ( ! _repoIndex )
{
@@ -267,8 +323,8 @@
DBG << _repoIndex << endl;
// Prepare parsing
- _descrdir = reporoot_r / _repoIndex->descrdir; // full path
- _datadir = _repoIndex->datadir; // path below reporoot
+ _descrdir = _repoIndex->descrdir; // path below reporoot
+ _datadir = _repoIndex->datadir; // path below reporoot
_ticks.name( "Parsing susetags repo at " + reporoot_r.asString() );
_ticks.range( _repoIndex->metaFileChecksums.size() );
@@ -277,19 +333,22 @@
// Start with packages
{
+ Pathname inputfile( assertMandatoryFile( _descrdir / "packages" ) );
PackagesFileReader reader;
reader.setPkgConsumer( bind( &Impl::consumePkg, this, _1 ) );
reader.setSrcPkgConsumer( bind( &Impl::consumeSrcPkg, this, _1 ) );
- reader.parse( _descrdir / "packages" );
+ reader.parse( inputfile );
}
if ( ! _ticks.incr() )
ZYPP_THROW( AbortRequestException() );
- // Now process packages.lang
- // Always parse 'en'. For each wanted locale at least
- // some fallback, if locale is not present.
+ // Now process packages.lang. Always parse 'en'.
+ // At least packages.en is mandatory, because the file might
+ // contain license texts.
+ assertMandatoryFile( _descrdir / "packages.en" );
parseLocaleIf( Locale("en") );
- parseLocaleIf( Locale("de_DE") );
+ // For each wanted locale at least
+ // some fallback, if locale is not present.
parseLocaleIf( ZConfig().defaultTextLocale() );
// Now process the rest of RepoIndex
@@ -298,9 +357,13 @@
{
if ( isPatternFile( it->first ) )
{
- PatternFileReader reader;
- reader.setConsumer( bind( &Impl::consumePat, this, _1 ) );
- reader.parse( _descrdir / it->first );
+ Pathname inputfile( getOptionalFile( _descrdir / it->first) );
+ if ( ! inputfile.empty() )
+ {
+ PatternFileReader reader;
+ reader.setConsumer( bind( &Impl::consumePat, this, _1 ) );
+ reader.parse( inputfile );
+ }
}
if ( ! _ticks.incr() )
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx
| < Previous | Next > |