diff --git a/.crudini.metadata b/.crudini.metadata new file mode 100644 index 0000000..446906f --- /dev/null +++ b/.crudini.metadata @@ -0,0 +1 @@ +f0ffa3bb154eec5ec82639de5464cb53a07ecb2e SOURCES/crudini-0.9.5.tar.gz diff --git a/SOURCES/crudini-el6.patch b/SOURCES/crudini-el6.patch new file mode 100644 index 0000000..2626025 --- /dev/null +++ b/SOURCES/crudini-el6.patch @@ -0,0 +1,32 @@ +diff --git a/crudini.py b/crudini.py +index e931143..1699adc 100755 +--- a/crudini.py ++++ b/crudini.py +@@ -197,9 +197,6 @@ class LockedFile(FileLock): + class CrudiniConfigParser(iniparse.RawConfigParser): + def __init__(self, preserve_case=False): + iniparse.RawConfigParser.__init__(self) +- # Without the following we can't have params starting with "rem"! +- # We ignore lines starting with '%' which mercurial uses to include +- iniparse.change_comment_syntax('%;#', allow_rem=False) + if preserve_case: + self.optionxform = str + +diff --git a/tests/test.sh b/tests/test.sh +index 90cc9a8..d629141 100755 +--- a/tests/test.sh ++++ b/tests/test.sh +@@ -217,13 +217,6 @@ printf '%s\n' '#comment' '[section1]' > test.ini + test "$(crudini --get test.ini)" = 'section1' || fail + ok + +-# Ensure we handle comments correctly +-printf '%s\n' '[DEFAULT]' '#c1' ';c2' '%inc1' > test.ini +-test "$(crudini --get test.ini)" = '' || fail +-printf '%s\n' '[section1]' 'remote=1' > test.ini +-test "$(crudini --get test.ini 'section1')" = 'remote' || fail +-ok +- + # missing bits + :> test.ini + crudini --get missing.ini 2>/dev/null && fail diff --git a/SOURCES/crudini-py2.patch b/SOURCES/crudini-py2.patch new file mode 100644 index 0000000..0d9159b --- /dev/null +++ b/SOURCES/crudini-py2.patch @@ -0,0 +1,9 @@ +diff -Naur crudini-0.9.3/crudini.py crudini-0.9.3.new/crudini.py +--- crudini-0.9.3/crudini.py 2016-12-13 20:14:56.000000000 +0000 ++++ crudini-0.9.3.new/crudini.py 2019-02-20 08:16:34.470569740 +0000 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python2 + # -*- coding: utf-8 -*- + # vim:fileencoding=utf8 + # diff --git a/SOURCES/crudini-py3.patch b/SOURCES/crudini-py3.patch new file mode 100644 index 0000000..3f94387 --- /dev/null +++ b/SOURCES/crudini-py3.patch @@ -0,0 +1,9 @@ +diff -Naur crudini-0.9.3/crudini.py crudini-0.9.3.new/crudini.py +--- crudini-0.9.3/crudini.py 2016-12-13 20:14:56.000000000 +0000 ++++ crudini-0.9.3.new/crudini.py 2019-02-20 08:16:34.470569740 +0000 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/python3 + # -*- coding: utf-8 -*- + # vim:fileencoding=utf8 + # diff --git a/SPECS/crudini.spec b/SPECS/crudini.spec new file mode 100644 index 0000000..baa5981 --- /dev/null +++ b/SPECS/crudini.spec @@ -0,0 +1,170 @@ +Name: crudini +Version: 0.9.5 +Release: 4%{?dist} +Summary: A utility for manipulating ini files + +License: GPLv2 +URL: https://github.com/pixelb/%{name} +Source0: https://github.com/pixelb/%{name}/releases/download/%{version}/%{name}-%{version}.tar.gz + +BuildArch: noarch +BuildRequires: diffutils +BuildRequires: grep +%if 0%{?rhel} == 6 || 0%{?rhel} == 7 +BuildRequires: python2-devel +BuildRequires: python-iniparse +Requires: python-iniparse +%else +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-iniparse >= 0.3.2 +Requires: python3-iniparse >= 0.3.2 +%endif + +Patch0: crudini-el6.patch +Patch1: crudini-py2.patch +Patch2: crudini-py3.patch + +%description +A utility for easily handling ini files from the command line and shell +scripts. + +%prep +%setup -q +%if 0%{?rhel} == 6 +%patch -P0 -p1 +%endif +%if 0%{?rhel} == 6 || 0%{?rhel} == 7 +%patch -P1 -p1 +%else +%patch -P2 -p1 +%endif + +%build + +%install +install -p -D -m 0755 %{name}.py %{buildroot}%{_bindir}/%{name} +install -p -D -m 0644 %{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1 + +%check +pushd tests +LC_ALL=en_US.utf8 ./test.sh +popd + +%files +%doc README.md COPYING TODO NEWS example.ini +%{_bindir}/%{name} +%{_mandir}/man1/* + + +%changelog +* Wed Jul 17 2024 Fedora Release Engineering - 0.9.5-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Wed Jan 24 2024 Fedora Release Engineering - 0.9.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Fri Jan 19 2024 Fedora Release Engineering - 0.9.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Wed Oct 04 2023 Pádraig Brady - 0.9.5-1 +- Latest upstream + +* Wed Jul 19 2023 Fedora Release Engineering - 0.9.4-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Thu Jan 19 2023 Fedora Release Engineering - 0.9.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Fri Dec 23 2022 Pádraig Brady - 0.9.4-1 +- Latest upstream + +* Thu Aug 11 2022 Pádraig Brady - 0.9.3-8 +- Fix FTBFS on rawhide by avoiding pipes module warning + +* Wed Jul 20 2022 Fedora Release Engineering - 0.9.3-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Thu Jan 20 2022 Fedora Release Engineering - 0.9.3-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Wed Jul 21 2021 Fedora Release Engineering - 0.9.3-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Tue Jan 26 2021 Fedora Release Engineering - 0.9.3-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Mon Jul 27 2020 Fedora Release Engineering - 0.9.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue Jan 28 2020 Fedora Release Engineering - 0.9.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Fri Aug 30 2019 Pádraig Brady - 0.9.3-1 +- Latest upstream: python 3 support + +* Wed Jul 24 2019 Fedora Release Engineering - 0.9-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Wed Jun 26 2019 Pádraig Brady - 0.9-7 +- Add missing test dependencies + +* Thu Jan 31 2019 Fedora Release Engineering - 0.9-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Thu Jul 12 2018 Fedora Release Engineering - 0.9-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Mon Mar 26 2018 Iryna Shcherbina - 0.9-4 +- Update Python 2 dependency declarations to new packaging standards + (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) + +* Wed Feb 07 2018 Fedora Release Engineering - 0.9-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 0.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Fri Mar 03 2017 Pádraig Brady - 0.9-1 +- Latest upstream + +* Fri Feb 10 2017 Fedora Release Engineering - 0.8-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Wed Nov 23 2016 Pádraig Brady - 0.8-1 +- Latest upstream + +* Wed Feb 03 2016 Fedora Release Engineering - 0.7-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jun 17 2015 Fedora Release Engineering - 0.7-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sun Jun 14 2015 Pádraig Brady - 0.7-1 +- Latest upstream +- Fixes race condition avoiding stale lock files and blocked edits + +* Wed Jan 28 2015 Pádraig Brady - 0.5-1 +- Latest upstream +- Fixes race condition causing stale lock files and blocked edits + +* Mon Sep 08 2014 Pádraig Brady - 0.4-1 +- Latest upstream + +* Sat Jun 07 2014 Fedora Release Engineering - 0.3-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Sat Aug 03 2013 Fedora Release Engineering - 0.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Fri Mar 08 2013 Jakub Ruzicka - 0.3-2 +- Added BuildRequires python-iniparse. + +* Fri Mar 08 2013 Jakub Ruzicka - 0.3-1 +- New version 0.3 includes COPYING licence file. +- Improved description. +- Added python-iniparse dependency. +- Added tests check. + +* Thu Mar 07 2013 Jakub Ruzicka - 0.1-1 +- Initial package release