From 40f1e5737baa7082850925573fdd2b45d91deade Mon Sep 17 00:00:00 2001 From: Michael Andres Date: Sat, 25 Jan 2014 14:05:39 +0100 Subject: [PATCH] Collect and execute %posttrans scripts delayed (Fate#313506) --- zypp/target/TargetImpl.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/zypp/target/TargetImpl.cc b/zypp/target/TargetImpl.cc index d698c0e..d1fe711 100644 --- a/zypp/target/TargetImpl.cc +++ b/zypp/target/TargetImpl.cc @@ -45,6 +45,7 @@ #include "zypp/target/TargetCallbackReceiver.h" #include "zypp/target/rpm/librpmDb.h" #include "zypp/target/CommitPackageCache.h" +#include "zypp/target/RpmPostTransCollector.h" #include "zypp/parser/ProductFileReader.h" @@ -1487,6 +1488,7 @@ namespace zypp MIL << "TargetImpl::commit(" << policy_r << ")" << steps.size() << endl; bool abort = false; + RpmPostTransCollector postTransCollector( _root ); std::vector successfullyInstalledPackages; TargetImpl::PoolItemList remaining; @@ -1563,6 +1565,8 @@ namespace zypp try { progress.tryLevel( target::rpm::InstallResolvableReport::RPM_NODEPS_FORCE ); + if ( postTransCollector.collectScriptFromPackage( localfile ) ) + flags |= rpm::RPMINST_NOPOSTTRANS; rpm().installPackage( localfile, flags ); HistoryLog().install(citem); @@ -1707,6 +1711,12 @@ namespace zypp } // for + // process all remembered posttrans scripts. + if ( !abort ) + postTransCollector.executeScripts(); + else + postTransCollector.discardScripts(); + // Check presence of update scripts/messages. If aborting, // at least log omitted scripts. if ( ! successfullyInstalledPackages.empty() ) -- 2.7.4