director/lib/director/jobs/update_release.rb
# Points release DB model to existing packages described by given metadata
# @param [Array<Array>] packages Existing packages metadata
Points release DB model to existing packages described by given metadata
Points release DB model to existing packages described by given metadata
def use_existing_packages(packages)
        return if packages.empty?
        n_packages = packages.size
        event_log.begin_stage("Processing #{n_packages} existing " +
                              "package#{n_packages > 1 ? "s" : ""}", 1)
        event_log.track("Verifying checksums") do
          packages.each do |package, package_meta|
            package_desc = "#{package.name}/#{package.version}"
            logger.info("Package `#{package_desc}' already exists, " +
                        "verifying checksum")
            expected = package.sha1
            received = package_meta["sha1"]
            if expected != received
              raise ReleaseExistingPackageHashMismatch,
                    "`#{package_desc}' checksum mismatch, " +
                      "expected #{expected} but received #{received}"
            end
            logger.info("Package `#{package_desc}' verified")
            register_package(package)
          end
        end
      end
def use_existing_packages ( packages ) return if packages . empty? n_packages = packages . size event_log . begin_stage ( "Processing #{n_packages} existing " + "package#{n_packages > 1 ? "s" : ""}" , 1 ) event_log . track ( "Verifying checksums" ) do packages . each do | package , package_meta | package_desc = "#{package.name}/#{package.version}" logger . info ( "Package `#{package_desc}' already exists, " + "verifying checksum" ) expected = package . sha1 received = package_meta [ "sha1" ] if expected != received raise ReleaseExistingPackageHashMismatch , "`#{package_desc}' checksum mismatch, " + "expected #{expected} but received #{received}" end logger . info ( "Package `#{package_desc}' verified" ) register_package ( package ) end end end
Points release DB model to existing packages described by given metadata
Points release DB model to existing packages described by given metadata
# TODO: make sure package dependencies have not changed
packages
packages Existing packages metadata
packages Existing packages metadata