-------------------------------------------------------------------
+Thu Jul 13 12:52:58 CEST 2006 - dmacvicar@suse.de
+
+- backport fix for stalle tmpfile (#191311)
+- rev 3788
+
+-------------------------------------------------------------------
Wed Jun 28 13:22:22 CEST 2006 - mt@suse.de
- deactivated media manager code that was disabling the
#include "zypp/Arch.h"
#include "zypp/Edition.h"
#include "zypp/base/Gettext.h"
+#include "zypp/ZYppFactory.h"
#include "zypp/source/yum/YUMSourceImpl.h"
Pathname YUMScriptImpl::do_script() const {
if (_do_script != "")
{
- _tmp_file = filesystem::TmpFile();
- Pathname pth = _tmp_file.path();
- ofstream st(pth.asString().c_str());
- st << _do_script << endl;
- return pth;
+ if ( !_tmp_do_script )
+ _tmp_do_script.reset(new filesystem::TmpDir(getZYpp()->tmpPath()));
+
+ Pathname pth = _tmp_do_script->path();
+ // FIXME check success
+ ofstream st(pth.asString().c_str());
+ st << _do_script << endl;
+ return pth;
}
else if (_do_location != "" && _do_location != "/")
{
}
}
/** Get the script to undo the change */
- Pathname YUMScriptImpl::undo_script() const {
+ Pathname YUMScriptImpl::undo_script() const
+ {
if (_undo_script != "")
{
- _tmp_file = filesystem::TmpFile();
- Pathname pth = _tmp_file.path();
- ofstream st(pth.asString().c_str());
- st << _undo_script << endl;
- return pth;
+ if ( !_tmp_undo_script )
+ _tmp_undo_script.reset(new filesystem::TmpDir(getZYpp()->tmpPath()));
+
+ Pathname pth = _tmp_undo_script->path();
+ // FIXME check success
+ ofstream st(pth.asString().c_str());
+ st << _undo_script << endl;
+ return pth;
}
else if (_undo_location != "" && _undo_location != "/")
{