From 37578dd848998b3d1459e254b4572209122afd33 Mon Sep 17 00:00:00 2001 From: mrSi-Si Date: Sun, 8 Jun 2025 14:16:40 +0300 Subject: [PATCH] GNU basic calculator v1.08.2 --- system/base/bc/actions.py | 4 +- .../bc/files/fedora/bc-1.06-dc_ibase.patch | 58 ------------------- .../base/bc/files/fedora/bc-1.06.95-doc.patch | 24 -------- .../bc/files/fedora/bc-1.06.95-matlib.patch | 20 ------- .../bc/files/fedora/bc-1.06.95-memleak.patch | 26 --------- .../fedora/bc-1.06.95-sigintmasking.patch | 27 --------- .../base/bc/files/fix_libmath_use_sed.patch | 22 ------- system/base/bc/pspec.xml | 23 ++++---- 8 files changed, 15 insertions(+), 189 deletions(-) delete mode 100644 system/base/bc/files/fedora/bc-1.06-dc_ibase.patch delete mode 100644 system/base/bc/files/fedora/bc-1.06.95-doc.patch delete mode 100644 system/base/bc/files/fedora/bc-1.06.95-matlib.patch delete mode 100644 system/base/bc/files/fedora/bc-1.06.95-memleak.patch delete mode 100644 system/base/bc/files/fedora/bc-1.06.95-sigintmasking.patch delete mode 100644 system/base/bc/files/fix_libmath_use_sed.patch diff --git a/system/base/bc/actions.py b/system/base/bc/actions.py index d2c13b5f..1136b5a3 100644 --- a/system/base/bc/actions.py +++ b/system/base/bc/actions.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- # # Licensed under the GNU General Public License, version 3. -# See the file http://www.gnu.org/licenses/gpl.txt +# See the file https://www.gnu.org/licenses/gpl-3.0.txt from pisi.actionsapi import autotools from pisi.actionsapi import pisitools @@ -17,4 +17,4 @@ def build(): def install(): autotools.rawInstall("DESTDIR=%s" % get.installDIR()) - pisitools.dodoc("AUTHORS", "FAQ", "NEWS", "README", "ChangeLog") + pisitools.dodoc("AUTHORS", "COPYING*", "NEWS") diff --git a/system/base/bc/files/fedora/bc-1.06-dc_ibase.patch b/system/base/bc/files/fedora/bc-1.06-dc_ibase.patch deleted file mode 100644 index 7d5fa20f..00000000 --- a/system/base/bc/files/fedora/bc-1.06-dc_ibase.patch +++ /dev/null @@ -1,58 +0,0 @@ ---- bc-1.06/dc/numeric.c.dc_ibase 2007-08-22 08:37:57.000000000 +0200 -+++ bc-1.06/dc/numeric.c 2007-08-22 08:37:40.000000000 +0200 -@@ -285,6 +285,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); -@@ -302,6 +304,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'; -@@ -309,10 +314,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); -@@ -321,13 +331,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); diff --git a/system/base/bc/files/fedora/bc-1.06.95-doc.patch b/system/base/bc/files/fedora/bc-1.06.95-doc.patch deleted file mode 100644 index b75f56e3..00000000 --- a/system/base/bc/files/fedora/bc-1.06.95-doc.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -up wrk/doc/bc.1.wrk wrk/doc/bc.1 ---- wrk/doc/bc.1.wrk 2013-10-02 13:36:52.066295450 +0200 -+++ wrk/doc/bc.1 2013-10-02 13:35:22.738553712 +0200 -@@ -174,6 +174,8 @@ The result of the expression is the sum - The result of the expression is the difference of the two expressions. - .IP "expr * expr" - The result of the expression is the product of the two expressions. -+If a and b are the scales of the two expressions, then the scale of the result is: -+min(a+b,max(scale,a,b)) - .IP "expr / expr" - The result of the expression is the quotient of the two expressions. - The scale of the result is the value of the variable \fBscale\fR. -diff -up wrk/doc/bc.texi.wrk wrk/doc/bc.texi ---- wrk/doc/bc.texi.wrk 2013-10-02 13:17:01.743765518 +0200 -+++ wrk/doc/bc.texi 2013-10-02 13:21:04.479870656 +0200 -@@ -290,6 +290,8 @@ The result of the expression is the diff - - @item expr * expr - The result of the expression is the product of the two expressions. -+If a and b are the scales of the two expressions, then the scale of the result is: -+min(a+b,max(@var{scale},a,b)) - - @item expr / expr - The result of the expression is the quotient of the two expressions. diff --git a/system/base/bc/files/fedora/bc-1.06.95-matlib.patch b/system/base/bc/files/fedora/bc-1.06.95-matlib.patch deleted file mode 100644 index 796c5e28..00000000 --- a/system/base/bc/files/fedora/bc-1.06.95-matlib.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -urNp bc-1.06.95-orig/bc/storage.c bc-1.06.95/bc/storage.c ---- bc-1.06.95-orig/bc/storage.c 2006-09-05 04:39:31.000000000 +0200 -+++ bc-1.06.95/bc/storage.c 2010-12-22 10:26:43.805250912 +0100 -@@ -99,6 +99,7 @@ more_functions (VOID) - { - f = &functions[indx]; - f->f_defined = FALSE; -+ f->f_void = FALSE; - f->f_body = (char *) bc_malloc (BC_START_SIZE); - f->f_body_size = BC_START_SIZE; - f->f_code_size = 0; -@@ -179,7 +180,7 @@ more_arrays () - - - /* Initialize the new elements. */ -- for (; indx < v_count; indx++) -+ for (; indx < a_count; indx++) - arrays[indx] = NULL; - - /* Free the old elements. */ diff --git a/system/base/bc/files/fedora/bc-1.06.95-memleak.patch b/system/base/bc/files/fedora/bc-1.06.95-memleak.patch deleted file mode 100644 index 0b8fc5be..00000000 --- a/system/base/bc/files/fedora/bc-1.06.95-memleak.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/bc/bc.y b/bc/bc.y -index 14dc4be..bd91c38 100644 ---- a/bc/bc.y -+++ b/bc/bc.y -@@ -569,6 +569,7 @@ expression : named_expression ASSIGN_OP - generate (">"); - break; - } -+ free($2); - } - | expression '+' expression - { -diff --git a/bc/util.c b/bc/util.c -index 30beaf9..26e2e85 100644 ---- a/bc/util.c -+++ b/bc/util.c -@@ -602,8 +602,7 @@ lookup (name, namekind) - case FUNCTDEF: - if (id->f_name != 0) - { -- if (namekind != FUNCT) -- free(name); -+ free(name); - /* Check to see if we are redefining a math lib function. */ - if (use_math && namekind == FUNCTDEF && id->f_name <= 6) - id->f_name = next_func++; diff --git a/system/base/bc/files/fedora/bc-1.06.95-sigintmasking.patch b/system/base/bc/files/fedora/bc-1.06.95-sigintmasking.patch deleted file mode 100644 index c86340ff..00000000 --- a/system/base/bc/files/fedora/bc-1.06.95-sigintmasking.patch +++ /dev/null @@ -1,27 +0,0 @@ -Binary files bc-1.06.95-orig/dc/.dc.c.swp and bc-1.06.95/dc/.dc.c.swp differ -diff -urNp bc-1.06.95-orig/dc/eval.c bc-1.06.95/dc/eval.c ---- bc-1.06.95-orig/dc/eval.c 2006-06-04 13:04:40.000000000 +0200 -+++ bc-1.06.95/dc/eval.c 2011-09-08 15:11:48.815060585 +0200 -@@ -661,7 +661,9 @@ dc_evalfile DC_DECLARG((fp)) - int next_negcmp = 0; - dc_data datum; - -- signal(SIGINT, dc_trap_interrupt); -+ /* Do not mask SIGINT when running from stdin */ -+ if (fp != stdin) -+ signal(SIGINT, dc_trap_interrupt); - stdin_lookahead = EOF; - for (c=getc(fp); c!=EOF; c=peekc){ - peekc = getc(fp); -diff -urNp bc-1.06.95-orig/doc/dc.texi bc-1.06.95/doc/dc.texi ---- bc-1.06.95-orig/doc/dc.texi 2006-06-11 10:15:54.000000000 +0200 -+++ bc-1.06.95/doc/dc.texi 2011-09-08 15:09:37.032059798 +0200 -@@ -126,6 +126,8 @@ To exit, use @samp{q}. - (or whatever other keystroke your system uses to generate a @code{SIGINT}) - does not exit; - it is used to abort macros that are looping, etc. -+This is not true if running on stdin to prevent accidental user confusion -+about @kbd{C-c} unfunctionality. - - A reverse-polish calculator stores numbers on a stack. - Entering a number pushes it on the stack. diff --git a/system/base/bc/files/fix_libmath_use_sed.patch b/system/base/bc/files/fix_libmath_use_sed.patch deleted file mode 100644 index 55b18df8..00000000 --- a/system/base/bc/files/fix_libmath_use_sed.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -Nuar bc-1.07.1.orig/bc/fix-libmath_h bc-1.07.1/bc/fix-libmath_h ---- bc-1.07.1.orig/bc/fix-libmath_h 2017-04-08 01:20:02.000000000 +0300 -+++ bc-1.07.1/bc/fix-libmath_h 2017-12-03 01:52:01.125065740 +0300 -@@ -1,9 +1,9 @@ --ed libmath.h < - + bc - http://www.gnu.org/software/bc + https://www.gnu.org/software/bc/ PisiLinux Community admins@pisilinux.org - GPLv2 + GPLv3 app:console Console-based calculator utility bc is an arbitrary precision numeric processing language and can be used as a calculator. Syntax is similar to C, but differs in many substantial areas. For example, it supports interactive execution of statements. - https://ftp.gnu.org/gnu/bc/bc-1.07.1.tar.gz + https://ftp.gnu.org/gnu/bc/bc-1.08.2.tar.lz + lzip flex texinfo readline-devel - - fix_libmath_use_sed.patch - fedora/bc-1.06-dc_ibase.patch - fedora/bc-1.06.95-doc.patch + @@ -42,6 +38,13 @@ + + 2025-06-08 + 1.08.2 + Version bump. + Mustafa Cinasal + muscnsl@gmail.com + 2020-12-09 1.07.1