- Update to version 1.07.1:

OBS-URL: https://build.opensuse.org/package/show/Base:System/bc?expand=0&rev=14
This commit is contained in:
Petr Gajdos 2017-04-10 08:02:06 +00:00 committed by Git OBS Bridge
parent eb131acf65
commit 1d47834560
6 changed files with 136 additions and 21 deletions

60
bc-1.06-dc_ibase.patch Normal file
View File

@ -0,0 +1,60 @@
Index: dc/numeric.c
===================================================================
--- dc/numeric.c.orig
+++ dc/numeric.c
@@ -307,6 +307,8 @@ dc_getnum DC_DECLARG((input, ibase, read
int digit;
int decimal;
int c;
+ int c_buff = 0;
+ int multi = 0;
bc_init_num(&tmp);
bc_init_num(&build);
@@ -324,6 +326,9 @@ dc_getnum DC_DECLARG((input, ibase, read
}
while (isspace(c))
c = (*input)();
+ c_buff = (*input)();
+ if (isdigit(c_buff) || ('A' <= c_buff && c_buff <= 'F') || c_buff == '.')
+ multi = 1;
for (;;){
if (isdigit(c))
digit = c - '0';
@@ -331,10 +336,15 @@ dc_getnum DC_DECLARG((input, ibase, read
digit = 10 + c - 'A';
else
break;
- c = (*input)();
+ digit = multi ? (digit >= ibase ? ibase -1 : digit) : digit;
bc_int2num(&tmp, digit);
bc_multiply(result, base, &result, 0);
bc_add(result, tmp, &result, 0);
+ if (c_buff) {
+ c = c_buff;
+ c_buff = 0;
+ } else
+ c = (*input)();
}
if (c == '.'){
bc_free_num(&build);
@@ -343,13 +353,18 @@ dc_getnum DC_DECLARG((input, ibase, read
build = bc_copy_num(_zero_);
decimal = 0;
for (;;){
- c = (*input)();
+ if (c_buff) {
+ c = c_buff;
+ c_buff = 0;
+ } else
+ c = (*input)();
if (isdigit(c))
digit = c - '0';
else if ('A' <= c && c <= 'F')
digit = 10 + c - 'A';
else
break;
+ digit = digit >= ibase ? ibase -1 : digit;
bc_int2num(&tmp, digit);
bc_multiply(build, base, &build, 0);
bc_add(build, tmp, &build, 0);

BIN
bc-1.07.1.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

BIN
bc-1.07.1.tar.gz.sig Normal file

Binary file not shown.

View File

@ -1,3 +1,29 @@
-------------------------------------------------------------------
Mon Apr 10 07:39:45 UTC 2017 - mpluskal@suse.com
- Update to version 1.07.1:
* Fixed ibase extension causing problems for read()
* Fixed parallel make problem.
* Fixed dc "Q" comanmd bug.
- Changes for version 1.07:
* Added void functions.
* fixes bug in load_code introduced by mathlib string storage in 1.06.
* fix to get long options working.
* signal code clean-up.
* fixed a bug in the AVL tree routines.
* fixed math library to work properly when called with ibase not 10.
* fixed a symbol table bug when using more than 32 names.
* removed a double free.
* Added base 17 to 36 for ibase.
* Fixed some memory leaks.
* Various small tweaks and doc bug fixes.
- Drop no longer needed patches:
* bc-1.06.95-memleak.patch
* bc-1.06.95-matlib.patch
* bc-1.06.95-sigintmasking.patch
- Refresh bc-1.06-dc_ibase.patch
- Add gpg signature
-------------------------------------------------------------------
Mon Mar 16 18:42:48 UTC 2015 - mpluskal@suse.com

29
bc.keyring Normal file
View File

@ -0,0 +1,29 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQGiBEmwKfERBACiM/++m+F5//UyzoIZTd/gHxhpWDAQ1XD04P/FxNEOIPtn21MX
EGLJBdDL+k+SDwjIIwy9JbYSn6kCCL93kw2ZqqPQ6GQkjKkBE4YaOI7FKlIRgY5M
nHCwvFQQjpXz0U0tG2HuETIHQZPU308BTXIB6FpxERtiZjA1LdA9Un8lGwCg5CO9
V81S/aOeYfzoyiwi8MwAH50D/2bhyKnsyxOlh/lBBQNn87/pDKUU8D5z9WUJgA5r
Lr+qBxxtlJK9MSWmZwcd3Sfd9bqJlKLbXPC7zgIg7p08H2A4WpelOL+EL5lG9GeI
e84ShTKLiI2TzsIlDHgvTzjCS7DBN44ILRrHHdvt1MlpE6mXCacYtTZATWbA8wAg
+FaRA/0fV4qnvj4CFBRyQa9sfxgtqYYp+A9bTeCuxzvel1k4WWWZUwe5UCRi6/+p
4ze9MAwmXT20b481rl3vkBVOg5WkgCjWSQDxokwig3geaJyFg47TkgG5rh4EWy7g
JbS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.spec
View File

@ -1,7 +1,7 @@
#
# spec file for package bc
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -17,17 +17,16 @@
Name: bc
Version: 1.06.95
Version: 1.07.1
Release: 0
Summary: GNU Command Line Calculator
License: GPL-2.0+
Group: Productivity/Scientific/Math
Url: http://www.gnu.org/software/bc/
Source0: ftp://alpha.gnu.org/pub/gnu/bc/bc-%{version}.tar.bz2
Url: https://www.gnu.org/software/bc/
Source0: https://ftp.gnu.org/gnu/bc/bc-%{version}.tar.gz
Source1: https://ftp.gnu.org/gnu/bc/bc-%{version}.tar.gz.sig
Source2: %{name}.keyring
Patch1: bc-1.06-dc_ibase.patch
Patch2: bc-1.06.95-memleak.patch
Patch3: bc-1.06.95-matlib.patch
Patch4: bc-1.06.95-sigintmasking.patch
BuildRequires: bison
BuildRequires: ed
BuildRequires: flex
@ -36,7 +35,6 @@ BuildRequires: ncurses-devel
BuildRequires: readline-devel
Requires(post): %{install_info_prereq}
Requires(preun): %{install_info_prereq}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
bc is an interpreter that supports numbers of arbitrary precision and
@ -58,34 +56,33 @@ and "pushes" its results back onto the stack.
%prep
%setup -q
%patch1 -p1 -b .dc_ibase
%patch2 -p1 -b .memleak
%patch3 -p1 -b .matlib
%patch4 -p1 -b .sigintmask
%patch1
%build
%configure \
--with-readline \
--without-libedit
--with-readline \
--without-libedit
make %{?_smp_mflags}
%install
make DESTDIR=%{buildroot} install %{?_smp_mflags}
%make_install
%post
%install_info --info-dir=%{_infodir} %{_infodir}/bc.info.gz
%install_info --info-dir=%{_infodir} %{_infodir}/dc.info.gz
%install_info --info-dir=%{_infodir} %{_infodir}/bc.info%{ext_info}
%install_info --info-dir=%{_infodir} %{_infodir}/dc.info%{ext_info}
%preun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/bc.info.gz
%install_info_delete --info-dir=%{_infodir} %{_infodir}/dc.info.gz
%install_info_delete --info-dir=%{_infodir} %{_infodir}/bc.info%{ext_info}
%install_info_delete --info-dir=%{_infodir} %{_infodir}/dc.info%{ext_info}
%files
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog NEWS README COPYING.LIB FAQ
%{_bindir}/bc
%{_bindir}/dc
%{_infodir}/*.info*
%{_mandir}/man1/*
%{_infodir}/bc.info%{ext_info}
%{_infodir}/dc.info%{ext_info}
%{_mandir}/man1/bc.1%{ext_man}
%{_mandir}/man1/dc.1%{ext_man}
%changelog