Fix chroot execution of update scripts.
authorMichael Andres <ma@suse.de>
Thu, 26 Nov 2009 17:34:21 +0000 (18:34 +0100)
committerMichael Andres <ma@suse.de>
Thu, 26 Nov 2009 17:34:21 +0000 (18:34 +0100)
zypp/target/TargetImpl.cc

index 5ebd361d2322b8d8b46fb1c4f17d597a46cf4be0..d74c590ce22e16f3301f31d0646aca944dc6e49f 100644 (file)
@@ -127,7 +127,7 @@ namespace zypp
                                                                  const Pathname & script_r,
                                                                  callback::SendReport<PatchScriptReport> & report_r )
       {
-        MIL << "Execute script " << PathInfo(script_r) << endl;
+        MIL << "Execute script " << PathInfo(Pathname::assertprefix( root_r,script_r)) << endl;
 
         HistoryLog historylog;
         historylog.comment(script_r.asString() + _(" executed"), /*timestamp*/true);
@@ -241,11 +241,12 @@ namespace zypp
             if ( (*sit)[prefix.size()] != '\0' && (*sit)[prefix.size()] != '-' )
               continue; // if not exact match it had to continue with '-'
 
+            Pathname localPath( scriptsPath_r/(*sit) ); // without root prefix
             if ( abort || aborting_r )
             {
               WAR << "Aborting: Skip update script " << *sit << endl;
               HistoryLog().comment(
-                  script.path().asString() + _(" execution skipped while aborting"),
+                  localPath.asString() + _(" execution skipped while aborting"),
                   /*timestamp*/true);
             }
             else
@@ -254,7 +255,7 @@ namespace zypp
               callback::SendReport<PatchScriptReport> report;
               report->start( make<Package>( *it ), script.path() );
 
-              if ( ! executeScript( root_r, script.path(), report ) )
+              if ( ! executeScript( root_r, localPath, report ) ) // script path without root prefix!
                 abort = true; // requested abort.
             }
           }