Skip to content

Commit

Permalink
move package cache to /mnt (bnc#877859)
Browse files Browse the repository at this point in the history
to avoid freezing the installer when installing big packages with small RAM

- 3.1.12
  • Loading branch information
lslezak committed May 27, 2014
1 parent 4f15caf commit a3d6206
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package/yast2-pkg-bindings-devel-doc.spec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#

Name: yast2-pkg-bindings-devel-doc
Version: 3.1.11
Version: 3.1.12
Release: 0
License: GPL-2.0
Group: Documentation/HTML
Expand Down
9 changes: 9 additions & 0 deletions package/yast2-pkg-bindings.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
-------------------------------------------------------------------
Tue May 27 13:18:29 UTC 2014 - lslezak@suse.cz

- move package cache to target system (copy RPMs to /mnt instead of
inst-sys (RAM-disk) during installation to avoid freezing the
installer when installing big packages with small RAM)
(bnc#877859)
- 3.1.12

-------------------------------------------------------------------
Tue May 20 06:22:19 UTC 2014 - jreidinger@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-pkg-bindings.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-pkg-bindings
Version: 3.1.11
Version: 3.1.12
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
20 changes: 20 additions & 0 deletions src/PkgFunctions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,26 @@ bool PkgFunctions::RepoManagerUpdateTarget(const std::string& root)
repo_manager = new_repo_manager;
}

// update package cache path for loaded repositories when changing the target
if (new_target)
{
zypp::RepoManagerOptions repo_options(root);
zypp::Pathname packages_prefix = repo_options.repoPackagesCachePath;

zypp::ResPool pool = zypp_ptr()->pool();
for_(it, pool.knownRepositoriesBegin(), pool.knownRepositoriesEnd())
{
zypp::RepoInfo repo = it->info();
repo.setPackagesPath(packages_prefix / repo.escaped_alias());

y2milestone("Setting package cache for repository %s: %s",
repo.alias().c_str(),
repo.packagesPath().asString().c_str());

it->setInfo(repo);
}
}

return new_target;
}

Expand Down
2 changes: 2 additions & 0 deletions src/Source_Installation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "log.h"

#include <zypp/ExternalProgram.h>
#include <zypp/Pathname.h>

#include <ycp/YCPBoolean.h>
#include <ycp/YCPVoid.h>
Expand Down Expand Up @@ -286,6 +287,7 @@ PkgFunctions::SourceMoveDownloadArea (const YCPString & path)
y2milestone("Moving download area of all sources to %s", path->value().c_str());
zypp::media::MediaManager manager;
manager.setAttachPrefix(path->value());

_download_area = path->value();
}
catch (zypp::Exception & excpt)
Expand Down

0 comments on commit a3d6206

Please sign in to comment.