From 27eb64a05f81bbbd774729ac6fe37ad5cf845748942b6dd3234e508d7a0b2f65 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Thu, 5 Jul 2007 11:11:30 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/parted?expand=0&rev=10 --- parted.changes | 7 +++++++ parted.spec | 10 ++++++++-- parted.tty.patch | 21 +++++++++++++++++++++ 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 parted.tty.patch diff --git a/parted.changes b/parted.changes index ba933af..0818672 100644 --- a/parted.changes +++ b/parted.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Jul 5 12:55:37 CEST 2007 - sassmann@suse.de + +- fix parted to generate parseable output (#289049) + added check to test if tty is availabe, if no tty is available + readline functions are omitted + ------------------------------------------------------------------- Thu Jun 21 17:25:54 CEST 2007 - adrian@suse.de diff --git a/parted.spec b/parted.spec index e41931f..0e88fa6 100644 --- a/parted.spec +++ b/parted.spec @@ -13,11 +13,11 @@ Name: parted BuildRequires: device-mapper device-mapper-devel e2fsprogs-devel libreiserfs readline-devel reiserfs %define aclocaldir /usr/share/aclocal -License: GNU General Public License (GPL) +License: GPL v2 or later Group: System/Filesystems Summary: GNU partitioner Version: 1.8.7 -Release: 14 +Release: 16 Source0: %{name}-%{version}.tar.bz2 Patch: always-resize-part.dif Patch1: parted-type.patch @@ -29,6 +29,7 @@ Patch7: parted-1.8.3.dif Patch8: fat16_hfs_fix.dif Patch9: always_print_geom.diff Patch42: parted-1.8.7-linux-swap.patch +Patch51: parted.tty.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build URL: http://www.gnu.org/software/parted/ PreReq: %install_info_prereq @@ -75,6 +76,7 @@ Authors: %patch7 %patch8 -p1 %patch9 +%patch51 -p1 %build #autoreconf --force --install @@ -122,6 +124,10 @@ rm -rf "$RPM_BUILD_ROOT" %{_libdir}/*.so %changelog +* Thu Jul 05 2007 - sassmann@suse.de +- fix parted to generate parseable output (#289049) + added check to test if tty is availabe, if no tty is available + readline functions are omitted * Thu Jun 21 2007 - adrian@suse.de - fix changelog entry order * Sun May 13 2007 - olh@suse.de diff --git a/parted.tty.patch b/parted.tty.patch new file mode 100644 index 0000000..7211351 --- /dev/null +++ b/parted.tty.patch @@ -0,0 +1,21 @@ +Index: parted-1.8.7/parted/ui.c +=================================================================== +--- parted-1.8.7.orig/parted/ui.c ++++ parted-1.8.7/parted/ui.c +@@ -1374,9 +1374,13 @@ init_ui () + ped_exception_set_handler (exception_handler); + + #ifdef HAVE_LIBREADLINE +- rl_initialize (); +- rl_attempted_completion_function = (CPPFunction*) complete_function; +- readline_state.in_readline = 0; ++ /* check for tty is favorable here because readline might try to set some ++ * terminal stuff that messes up parsing in non-interactive mode */ ++ if( isatty(fileno(stdout)) ) { ++ rl_initialize (); ++ rl_attempted_completion_function = (CPPFunction*) complete_function; ++ readline_state.in_readline = 0; ++ } + #endif + + #ifdef SA_SIGINFO