lib/cli.rb in inqlude-0.0.8 vs lib/cli.rb in inqlude-0.7.0

- old
+ new

@@ -96,15 +96,22 @@ def show name Upstream.get_involved "Add command for showing library details", 1 end desc "verify [filename]", "Verify all manifests or specific file if filename is given" + method_option :check_links, :type => :boolean, + :desc => "Check links for reachability." def verify filename=nil process_global_options options v = Verifier.new @@settings + if options[:check_links] + Upstream.get_involved "Implement --check-links option", 11 + exit 1 + end + if filename result = v.verify_file filename result.print_result else handler = ManifestHandler.new @@settings @@ -125,10 +132,22 @@ puts "#{handler.manifests.count} manifests checked. #{count_ok} ok, " + "#{count_error} with error." end end + desc "review <repo>", "Review pull requests on GitHub. Use 'username:branch' as repo parameter." + def review repo, action = nil + if !action + GitHubTool.review repo + elsif action == "accept" + GitHubTool.accept repo + else + STDERR.puts "Unknown review action: '#{action}'" + exit 1 + end + end + desc "system_scan", "Scan system for installed Qt libraries and create manifests" method_option :dry_run, :type => :boolean, :desc => "Dry run. Don't write files." method_option :recreate_source_cache, :type => :boolean, :desc => "Recreate cache with meta data of installed RPMs" @@ -147,25 +166,70 @@ end m.process_all_rpms end - desc "create <manifest_name> <version> <release_date>", "Create new or updated manifest" + desc "create <manifest_name> [version] [release_date]", "Create new or updated manifest" method_option :kf5, :type => :boolean, :desc => "Create KDE Framworks 5 template", :required => false - def create name, version, release_date + def create name, version=nil, release_date=nil @@settings.manifest_path = "." creator = Creator.new @@settings, name if creator.is_new? + if !version && release_date || version && !release_date + STDERR.puts "You need to specify both, version and release date" + exit 1 + end + if version && release_date + if options[:kf5] + creator.create_kf5 version, release_date + else + creator.create version, release_date + end + else + creator.create_generic + end + else + if !version || !release_date + STDERR.puts "Updating manifest requires version and release_date" + exit 1 + end creator.validate_directory creator.update version, release_date + end + end + + desc "create_kde_frameworks <frameworks-git-checkout> <output_dir>", + "Create manifests from git checkout of KDE frameworks module in given directory" + method_option "show-warnings", :type => :boolean, + :desc => "Show warnings about missing data", :required => false + method_option "ignore-errors-homepage", :type => :boolean, + :desc => "Ignore errors about missing home page", :required => false + def create_kde_frameworks checkout_dir, output_dir + k = KdeFrameworksCreator.new + if options["ignore-errors-homepage"] + k.parse_checkout checkout_dir, :ignore_errors => [ "link_home_page" ] else - if options[:kf5] - creator.create_kf5 version, release_date - else - creator.create version, release_date + k.parse_checkout checkout_dir + end + k.create_manifests output_dir + k.errors.each do |error| + puts "#{error[:name]}: #{error[:issue]}" + end + if options["show-warnings"] + k.warnings.each do |warning| + puts "#{warning[:name]}: #{warning[:issue]} (#{warning[:details]})" end end + end + + desc "release_kde_frameworks <release_date> <version>", + "Create release manifests for KDE frameworks release" + def release_kde_frameworks release_date, version + handler = ManifestHandler.new @@settings + k = KdeFrameworksRelease.new handler + k.read_generic_manifests + k.write_release_manifests release_date, version end desc "get_involved", "Information about how to get involved" def get_involved Upstream.print_info