Skip to content

Commit

Permalink
Code review fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Mar 19, 2021
1 parent 0b5b634 commit ca7e906
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions src/clients/inst_kickoff.rb
Expand Up @@ -46,18 +46,7 @@ def main
)
end

# copy the zypp cache to the target system (only when running in inst-sys!)
if Stage.initial
# copy the credential files (libzypp loads them from target)
# and the repository cache to the target system
Pkg.SourceCacheCopyTo(Installation.destdir)

# symlink the cache from inst-sys to save same space (RAM!)
cache_path = Pkg.ZConfig()["repo_cache_path"] || "/var/cache/zypp"
log.info("Zypp cache size: #{`du -h -s #{cache_path.shellescape}`}")
::FileUtils.rm_rf(cache_path)
File.symlink(File.join(Installation.destdir, cache_path), cache_path)
end
copy_zypp_cache

# installation, for instance...
if !Mode.update
Expand Down Expand Up @@ -142,6 +131,21 @@ def main
:next
end

# copy the zypp cache to the target system (only when running in inst-sys!)
def copy_zypp_cache
return unless Stage.initial

# copy the credential files (libzypp loads them from target)
# and the repository cache to the target system
Pkg.SourceCacheCopyTo(Installation.destdir)

# symlink the cache from inst-sys to save same space (RAM!)
cache_path = Pkg.ZConfig()["repo_cache_path"] || "/var/cache/zypp"
log.info("Zypp cache size: #{`du -h -s #{cache_path.shellescape}`}")
::FileUtils.rm_rf(cache_path)
File.symlink(File.join(Installation.destdir, cache_path), cache_path)
end

# Handle the backup.
def backup_stuff
if Installation.update_backup_modified
Expand Down

0 comments on commit ca7e906

Please sign in to comment.