Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package nodejs-common for openSUSE:Factory checked in at 2021-06-16 20:33:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/nodejs-common (Old) and /work/SRC/openSUSE:Factory/.nodejs-common.new.32437 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nodejs-common" Wed Jun 16 20:33:15 2021 rev:13 rq:899493 version:5.0 Changes: -------- --- /work/SRC/openSUSE:Factory/nodejs-common/nodejs-common.changes 2021-05-10 15:39:02.929645572 +0200 +++ /work/SRC/openSUSE:Factory/.nodejs-common.new.32437/nodejs-common.changes 2021-06-16 20:33:16.262959443 +0200 @@ -1,0 +2,10 @@ +Thu Jun 10 10:27:58 UTC 2021 - Adam Majer <adam.ma...@suse.de> + +- Use libalternatives on TW by default + +------------------------------------------------------------------- +Mon May 31 16:32:18 UTC 2021 - Adam Majer <adam.ma...@suse.de> + +- Add libalternatives support + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ nodejs-common.spec ++++++ --- /var/tmp/diff_new_pack.TAsql0/_old 2021-06-16 20:33:16.842960433 +0200 +++ /var/tmp/diff_new_pack.TAsql0/_new 2021-06-16 20:33:16.842960433 +0200 @@ -28,6 +28,12 @@ %define NODEJS_LTS 16 %define NODEJS_CURRENT 16 +%if 0%{?suse_version} > 1500 +%bcond_without libalternatives +%else +%bcond_with libalternatives +%endif + # SLE-12 variants %if 0%{?suse_version} < 1500 %define default_node_ver %NODEJS_LTS @@ -64,7 +70,7 @@ %endif Name: nodejs-common -Version: 4.1 +Version: 5.0 Release: 0 Summary: Common files for the NodeJS ecosystem License: MIT @@ -78,6 +84,11 @@ Conflicts: nodejs7 < 7.10.1 Conflicts: nodejs8 < 8.1.4 BuildRequires: gcc +%if %{with libalternatives} +BuildRequires: libalternatives-devel +%define libalternatives_cflags -DHAVE_LIBALTERNATIVES_H +%define libalternatives_lflags -lalternatives +%endif %description Common NodeJS files that allow recursive invocation of Node executable @@ -120,7 +131,7 @@ %prep %build cp %{S:2} . -gcc ${RPM_OPT_FLAGS} -o node %{S:1} +gcc ${RPM_OPT_FLAGS} %?libalternatives_cflags -o node %{S:1} %?libalternatives_lflags echo "Default Node version: " %{default_node_ver} ++++++ node.c ++++++ --- /var/tmp/diff_new_pack.TAsql0/_old 2021-06-16 20:33:16.914960556 +0200 +++ /var/tmp/diff_new_pack.TAsql0/_new 2021-06-16 20:33:16.914960556 +0200 @@ -5,6 +5,10 @@ #include <string.h> #include <unistd.h> +#ifdef HAVE_LIBALTERNATIVES_H +#include <libalternatives.h> +#endif + const unsigned min_version = 4; const unsigned max_version = 42; const char *default_version = "-default"; @@ -62,6 +66,17 @@ printInvalidVersion(version); } +#ifdef HAVE_LIBALTERNATIVES_H + // if we want default version and not using update-alternatives + if (version == default_version) + { + // should not return, and if it does, it probably means + // we should fall back to using node-default fallback. + libalts_exec_default(argv); + fputs("Falling back to using -default symlink.\n", stderr); + } +#endif + /* Generate our program path and check that we can execute it */ char *program_path, *program; if (asprintf(&program, "%s%s", *bn, version) == -1 ||