From 947768372ae51e863812317129e19586afa8d846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Thu, 25 Aug 2016 08:58:44 +0200 Subject: [PATCH] Added comments --- src/lib/installation/update_repository.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/lib/installation/update_repository.rb b/src/lib/installation/update_repository.rb index ab10a3657..1fdbf7b4c 100644 --- a/src/lib/installation/update_repository.rb +++ b/src/lib/installation/update_repository.rb @@ -176,6 +176,11 @@ def remove_update_files # * Mount the squashfs filesystem # * Add files/directories to inst-sys using the /etc/adddir script # + # @note The current implementation creates one squashfs image per package + # and mounting a squashfs image consumes one loop device (/dev/loop*). + # Inst-sys has by default 64 loop devices, but some of them already used, + # in an extreme case we might run out of loop devices. + # # @param mount_path [Pathname] Directory to mount the update # # @raise UpdatesNotFetched @@ -244,15 +249,15 @@ def fetch_package(package, dir) # Extract a RPM contents to a given directory # - # @param package_path [Pathname] RPM local path + # @param package_file [File] RPM package (local file name) # @param dir [Pathname] Directory to extract the RPM contents # # @raise CouldNotExtractPackage - def extract(package_path, dir) + def extract(package_file, dir) Dir.chdir(dir) do - cmd = format(EXTRACT_CMD, source: package_path.path) + cmd = format(EXTRACT_CMD, source: package_file.path) out = Yast::SCR.Execute(Yast::Path.new(".target.bash_output"), cmd) - log.info("Extracting package #{package_path}: #{out}") + log.info("Extracting package #{package_file.inspect}: #{out}") raise CouldNotExtractPackage unless out["exit"].zero? end end