#21 Use %%gometa -f by default
Merged 2 years ago by gotmax23. Opened 2 years ago by gotmax23.
GoSIG/ gotmax23/go2rpm golang_arches_future  into  master

file modified
-2
@@ -1,3 +1,1 @@ 

- from rust2rpm import licensing

- 

  __version__ = "1.7.0"

file modified
+42 -9
@@ -53,7 +53,7 @@ 

      return datetime.fromtimestamp(os.stat(path).st_mtime, timezone.utc).isoformat()

  

  

- @jinja2.environmentfilter

+ @jinja2.pass_environment

  def do_customwordwrap(

      environment,

      s,
@@ -486,12 +486,20 @@ 

      parser = argparse.ArgumentParser(

          "go2rpm", formatter_class=argparse.RawTextHelpFormatter

      )

-     parser.add_argument(

+     changelog_group = parser.add_mutually_exclusive_group()

+     changelog_group.add_argument(

          "-r",

          "--rpmautospec",

          action="store_true",

          default=True,

-         help="Use autorelease and autochangelog features"

+         help="Use autorelease and autochangelog features",

+     )

+     changelog_group.add_argument(

+         "-n",

+         "--no-rpmautospec",

+         action="store_false",

+         dest="rpmautospec",

+         help="Use static release and changelog instead of rpmautospec.",

      )

      parser.add_argument(

          "--no-auto-changelog-entry",
@@ -513,6 +521,14 @@ 

                          1: legacy macros. 2: current macros. \

                          default: 2",

      )

+     parser.add_argument(

+         "-q",

+         "--no-spec-warnings",

+         dest="spec_warnings",

+         action="store_false",

+         help="Exclude warning comments from generated specfile. "

+         "Currently, this only removes the %%gometa -f explanatory comment.",

+     )

      parser.add_argument("-f", "--forge", action="store", nargs="?", help="Forge URL")

      parser.add_argument(

          "-s",
@@ -536,10 +552,18 @@ 

      parser.add_argument(

          "-c", "--commit", action="store", nargs="?", help="Package commit"

      )

-     parser.add_argument("--dynamic-buildrequires", action="store_true",

-                         help="Use dynamic BuildRequires feature")

-     parser.add_argument("-R", "--no-dynamic-buildrequires", action="store_true",

-                         help="Do not use dynamic BuildRequires feature")

+     dynamic_br_group = parser.add_mutually_exclusive_group()

+     dynamic_br_group.add_argument(

+         "--dynamic-buildrequires",

+         action="store_true",

+         help="Use dynamic BuildRequires feature",

+     )

+     dynamic_br_group.add_argument(

+         "-R",

+         "--no-dynamic-buildrequires",

+         action="store_true",

+         help="Do not use dynamic BuildRequires feature",

+     )

      parser.add_argument(

          "-C",

          "--clean",
@@ -556,7 +580,13 @@ 

      goipath = re.sub(r"^http(s?)://", r"", args.goipath)

      goipath = goipath.strip("/")

  

-     known_forge = ("github.com", "gitlab.com", "bitbucket.org", "pagure.io", "gitea.com")

+     known_forge = (

+         "github.com",

+         "gitlab.com",

+         "bitbucket.org",

+         "pagure.io",

+         "gitea.com",

+     )

      known_forge_re = r"^(" + r"|".join(re.escape(url) for url in known_forge) + r")"

      if not re.search(known_forge_re, goipath) and args.forge is None:

          print(
@@ -606,7 +636,9 @@ 

                  set(buildrequires)

              )

          )

-         test_buildrequires = [ipath for ipath in test_buildrequires if goipath not in ipath]

+         test_buildrequires = [

+             ipath for ipath in test_buildrequires if goipath not in ipath

+         ]

      else:

          args.dynamic_buildrequires = True

          buildrequires = []
@@ -663,6 +695,7 @@ 

      kwargs["other_cmd"] = other_cmd

  

      kwargs["rpmautospec"] = args.rpmautospec

+     kwargs["spec_warnings"] = args.spec_warnings

      if args.no_auto_changelog_entry:

          kwargs["auto_changelog_entry"] = False

      else:

@@ -20,7 +20,19 @@ 

  %global commit          {{ commit }}

  {% endif %}

  

- %gometa

+ {% if spec_warnings %}

+ # REMOVE BEFORE SUBMITTING THIS FOR REVIEW

+ # ---

+ # New Fedora packages should use %%gometa -f, which makes the package

+ # ExclusiveArch to %%golang_arches_future and thus excludes the package from

+ # %%ix86. If the new package is needed as a dependency for another pacage,

+ # please consider removing that package from %%ix86 in the same way, instead of

+ # building more go packages for i686. If your package is not a leaf package,

+ # you'll need to coordinate the removal of the package's dependents first.

+ # ---

+ # REMOVE BEFORE SUBMITTING THIS FOR REVIEW

+ {% endif %}

+ %gometa -f

  

  {% if altipaths is not none %}

  %global goaltipaths     {{ altipaths|join(' ') }}
@@ -70,8 +82,7 @@ 

  

  {% endif %}

  {% endif %}

- %description

- %{common_description}

+ %description %{common_description}

  

  %gopkg

  

rebased onto f836494

2 years ago

rebased onto c3a9e96

2 years ago

I think we can remove the part about other packages now that we decided to keep the -devel packages noarch.

rebased onto f836494

2 years ago

rebased onto fd20a5f

2 years ago

rebased onto 29040f7

2 years ago

1 new commit added

  • Use %%gometa -f by default
2 years ago

7 new commits added

  • Add --no-spec-warnings argument
  • Add argument to disable rpmautospec
  • Fix jinja2 deprecation warning
  • Make contradictory arguments mutually exclusive
  • Format with black
  • template: Remove leading newline from %description
  • Remove old rust2rpm licensing import
2 years ago

Pull-Request has been merged by gotmax23

2 years ago