Skip to content

Commit

Permalink
Merge pull request #1 from MinaProtocol/release/0.11.7
Browse files Browse the repository at this point in the history
Add exist command for batch of packages verification
  • Loading branch information
dkijania authored Nov 5, 2024
2 parents 8978b96 + 5b368b2 commit b065a4a
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/deb/s3.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- encoding : utf-8 -*-
module Deb
module S3
VERSION = "0.11.6"
VERSION = "0.11.7"
end
end
34 changes: 33 additions & 1 deletion lib/deb/s3/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def list
desc "show PACKAGE VERSION ARCH", "Shows information about a package."

def show(package_name, version, arch)
if version.nil?
if package_name.nil?
error "You must specify the name of the package to show."
end
if version.nil?
Expand All @@ -366,6 +366,38 @@ def show(package_name, version, arch)
puts package.generate(options[:codename])
end

desc "exist PACKAGES VERSION ARCH", "Check if packages exists in repository."

def exist(package_names, version, arch)
if package_names.nil?
error "You must specify the named of the packages to verify."
end
if version.nil?
error "You must specify the version of the packages to verify."
end
if arch.nil?
error "You must specify the architecture of the packages to verify."
end

configure_s3_client

# retrieve the existing manifests
manifest = Deb::S3::Manifest.retrieve(options[:codename], component, arch,
options[:cache_control], false, false)

package_names.split.each{ |package_name|
package = manifest.packages.detect { |p|
p.name == package_name && p.full_version == version
}
if package.nil?
puts "#{package_name} : Missing"
else
puts "#{package_name} : Found"
end
}
end


desc "copy PACKAGE TO_CODENAME TO_COMPONENT ",
"Copy the package named PACKAGE to given codename and component. If --versions is not specified, copy all versions of PACKAGE. Otherwise, only the specified versions will be copied. Source codename and component is given by --codename and --component options."

Expand Down

0 comments on commit b065a4a

Please sign in to comment.