#11 Have default versions provide the versioned name
Merged 3 months ago by sgallagh. Opened 3 months ago by sgallagh.
rpms/ sgallagh/nodejs20 def_ver  into  rawhide

file modified
+6 -1
@@ -207,6 +207,7 @@ 

  # replace nodejs20-20.6.0.

  %define unversioned_obsoletes_of_nodejsXX_if_default() %{expand:\

  Obsoletes: nodejs%{nodejs_pkg_major}%{?1:-%{1}}\

+ Provides: nodejs%{nodejs_pkg_major}%{?1:-%{1}} = %{nodejs_envr}\

  }

  %else

  %define unversioned_obsoletes_of_nodejsXX_if_default() %{nil}
@@ -457,8 +458,12 @@ 

  

  # Obsolete the old 'npm' package

  Obsoletes: npm < 1:9

+ 

+ # Obsolete others. We can't use %%unversioned_obsoletes_of_nodejsXX_if_default

+ # here because the Provides: needs its own version

+ Obsoletes: nodejs%{nodejs_pkg_major}-npm

+ Provides: nodejs%{nodejs_pkg_major}-npm = %{npm_envr}

  %endif

- %unversioned_obsoletes_of_nodejsXX_if_default npm

  

  

  %description -n %{pkgname}-npm

file modified
+6 -1
@@ -211,6 +211,7 @@ 

  # replace nodejs20-20.6.0.

  %define unversioned_obsoletes_of_nodejsXX_if_default() %{expand:\

  Obsoletes: nodejs%{nodejs_pkg_major}%{?1:-%{1}}\

+ Provides: nodejs%{nodejs_pkg_major}%{?1:-%{1}} = %{nodejs_envr}\

  }

  %else

  %define unversioned_obsoletes_of_nodejsXX_if_default() %{nil}
@@ -469,8 +470,12 @@ 

  

  # Obsolete the old 'npm' package

  Obsoletes: npm < 1:9

+ 

+ # Obsolete others. We can't use %%unversioned_obsoletes_of_nodejsXX_if_default

+ # here because the Provides: needs its own version

+ Obsoletes: nodejs%{nodejs_pkg_major}-npm

+ Provides: nodejs%{nodejs_pkg_major}-npm = %{npm_envr}

  %endif

- %unversioned_obsoletes_of_nodejsXX_if_default npm

  

  

  %description -n %{pkgname}-npm

Special handling is required for nodejs-npm due to the differing
version.

Signed-off-by: Stephen Gallagher sgallagh@redhat.com

You could add a -v (as in version) argument to %unversioned_obsoletes_of_nodejsXX_if_default, but then, perhaps not doing it and keeping it simpler is better.

$ rpm -qPp nodejs-libs-20.11.1-3.fc41.x86_64.rpm | grep nodejs
nodejs-libs = 1:20.11.1-3.fc41
nodejs-libs(x86-64) = 1:20.11.1-3.fc41
nodejs20-libs = 1:20.11.1-3.fc41

$ rpm -qPp nodejs-devel-20.11.1-3.fc41.x86_64.rpm | grep nodejs
nodejs-devel = 1:20.11.1-3.fc41
nodejs-devel(x86-64) = 1:20.11.1-3.fc41
nodejs-devel-pkg = 1:20.11.1-3.fc41
nodejs20-devel = 1:20.11.1-3.fc41
pkgconfig(nodejs-20) = 20.11.1

$ rpm -qPp nodejs-20.11.1-3.fc41.x86_64.rpm | grep nodejs
nodejs = 1:20.11.1-3.fc41
nodejs(abi) = 115
nodejs(abi20) = 115
nodejs(engine) = 20.11.1
nodejs(x86-64) = 1:20.11.1-3.fc41
nodejs-punycode = 2.1.0
nodejs20 = 1:20.11.1-3.fc41

$ rpm -qPp nodejs-npm-10.2.4-1.20.11.1.3.fc41.x86_64.rpm | grep '^nodejs'
nodejs-npm = 1:10.2.4-1.20.11.1.3.fc41
nodejs-npm(x86-64) = 1:10.2.4-1.20.11.1.3.fc41
nodejs20 = 1:20.11.1-3.fc41
nodejs20-npm = 1:10.2.4-1.20.11.1.3.fc41

The results look good.

EDIT: No, they don't, npm provides nodejs20.

Please escape the % in the comment

Please escape the % in the comment

The surrounding block of code expands to:

...
Obsoletes: npm < 1:9


Obsoletes: nodejs20
Provides: nodejs20 = 1:20.11.1-1.fc39


Obsoletes: nodejs20-npm
Provides: nodejs20-npm = 1:10.2.4-1.20.11.1.1.fc39
...

And that isn't good. The npm package now provides and obsoletes nodejs20 (the default generated by the unesacaped macro in the comment).

rebased onto 4f5185a

3 months ago

Please escape the % in the comment
...
And that isn't good. The npm package now provides and obsoletes nodejs20 (the default generated by the unesacaped macro in the comment).

Great catch! Thanks.

Fixed in the new push.

It's not escaped in the spec, only in the template.

rebased onto 96892fb

3 months ago

Oops, forgot to add that to the git commit. Fixed.

The diff looks fixed, but I'll verify the results on the scratch build once more.

Side note: Consider adding zuul to this package, it runs rpminspect which generates nice reports about gained/lost/changed provides and obsoletes.

$ rpm -qPp nodejs-npm-10.2.4-1.20.11.1.3.fc41.x86_64.rpm  | grep '^nodejs'
nodejs-npm = 1:10.2.4-1.20.11.1.3.fc41
nodejs-npm(x86-64) = 1:10.2.4-1.20.11.1.3.fc41
nodejs20-npm = 1:10.2.4-1.20.11.1.3.fc41

$ rpm -qPp nodejs-20.11.1-3.fc41.x86_64.rpm  | grep '^nodejs'
nodejs = 1:20.11.1-3.fc41
nodejs(abi) = 115
nodejs(abi20) = 115
nodejs(engine) = 20.11.1
nodejs(x86-64) = 1:20.11.1-3.fc41
nodejs-punycode = 2.1.0
nodejs20 = 1:20.11.1-3.fc41

Looks good.

Pull-Request has been merged by sgallagh

3 months ago
Metadata