Log warning if baseproduct symlink is dangling or missing
authorMichael Andres <ma@suse.de>
Fri, 4 Apr 2014 12:28:18 +0000 (14:28 +0200)
committerMichael Andres <ma@suse.de>
Fri, 4 Apr 2014 12:28:18 +0000 (14:28 +0200)
zypp/target/TargetImpl.cc

index 7473d2a..ad68198 100644 (file)
@@ -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 )