use filesystem::TmpPath::defaultLocation() instead.
- make filesystem::TmpPath::defaultLocation() configurable
via environment variable.
#include <cstdio>
#include <unistd.h>
+#include "zypp/TmpPath.h"
#include "zypp/ZYppFactory.h"
#include "zypp/ZYpp.h"
/** Offer default Impl. */
static shared_ptr<Impl> nullimpl()
{
- static shared_ptr<Impl> _nullimpl( new Impl( Pathname("/var/tmp") ) );
+ static shared_ptr<Impl> _nullimpl( new Impl( TmpPath::defaultLocation() ) );
return _nullimpl;
}
const Pathname &
TmpPath::defaultLocation()
{
- static Pathname p( "/var/tmp" );
+ static Pathname p( getenv("ZYPPTMPDIR") ? getenv("ZYPPTMPDIR") : "/var/tmp" );
return p;
}
///////////////////////////////////////////////////////////////////
#include <fstream>
#include <sstream>
+#include "zypp/TmpPath.h"
#include "zypp/base/Logger.h"
#include "zypp/base/String.h"
#include "zypp/media/MediaHandler.h"
// provide a default (temporary) attachpoint
/////////////////////////////////////////////////////////////////
const char * defmounts[] = {
- "/var/adm/mount", "/var/tmp", /**/NULL/**/
+ "/var/adm/mount", filesystem::TmpPath::defaultLocation().c_str(), /**/NULL/**/
};
Pathname apoint;
#include <unistd.h>
#include <iostream>
#include <fstream>
+#include "zypp/TmpPath.h"
#include "zypp/base/Logger.h"
#include "zypp/base/String.h"
Pathname ZYppImpl::tmpPath() const
{
- static TmpDir zypp_tmp_dir("/var/tmp", "zypp.");
+ static TmpDir zypp_tmp_dir( TmpPath::defaultLocation(), "zypp." );
return zypp_tmp_dir.path();
}