11
0
forked from pool/erlang-rebar

Accepting request 1010503 from home:matwey:branches:devel:languages:erlang

- Add 0001-Fix-rebar-xref-for-recent-Erlang.patch:
  fix testsuite
- Move rpm macros from /etc/rpm to %{_rpmmacrodir} (boo#1185668).
- Add 0001-Fix-rebar-xref-for-recent-Erlang.patch:
  fix testsuite

OBS-URL: https://build.opensuse.org/request/show/1010503
OBS-URL: https://build.opensuse.org/package/show/devel:languages:erlang/erlang-rebar?expand=0&rev=41
This commit is contained in:
2022-10-14 08:14:19 +00:00
committed by Git OBS Bridge
parent a673d32182
commit 6f350d64e6
5 changed files with 55 additions and 6 deletions

View File

@@ -0,0 +1,26 @@
From 1b80dcbeee8fd9ac7117b02b7893249ad2b242d1 Mon Sep 17 00:00:00 2001
From: "Matwey V. Kornilov" <matwey.kornilov@gmail.com>
Date: Wed, 12 Oct 2022 19:40:26 +0300
Subject: [PATCH] Fix rebar xref for recent Erlang
(cherry picked from commit 21c06fdf9b67b7bed0e5dd9c86905407abced6aa)
---
src/rebar_xref.erl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/rebar_xref.erl b/src/rebar_xref.erl
index ddfb029..ed905b6 100644
--- a/src/rebar_xref.erl
+++ b/src/rebar_xref.erl
@@ -288,7 +288,7 @@ find_function_source(M, F, A, Bin) ->
AbstractCode = beam_lib:chunks(Bin, [abstract_code]),
{ok, {M, [{abstract_code, {raw_abstract_v1, Code}}]}} = AbstractCode,
%% Extract the original source filename from the abstract code
- [{attribute, 1, file, {Source, _}} | _] = Code,
+ [{attribute, _, file, {Source, _}} | _] = [Attr || Attr = {attribute, _, file, _} <- Code],
%% Extract the line number for a given function def
Fn = [E || E <- Code,
safe_element(1, E) == function,
--
2.37.3

View File

@@ -1,3 +1,14 @@
-------------------------------------------------------------------
Wed Oct 12 17:49:50 UTC 2022 - Matwey Kornilov <matwey.kornilov@gmail.com>
- Add 0001-Fix-rebar-xref-for-recent-Erlang.patch:
fix testsuite
-------------------------------------------------------------------
Wed Jun 30 12:41:37 UTC 2021 - Dominique Leuenberger <dimstar@opensuse.org>
- Move rpm macros from /etc/rpm to %{_rpmmacrodir} (boo#1185668).
-------------------------------------------------------------------
Sat Jan 16 09:08:03 UTC 2021 - Matwey Kornilov <matwey.kornilov@gmail.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package erlang-rebar-testsuite
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -34,6 +34,7 @@ Patch5: erlc_dep_graph-timeout.patch
# PATCH-FIX-OPENSUSE -- bmwiedemann
Patch6: reproducible.patch
Patch7: rebar-0014-erl_interface-was-removed-in-Erlang-23.patch
Patch8: 0001-Fix-rebar-xref-for-recent-Erlang.patch
BuildRequires: erlang >= R13B01
%if 0%{?suse_version} > 1320
BuildRequires: strip-nondeterminism
@@ -85,6 +86,7 @@ test Erlang applications, port drivers and releases.
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%build
export REBAR_DEPS_PREFER_LIBS=1
@@ -103,7 +105,7 @@ fi
%if %{normal_build}
install -Dm755 rebar %{buildroot}%{_bindir}/rebar
# Install RPM macros:
install -Dm644 %{SOURCE1} %{buildroot}%{_sysconfdir}/rpm/macros.erlang-rebar
install -Dm644 %{SOURCE1} %{buildroot}%{_rpmmacrodir}/macros.erlang-rebar
for dir in include ebin priv src ; do
install -d %{buildroot}%{erlang_libdir}/rebar-%{mod_ver}/${dir}
cp -r ${dir}/* %{buildroot}%{erlang_libdir}/rebar-%{mod_ver}/${dir}/
@@ -136,9 +138,10 @@ rm test/rebar_dia_tests.erl
%if %{normal_build}
%files
%defattr(-,root,root)
%doc README.md THANKS LICENSE rebar.config.sample
%doc README.md THANKS rebar.config.sample
%license LICENSE
%{_bindir}/rebar
%config %{_sysconfdir}/rpm/macros.erlang-rebar
%{_rpmmacrodir}/macros.erlang-rebar
%dir %{erlang_libdir}/rebar-%{mod_ver}
%{erlang_libdir}/rebar-%{mod_ver}/ebin
%{erlang_libdir}/rebar-%{mod_ver}/include

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Oct 12 17:49:50 UTC 2022 - Matwey Kornilov <matwey.kornilov@gmail.com>
- Add 0001-Fix-rebar-xref-for-recent-Erlang.patch:
fix testsuite
-------------------------------------------------------------------
Wed Jun 30 12:41:37 UTC 2021 - Dominique Leuenberger <dimstar@opensuse.org>

View File

@@ -1,7 +1,7 @@
#
# spec file for package erlang-rebar
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -34,6 +34,7 @@ Patch5: erlc_dep_graph-timeout.patch
# PATCH-FIX-OPENSUSE -- bmwiedemann
Patch6: reproducible.patch
Patch7: rebar-0014-erl_interface-was-removed-in-Erlang-23.patch
Patch8: 0001-Fix-rebar-xref-for-recent-Erlang.patch
BuildRequires: erlang >= R13B01
%if 0%{?suse_version} > 1320
BuildRequires: strip-nondeterminism
@@ -85,6 +86,7 @@ test Erlang applications, port drivers and releases.
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%build
export REBAR_DEPS_PREFER_LIBS=1
@@ -136,7 +138,8 @@ rm test/rebar_dia_tests.erl
%if %{normal_build}
%files
%defattr(-,root,root)
%doc README.md THANKS LICENSE rebar.config.sample
%doc README.md THANKS rebar.config.sample
%license LICENSE
%{_bindir}/rebar
%{_rpmmacrodir}/macros.erlang-rebar
%dir %{erlang_libdir}/rebar-%{mod_ver}