Compare commits

...

No commits in common. "c8" and "c10s" have entirely different histories.
c8 ... c10s

9 changed files with 138 additions and 22 deletions

View File

@ -1 +0,0 @@
b4475c6d66590a5911d30f9747361db47231640a SOURCES/bc-1.07.1.tar.gz

4
.gitignore vendored
View File

@ -1 +1,3 @@
SOURCES/bc-1.07.1.tar.gz
bc-1.06.95.tar.bz2
/bc-1.07.tar.gz
/bc-1.07.1.tar.gz

View File

@ -0,0 +1,14 @@
diff -Naur bc-1.07.1/bc/scan.l bc-1.07.1-new/bc/scan.l
--- bc-1.07.1/bc/scan.l 2017-04-07 22:20:02.000000000 +0000
+++ bc-1.07.1-new/bc/scan.l 2021-08-14 12:12:33.860991777 +0000
@@ -170,6 +170,10 @@
if (rl_len != 1)
add_history (rl_line);
rl_line[rl_len-1] = '\n';
+ /* readline doesn't echo empty lines without a prompt,
+ so do so here. */
+ if (rl_len == 1)
+ putchar ('\n');
fflush (stdout);
}

View File

@ -1,15 +1,16 @@
Summary: GNU's bc (a numeric processing language) and dc (a calculator)
Name: bc
Version: 1.07.1
Release: 5%{?dist}
License: GPLv2+
Release: 23%{?dist}
License: GPL-3.0-or-later
URL: http://www.gnu.org/software/bc/
Source: http://ftp.gnu.org/gnu/bc/bc-%{version}.tar.gz
Patch1: bc-1.06-dc_ibase.patch
Patch2: bc-1.06.95-doc.patch
Requires(post): /sbin/install-info
Requires(preun): /sbin/install-info
Patch3: bc-1.07.1-readline-echo-empty.diff
BuildRequires: gcc
BuildRequires: readline-devel, flex, bison, texinfo, ed
BuildRequires: make
%description
The bc package includes bc and dc. Bc is an arbitrary precision
@ -31,22 +32,6 @@ if you would like to use its text mode calculator.
%make_install
rm -f $RPM_BUILD_ROOT/%{_infodir}/dir
%post
if [ -e %{_infodir}/bc.info.gz -a -e %{_infodir}/dc.info.gz ]; then
/sbin/install-info %{_infodir}/bc.info.gz %{_infodir}/dir \
--entry="* bc: (bc). The GNU calculator language." || :
/sbin/install-info %{_infodir}/dc.info.gz %{_infodir}/dir \
--entry="* dc: (dc). The GNU RPN calculator." || :
fi
%preun
if [ $1 = 0 -a -e %{_infodir}/bc.info.gz -a -e %{_infodir}/dc.info.gz ]; then
/sbin/install-info --delete %{_infodir}/bc.info.gz %{_infodir}/dir \
--entry="* bc: (bc). The GNU calculator language." || :
/sbin/install-info --delete %{_infodir}/dc.info.gz %{_infodir}/dir \
--entry="* dc: (dc). The GNU RPN calculator." || :
fi
%files
%license COPYING COPYING.LIB
%doc FAQ AUTHORS NEWS README Examples/
@ -56,6 +41,61 @@ fi
%{_infodir}/*
%changelog
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 1.07.1-23
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 1.07.1-22
- Bump release for June 2024 mass rebuild
* Tue Jan 23 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.07.1-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Jan 19 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.07.1-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.07.1-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Sun Jun 25 2023 Sérgio Basto <sergio@serjux.com> - 1.07.1-18
- Migrate to SPDX license format
* Wed Jan 18 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.07.1-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Wed Jul 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.07.1-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Wed Jan 19 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.07.1-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Sat Aug 14 2021 Pádraig Brady <P@draigBrady.com> - 1.07.1-14
- Echo empty lines, useful for delimiting work
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.07.1-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.07.1-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.07.1-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.07.1-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.07.1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.07.1-8
- Rebuild for readline 8.0
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.07.1-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.07.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.07.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (bc-1.07.1.tar.gz) = 02126d0db6b6ed06d56cfc292d6f5475ff1e574779d7e69c7809bbb1e13f946f57ea07da2a7666baa092507a951a822044b0970075f75eefe65a5c1999b75d34

45
tests/sanity/runtests.py Normal file
View File

@ -0,0 +1,45 @@
import unittest
import os
import subprocess
def call_command(command_to_call):
result = subprocess.check_output(command_to_call, shell=True)
return result[:-1].decode("utf-8")
class TestBC(unittest.TestCase):
def test_divide(self):
result = call_command("echo '6.5 / 2.7' | bc")
self.assertEqual( result, '2')
def test_sum(self):
result = call_command("echo '2 + 5' | bc")
self.assertEqual( result, '7')
def test_difference(self):
result = call_command("echo '10 - 4' | bc")
self.assertEqual( result, '6')
def test_multiplying(self):
result = call_command("echo '3 * 8' | bc")
self.assertEqual( result, '24')
def test_scale(self):
result = call_command("echo 'scale = 2; 2 / 3' | bc")
self.assertEqual( result, '.66')
def test_remainder(self):
result = call_command("echo '6 % 4' | bc")
self.assertEqual( result, '2')
def test_exponent(self):
result = call_command("echo '10^2' | bc")
self.assertEqual( result, '100')
if __name__ == '__main__':
unittest.main()

15
tests/tests.yml Normal file
View File

@ -0,0 +1,15 @@
---
# This first play always runs on the local staging system
- hosts: localhost
roles:
- role: standard-test-basic
tags:
- classic
- container
- atomic
tests:
- sanity.test:
dir: sanity
run: python3 runtests.py -v
required_packages:
- bc # Required to run initscript