From 4ee42b168e66b4c401028ca4b12da950d63dfc5b Mon Sep 17 00:00:00 2001 From: Michael Andres Date: Fri, 4 Apr 2014 14:28:18 +0200 Subject: [PATCH] Log warning if baseproduct symlink is dangling or missing --- zypp/target/TargetImpl.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/zypp/target/TargetImpl.cc b/zypp/target/TargetImpl.cc index 7473d2a..ad68198 100644 --- a/zypp/target/TargetImpl.cc +++ b/zypp/target/TargetImpl.cc @@ -1766,19 +1766,25 @@ namespace zypp { parser::ProductFileData baseproductdata( const Pathname & root_r ) { + parser::ProductFileData ret; PathInfo baseproduct( Pathname::assertprefix( root_r, "/etc/products.d/baseproduct" ) ); + if ( baseproduct.isFile() ) { try { - return parser::ProductFileReader::scanFile( baseproduct.path() ); + ret = parser::ProductFileReader::scanFile( baseproduct.path() ); } catch ( const Exception & excpt ) { ZYPP_CAUGHT( excpt ); } } - return parser::ProductFileData(); + else if ( PathInfo( Pathname::assertprefix( root_r, "/etc/products.d" ) ).isDir() ) + { + ERR << "baseproduct symlink is dangling or missing: " << pi << end; + } + return ret; } inline Pathname staticGuessRoot( const Pathname & root_r ) -- 2.7.4