Patch out usage of github.com/kardianos/osext.

This commit is contained in:
Elliott Sales de Andrade 2019-07-13 05:05:25 -04:00
parent 675b31e71b
commit ce41bb901d
2 changed files with 64 additions and 3 deletions

View File

@ -0,0 +1,56 @@
From 9660bf7fc9d7d29b96fef2fa7e829b845d17cd35 Mon Sep 17 00:00:00 2001
From: Dmitry Smirnov <onlyjob@raid6.com.au>
Date: Wed, 4 Jul 2018 05:35:32 +0000
Subject: [PATCH] Remove kardianos/osext.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
monitor.go | 3 +--
panicwrap.go | 3 +--
2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/monitor.go b/monitor.go
index 1bb27e8..3e7b945 100644
--- a/monitor.go
+++ b/monitor.go
@@ -3,7 +3,6 @@
package panicwrap
import (
- "github.com/kardianos/osext"
"os"
"os/exec"
)
@@ -29,7 +28,7 @@ func monitor(c *WrapConfig) (int, error) {
os.Exit(0)
}
- exePath, err := osext.Executable()
+ exePath, err := os.Executable()
if err != nil {
return -1, err
}
diff --git a/panicwrap.go b/panicwrap.go
index 7a7fe29..315f0e3 100644
--- a/panicwrap.go
+++ b/panicwrap.go
@@ -12,7 +12,6 @@ package panicwrap
import (
"bytes"
"errors"
- "github.com/kardianos/osext"
"io"
"os"
"os/exec"
@@ -143,7 +142,7 @@ func wrap(c *WrapConfig) (int, error) {
}
// Get the path to our current executable
- exePath, err := osext.Executable()
+ exePath, err := os.Executable()
if err != nil {
return -1, err
}
--
2.21.0

View File

@ -31,7 +31,7 @@ section below on why.}
%global gosupfiles glide.lock glide.yaml
Name: %{goname}
Release: 3%{?dist}
Release: 4%{?dist}
Summary: Go library for catching and handling panics in Go applications
License: MIT
@ -39,8 +39,9 @@ URL: %{gourl}
Source0: %{gosource}
Source1: glide.yaml
Source2: glide.lock
BuildRequires: golang(github.com/kardianos/osext)
# Unnecessary in Go 1.8+
# https://github.com/bugsnag/panicwrap/issues/9
Patch0001: 0001-Remove-kardianos-osext.patch
%description
%{common_description}
@ -49,6 +50,7 @@ BuildRequires: golang(github.com/kardianos/osext)
%prep
%goprep
%patch0001 -p1
cp %{S:1} %{S:2} .
%install
@ -62,6 +64,9 @@ cp %{S:1} %{S:2} .
%gopkgfiles
%changelog
* Sat Jul 13 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 1.2.0-4
- Patch out usage of deprecated github.com/kardianos/osext
* Wed May 01 18:04:33 CEST 2019 Robert-André Mauchin <zebob.m@gmail.com> - 1.2.0-3
- Update to new macros