Skip to content

Commit

Permalink
Merge pull request #210 from yast/SLE-12-SP2-CASP-Fate-321764
Browse files Browse the repository at this point in the history
Sle 12 sp2 casp fate 321764
  • Loading branch information
schubi2 committed Dec 9, 2016
2 parents 92ff4ec + 921d37c commit bbba4a0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
7 changes: 7 additions & 0 deletions package/yast2-packager.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Thu Dec 8 17:56:24 CET 2016 - schubi@suse.de

- Copy /etc/zypp/zypp.conf from inst_sys to target system.
(FATE#321764)
- 3.1.119.1

-------------------------------------------------------------------
Wed Nov 9 16:31:50 UTC 2016 - igonzalezsosa@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-packager.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-packager
Version: 3.1.119
Version: 3.1.119.1
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
11 changes: 11 additions & 0 deletions src/lib/packager/clients/pkg_finish.rb
Expand Up @@ -21,6 +21,9 @@ class PkgFinishClient < ::Installation::FinishClient
include Yast::I18n
include Yast::Logger

ZYPP_DIR = "/etc/zypp"
ZYPP_CONF = "zypp.conf"

# Path to libzypp repositories
REPOS_DIR = "/etc/zypp/repos.d"
# Path to failed_packages file
Expand Down Expand Up @@ -80,6 +83,14 @@ def write
# (needs to be done _after_ saving repositories, see bnc#700881)
Pkg.SourceCacheCopyTo(Installation.destdir)

# Copying /etc/zypp/zypp.conf from inst_sys to target system
# because it could be different from the default one.
# (e.g. for products like CASP)
target_zypp = File.join(Installation.destdir, ZYPP_DIR)
zypp_conf = File.join(ZYPP_DIR, ZYPP_CONF)
log.info("Copying #{zypp_conf} to #{target_zypp}...")
::FileUtils.cp(zypp_conf, target_zypp)

# copy list of failed packages to installed system
if File.exist?(FAILED_PKGS_PATH)
::FileUtils.cp(FAILED_PKGS_PATH, File.join(Installation.destdir, FAILED_PKGS_PATH),
Expand Down
4 changes: 4 additions & 0 deletions test/pkg_finish_test.rb
Expand Up @@ -38,6 +38,8 @@
let(:args) { ["Write"] }
let(:destdir) { "/mnt" }
let(:update) { false }
let(:zypp_dir) { "/etc/zypp" }
let(:zypp_conf) { "zypp.conf" }

before do
allow(Yast::Installation).to receive(:destdir).and_return(destdir)
Expand All @@ -46,6 +48,8 @@
allow(Yast::Pkg).to receive(:SourceLoad)
allow(File).to receive(:exist?).and_call_original
allow(File).to receive(:exist?).with(FAILED_PKGS_PATH).and_return(false)
expect(FileUtils).to receive(:cp)
.with(File.join(zypp_dir, zypp_conf), File.join(destdir, zypp_dir))
end

it "saves repository information" do
Expand Down

0 comments on commit bbba4a0

Please sign in to comment.