#4286 Adjust download-build messages
Merged 5 months ago by tkopecek. Opened 5 months ago by mikem.

file modified
+7 -3
@@ -6814,8 +6814,10 @@ 

  

  

  def anon_handle_download_build(options, session, args):

-     "[download] Download a built package"

-     usage = "usage: %prog download-build [options] <n-v-r | build_id | package>"

+     "[download] Download a completed build"

+     usage = "usage: %prog download-build [options] <n-v-r|build_id>"

+     usage += "\n\nDownloads files from the specified build entry"

+     usage += "\nNote: scratch builds do not have build entries. Use download-task for those"

      parser = OptionParser(usage=get_usage_str(usage))

      parser.add_option("--arch", "-a", dest="arches", metavar="ARCH", action="append", default=[],

                        help="Only download packages for this arch (may be used multiple times)")
@@ -6849,7 +6851,9 @@ 

          if suboptions.task_id:

              builds = session.listBuilds(taskID=build)

              if not builds:

-                 error("No associated builds for task %s" % build)

+                 error("No associated builds for task %s"

+                       "\nIf this is a scratch build, try using download-task instead"

+                       % build)

              build = builds[0]['build_id']

  

      if suboptions.latestfrom:

@@ -91,7 +91,7 @@ 

          wrapper-rpm               Build wrapper rpms for any archives associated with a build.

  

  download commands:

-         download-build            Download a built package

+         download-build            Download a completed build

          download-logs             Download logs for task

          download-task             Download the output of a build task

  

@@ -18,7 +18,10 @@ 

          self.options.debug = False

          self.session = mock.MagicMock()

          self.session.getAPIVersion.return_value = koji.API_VERSION

-         self.error_format = """Usage: %s download-build [options] <n-v-r | build_id | package>

+         self.error_format = """Usage: %s download-build [options] <n-v-r|build_id>

+ 

+ Downloads files from the specified build entry

+ Note: scratch builds do not have build entries. Use download-task for those

  (Specify the --help global option for a list of other help options)

  

  %s: error: {message}
@@ -187,7 +190,9 @@ 

              self.options,

              self.session,

              ['--task-id', build_id],

-             stderr='No associated builds for task %s\n' % build_id,

+             stderr='No associated builds for task %s\n'

+                    'If this is a scratch build, try using download-task instead\n'

+                    % build_id,

              stdout='',

              activate_session=None,

              exit_code=1
@@ -274,7 +279,10 @@ 

      def test_handle_add_volume_help(self):

          self.assert_help(

              anon_handle_download_build,

-             """Usage: %s download-build [options] <n-v-r | build_id | package>

+             """Usage: %s download-build [options] <n-v-r|build_id>

+ 

+ Downloads files from the specified build entry

+ Note: scratch builds do not have build entries. Use download-task for those

  (Specify the --help global option for a list of other help options)

  

  Options:

Metadata Update from @tkopecek:
- Pull-request tagged with: doc, no_qe

5 months ago

Commit aa54d70 fixes this pull-request

Pull-Request has been merged by tkopecek

5 months ago