#5 Fix broken dependency between nodejs and nodejs-libs
Closed 4 years ago by tomh. Opened 4 years ago by churchyard.
rpms/ churchyard/nodejs requires_fix  into  master

file modified
+4 -4
@@ -168,7 +168,7 @@ 

  # we need the system certificate store

  Requires: ca-certificates

  

- Requires: nodejs-libs%{?_isa} = %{epoch}:%{nodejs_version}-%{nodejs_release}%{?dist}

+ Requires: nodejs-libs%{?_isa} = %{epoch}:%{version}-%{release}

  

  

  #we need ABI virtual provides where SONAMEs aren't enough/not present so deps
@@ -219,9 +219,9 @@ 

  # Make sure we keep NPM up to date when we update Node.js

  %if 0%{?rhel}

  # EPEL doesn't support Recommends, so make it strict

- Requires: npm = %{npm_epoch}:%{npm_version}-%{npm_release}%{?dist}

+ Requires: npm >= %{npm_epoch}:%{npm_version}-%{npm_release}

  %else

- Recommends: npm = %{npm_epoch}:%{npm_version}-%{npm_release}%{?dist}

+ Recommends: npm >= %{npm_epoch}:%{npm_version}-%{npm_release}

  %endif

  

  
@@ -293,7 +293,7 @@ 

  # now.

  Obsoletes: npm < 0:3.5.4-6

  Provides: npm = %{npm_epoch}:%{npm_version}

- Requires: nodejs = %{epoch}:%{nodejs_version}-%{nodejs_release}%{?dist}

+ Requires: nodejs = %{epoch}:%{version}-%{release}

  

  # Do not add epoch to the virtual NPM provides or it will break

  # the automatic dependency-generation script.

This changes the release tag not to be a minorbump.

Also, it makes sure the dependencies are specified in a way that won't break
next time:

  • when possible, use %{version}-%{release} directly to avoid inconsistency
  • for npm, make the dependency >= without %{?dist}
  • that makes sure it works even with minorbumps
  • npm already requires nodejs == E:V-R, so this won't break

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1734582

Please review thoroughly, this has not been tested.

OK, this now conflicts with https://src.fedoraproject.org/rpms/nodejs/c/ba96d369472bfe962ff6f4886a807ff7bfe65f6a?branch=master

@tomh was faster. I'll amend to only add the changes.

rebased onto 1cd522f

4 years ago

I've merged this and have also committed a change to take the release number from a %baserelease macro, which rpmdev-bumpspec will bump in preference to the main release tag so that we should avoid getting trailing minor versions which people will forget to remove again.

Pull-Request has been closed by tomh

4 years ago