From 70eca9a5216a3769c14c05ad48219bbdbf1ff040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 17 May 2017 08:41:02 +0200 Subject: sterm add patch for more descriptive error messages --- .../Print-more-descriptive-error-message.patch | 46 ++++++++++++++++++++++ net-dialup/sterm/sterm-20170112-r2.ebuild | 24 +++++++++++ net-dialup/sterm/sterm-20170112.ebuild | 24 ----------- 3 files changed, 70 insertions(+), 24 deletions(-) create mode 100644 net-dialup/sterm/files/Print-more-descriptive-error-message.patch create mode 100644 net-dialup/sterm/sterm-20170112-r2.ebuild delete mode 100644 net-dialup/sterm/sterm-20170112.ebuild (limited to 'net-dialup/sterm') diff --git a/net-dialup/sterm/files/Print-more-descriptive-error-message.patch b/net-dialup/sterm/files/Print-more-descriptive-error-message.patch new file mode 100644 index 0000000..9db1dad --- /dev/null +++ b/net-dialup/sterm/files/Print-more-descriptive-error-message.patch @@ -0,0 +1,46 @@ +From 613b8407347b063320ebf408d06bb120293c6c3a Mon Sep 17 00:00:00 2001 +From: Michal Sojka +Date: Thu, 4 May 2017 00:00:10 +0200 +Subject: [PATCH] Print more descriptive error message + +--- + sterm.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/sterm.c b/sterm.c +index b375caf..ea86573 100644 +--- a/sterm.c ++++ b/sterm.c +@@ -31,6 +31,7 @@ + + #define _BSD_SOURCE + #define _DEFAULT_SOURCE ++#define _GNU_SOURCE + #include + #include + #include +@@ -44,6 +45,7 @@ + #include + #include + #include ++#include + + #define STRINGIFY(val) #val + #define TOSTRING(val) STRINGIFY(val) +@@ -269,7 +271,12 @@ int main(int argc, char *argv[]) + fprintf(stderr, "%s is used by PID %d\n", dev, pid); + exit(1); + } else if (pid < 0) { +- perror("dev_lock()"); ++ char *msg; ++ asprintf(&msg, "dev_lock('%s')", dev); /* No free() because we exit() immediately */ ++ if (errno) ++ perror(msg); ++ else ++ fprintf(stderr, "%s: Error\n", msg); + exit(1); + } + atexit(unlock); +-- +2.13.0 + diff --git a/net-dialup/sterm/sterm-20170112-r2.ebuild b/net-dialup/sterm/sterm-20170112-r2.ebuild new file mode 100644 index 0000000..d3ab7b9 --- /dev/null +++ b/net-dialup/sterm/sterm-20170112-r2.ebuild @@ -0,0 +1,24 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +inherit eutils git-r3 + +DESCRIPTION="Simple serial terminal" +HOMEPAGE="https://rtime.felk.cvut.cz/gitweb/sojka/sterm.git" + +EGIT_REPO_URI="git://rtime.felk.cvut.cz/sojka/sterm.git" +EGIT_COMMIT="${PV}" + +LICENSE="GPL-3.0+" +SLOT="0" +KEYWORDS="amd64 x86" +IUSE="" + +DEPEND="dev-libs/lockdev" +RDEPEND="${DEPEND}" + +src_prepare() { + epatch "${FILESDIR}/Fix-install-strip.patch" +} diff --git a/net-dialup/sterm/sterm-20170112.ebuild b/net-dialup/sterm/sterm-20170112.ebuild deleted file mode 100644 index d3ab7b9..0000000 --- a/net-dialup/sterm/sterm-20170112.ebuild +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=5 - -inherit eutils git-r3 - -DESCRIPTION="Simple serial terminal" -HOMEPAGE="https://rtime.felk.cvut.cz/gitweb/sojka/sterm.git" - -EGIT_REPO_URI="git://rtime.felk.cvut.cz/sojka/sterm.git" -EGIT_COMMIT="${PV}" - -LICENSE="GPL-3.0+" -SLOT="0" -KEYWORDS="amd64 x86" -IUSE="" - -DEPEND="dev-libs/lockdev" -RDEPEND="${DEPEND}" - -src_prepare() { - epatch "${FILESDIR}/Fix-install-strip.patch" -} -- cgit v1.2.3