Hello community,

here is the log from the commit of package crudini for openSUSE:Factory checked 
in at 2020-05-13 22:56:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/crudini (Old)
 and      /work/SRC/openSUSE:Factory/.crudini.new.2738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "crudini"

Wed May 13 22:56:53 2020 rev:8 rq:805362 version:0.9.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/crudini/crudini.changes  2017-08-24 
18:56:55.327206733 +0200
+++ /work/SRC/openSUSE:Factory/.crudini.new.2738/crudini.changes        
2020-05-13 22:56:54.207105144 +0200
@@ -1,0 +2,11 @@
+Wed May 13 10:57:28 UTC 2020 - Carsten Ziepke <[email protected]>
+
+- Update to 0.9.3:
+  * Python 3 support
+  * Fix regression with windows line endings
+- Run spec-cleaner
+- Add BuildArch noarch
+- Run crudini test script
+- Add manpage
+
+-------------------------------------------------------------------

Old:
----
  crudini-0.9.tar.gz

New:
----
  crudini-0.9.3.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ crudini.spec ++++++
--- /var/tmp/diff_new_pack.D7jmx0/_old  2020-05-13 22:56:54.715106135 +0200
+++ /var/tmp/diff_new_pack.D7jmx0/_new  2020-05-13 22:56:54.719106143 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package crudini
 #
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -12,39 +12,47 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
 Name:           crudini
-Version:        0.9
+Version:        0.9.3
 Release:        0
-Summary:        CRUD for .ini files
-License:        GPL-2.0
+Summary:        A utility for manipulating ini files
+License:        GPL-2.0-only
 Group:          System/Base
-Url:            https://github.com/pixelb/crudini/releases
-Source:         %{name}-%{version}.tar.gz
-BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-Requires:       python-iniparse
+URL:            https://github.com/pixelb/crudini
+Source0:        
https://github.com/pixelb/%{name}/releases/download/%{version}/%{name}-%{version}.tar.gz
+BuildRequires:  python3-devel
+BuildRequires:  python3-iniparse
+Requires:       python3-iniparse
+BuildArch:      noarch
 
 %description
-A utility for manipulating ini files.
+A utility for easily handling ini files from the command line and shell
+scripts.
 
 %prep
 %setup -q
 
+sed -i 's/env python/python3/' crudini
+
 %build
 
 %install
-install -m 0755 -D crudini %{buildroot}/%{_bindir}/crudini
-
-%post
+install -m 0755 -D %{name} %{buildroot}%{_bindir}/%{name}
+install -m 0644 -D %{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1
 
-%postun
+%check
+pushd tests
+LC_ALL=en_US.utf8 ./test.sh
+popd
 
 %files
-%defattr(-,root,root)
-%doc README COPYING
+%license COPYING
+%doc README TODO NEWS example.ini
 %{_bindir}/crudini
+%{_mandir}/man1/*
 
 %changelog

++++++ crudini-0.9.tar.gz -> crudini-0.9.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crudini-0.9/Makefile new/crudini-0.9.3/Makefile
--- old/crudini-0.9/Makefile    2016-12-13 21:15:02.000000000 +0100
+++ new/crudini-0.9.3/Makefile  2019-08-30 13:26:28.000000000 +0200
@@ -1,5 +1,5 @@
 name = crudini
-version = 0.9
+version = 0.9.3
 
 all:
        help2man -n "manipulate ini files" -o crudini.1 -N ./crudini-help
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crudini-0.9/NEWS new/crudini-0.9.3/NEWS
--- old/crudini-0.9/NEWS        2016-12-13 21:14:15.000000000 +0100
+++ new/crudini-0.9.3/NEWS      2019-08-30 13:27:03.000000000 +0200
@@ -1,5 +1,17 @@
 crudini NEWS                                    -*- outline -*-
 
+* Noteworthy changes in release 0.9.3 (2019-08-30)
+
+** Bug fixes
+
+  Reading ini files with windows line endings is again supported.
+  Regression added in v0.9.
+
+** Improvements
+
+  python 3 support.
+
+
 * Noteworthy changes in release 0.9 (2016-12-13)
 
 ** Bug fixes
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crudini-0.9/crudini new/crudini-0.9.3/crudini
--- old/crudini-0.9/crudini     2016-12-13 21:14:56.000000000 +0100
+++ new/crudini-0.9.3/crudini   2019-08-30 13:26:49.000000000 +0200
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
 # -*- coding: utf-8 -*-
 # vim:fileencoding=utf8
 #
@@ -7,10 +7,10 @@
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GPLv2, the GNU General Public License version 2, as
 # published by the Free Software Foundation. http://gnu.org/licenses/gpl.html
+from __future__ import print_function
 
 import atexit
-from cStringIO import StringIO
-import ConfigParser
+import sys
 import contextlib
 import errno
 import getopt
@@ -20,13 +20,19 @@
 import pipes
 import shutil
 import string
-import sys
 import tempfile
 
+if sys.version_info[0] >= 3:
+    from io import StringIO
+    import configparser
+else:
+    from cStringIO import StringIO
+    import ConfigParser as configparser
+
 
 def error(message=None):
     if message:
-        sys.stderr.write(message+'\n')
+        sys.stderr.write(message + '\n')
 
 
 def delete_if_exists(path):
@@ -36,7 +42,7 @@
         os.unlink(path)
     except EnvironmentError as e:
         if e.errno != errno.ENOENT:
-            print str(e)
+            print(str(e))
             raise
 
 
@@ -51,8 +57,8 @@
         line = self.fp.readline()
         # XXX: This doesn't handle ;inline comments.
         # Really should be done within inparse.
-        if (line and line[0] not in '[ \t#;\n'
-           and '=' not in line and ':' not in line):
+        if (line and line[0] not in '[ \t#;\n\r' and
+           '=' not in line and ':' not in line):
             self.crudini_no_arg = True
             line = line[:-1] + ' = crudini_no_arg\n'
         return line
@@ -213,7 +219,7 @@
         :param section: str
         """
 
-        print section
+        print(section)
 
     def name_value(self, name, value, section=None):
         """Print parameter.
@@ -225,19 +231,19 @@
 
         if value == 'crudini_no_arg':
             value = ''
-        print name or value
+        print(name or value)
 
 
 class PrintIni(Print):
     """Use for ini output format."""
 
     def section_header(self, section):
-        print "[%s]" % section
+        print("[%s]" % section)
 
     def name_value(self, name, value, section=None):
         if value == 'crudini_no_arg':
             value = ''
-        print name, '=', value.replace('\n', '\n ')
+        print(name, '=', value.replace('\n', '\n '))
 
 
 class PrintLines(Print):
@@ -256,7 +262,7 @@
             value = ''
         if value:
             line += ' = %s' % value.replace('\n', '\\n')
-        print line
+        print(line)
 
 
 class PrintSh(Print):
@@ -321,7 +327,7 @@
         except Exception:
             t, v, tb = sys.exc_info()
             delete_if_exists(path)
-            raise t, v, tb
+            raise t(v).with_traceback(tb)
 
     @staticmethod
     def file_replace(name, data):
@@ -343,7 +349,7 @@
 
         To avoid the above caveats see the --inplace option.
         """
-        (f, tmp) = tempfile.mkstemp(".tmp", prefix=name+".", dir=".")
+        (f, tmp) = tempfile.mkstemp(".tmp", prefix=name + ".", dir=".")
 
         with Crudini.remove_file_on_error(tmp):
             shutil.copystat(name, tmp)
@@ -352,7 +358,10 @@
                 st = os.stat(name)
                 os.fchown(f, st.st_uid, st.st_gid)
 
-            os.write(f, data)
+            if sys.version_info[0] >= 3:
+                os.write(f, bytearray(data, 'utf-8'))
+            else:
+                os.write(f, data)
             # We assume the existing file is persisted,
             # so sync here to ensure new data is persisted
             # before referencing it.  Otherwise the metadata could
@@ -367,7 +376,7 @@
             elif os.name == 'posix':
                 os.rename(tmp, name)  # atomic on POSIX
             else:
-                backup = tmp+'.backup'
+                backup = tmp + '.backup'
                 os.rename(name, backup)
                 os.rename(tmp, name)
                 delete_if_exists(backup)
@@ -492,7 +501,7 @@
                 'version'
             ]
             opts, args = getopt.getopt(sys.argv[1:], '', long_options)
-        except getopt.GetoptError, e:
+        except getopt.GetoptError as e:
             error(str(e))
             self.usage(1)
 
@@ -500,7 +509,7 @@
             if o in ('--help',):
                 self.usage(0)
             elif o in ('--version',):
-                print 'crudini 0.9'
+                print('crudini 0.9.3')
                 sys.exit(0)
             elif o in ('--verbose',):
                 self.verbose = True
@@ -589,7 +598,10 @@
 
     def _chksum(self, data):
         h = hashlib.sha256()
-        h.update(data)
+        if sys.version_info[0] >= 3:
+            h.update(bytearray(data, 'utf-8'))
+        else:
+            h.update(data)
         return h.digest()
 
     def _parse_file(self, filename, add_default=False, preserve_case=False):
@@ -651,14 +663,14 @@
                     )
                     self.added_default_section = True
 
-        except ConfigParser.MissingSectionHeaderError:
+        except configparser.MissingSectionHeaderError:
             conf = self._parse_file(
                 filename,
                 add_default=True,
                 preserve_case=preserve_case
             )
             self.added_default_section = True
-        except ConfigParser.ParsingError as e:
+        except configparser.ParsingError as e:
             error(str(e))
             sys.exit(1)
 
@@ -674,14 +686,14 @@
                     section == iniparse.DEFAULTSECT or
                     self.conf.has_section(section)
                 ):
-                    raise ConfigParser.NoSectionError(section)
+                    raise configparser.NoSectionError(section)
             else:
                 try:
                     curr_val = self.conf.get(section, param)
-                except ConfigParser.NoSectionError:
+                except configparser.NoSectionError:
                     if self.update == 'section':
                         raise
-                except ConfigParser.NoOptionError:
+                except configparser.NoOptionError:
                     if self.update == 'param':
                         raise
         elif (section != iniparse.DEFAULTSECT and
@@ -699,7 +711,7 @@
             if self.update not in ('param', 'section'):
                 try:
                     curr_val = self.conf.get(section, param)
-                except ConfigParser.NoOptionError:
+                except configparser.NoOptionError:
                     if self.mode == "--del":
                         return
             if value is None:
@@ -732,11 +744,11 @@
                 # XXX: Note this doesn't update an item in section
                 # if matching value also in default (global) section.
                 if defaults_to_strip.get(item[0]) != item[1]:
-                    ignore_errs = (ConfigParser.NoOptionError,)
+                    ignore_errs = (configparser.NoOptionError,)
                     if self.section is not None:
                         msection = self.section
                     elif self.update not in ('param', 'section'):
-                        ignore_errs += (ConfigParser.NoSectionError,)
+                        ignore_errs += (configparser.NoSectionError,)
                     try:
                         set_param = True
                         self.set_name_value(msection, item[0], item[1])
@@ -756,13 +768,13 @@
             else:
                 if not self.conf.remove_section(self.section) \
                    and self.update in ('param', 'section'):
-                    raise ConfigParser.NoSectionError(self.section)
+                    raise configparser.NoSectionError(self.section)
         elif self.value is None:
             try:
                 if not self.conf.remove_option(self.section, self.param) \
                    and self.update == 'param':
-                    raise ConfigParser.NoOptionError(self.section, self.param)
-            except ConfigParser.NoSectionError:
+                    raise configparser.NoOptionError(self.section, self.param)
+            except configparser.NoSectionError:
                 if self.update in ('param', 'section'):
                     raise
         else:  # remove item from list
@@ -928,35 +940,40 @@
                     def quote_val(val):
                         return pipes.quote(val).replace('\n', '\\n')
                     what = ' '.join(map(quote_val,
-                                        filter(bool,
-                                               [self.mode, self.cfgfile,
-                                                self.section, self.param,
-                                                self.value])))
+                                        list(filter(bool,
+                                                    [self.mode, self.cfgfile,
+                                                     self.section, self.param,
+                                                     self.value]))))
                     sys.stderr.write('%s: %s\n' %
                                      (('unchanged', 'changed')[changed], what))
 
             # Finish writing now to consistently handle errors here
             # (and while excepthook is set)
             sys.stdout.flush()
-        except ConfigParser.ParsingError as e:
+        except configparser.ParsingError as e:
             error('Error parsing %s: %s' % (self.cfgfile, e.message))
             sys.exit(1)
-        except ConfigParser.NoSectionError as e:
+        except configparser.NoSectionError as e:
             error('Section not found: %s' % e.section)
             sys.exit(1)
-        except ConfigParser.NoOptionError:
+        except configparser.NoOptionError:
             error('Parameter not found: %s' % self.param)
             sys.exit(1)
         except EnvironmentError as e:
-            # Handle EPIPE as python doesn't catch SIGPIPE
+            # Handle EPIPE as python 2 doesn't catch SIGPIPE
             if e.errno != errno.EPIPE:
                 error(str(e))
                 sys.exit(1)
+            # Python3 fix for exception on exit:
+            # https://docs.python.org/3/library/signal.html#note-on-sigpipe
+            nullf = os.open(os.devnull, os.O_WRONLY)
+            os.dup2(nullf, sys.stdout.fileno())
 
 
 def main():
     crudini = Crudini()
     return crudini.run()
 
+
 if __name__ == "__main__":
     sys.exit(main())
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crudini-0.9/crudini.1 new/crudini-0.9.3/crudini.1
--- old/crudini-0.9/crudini.1   2016-12-13 21:15:26.000000000 +0100
+++ new/crudini-0.9.3/crudini.1 2019-08-30 13:33:19.000000000 +0200
@@ -1,5 +1,5 @@
-.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.2.
-.TH CRUDINI "1" "December 2016" "crudini 0.9" "User Commands"
+.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.4.
+.TH CRUDINI "1" "August 2019" "crudini 0.9.3" "User Commands"
 .SH NAME
 crudini \- manipulate ini files
 .SH SYNOPSIS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crudini-0.9/setup.py new/crudini-0.9.3/setup.py
--- old/crudini-0.9/setup.py    2016-12-13 21:14:47.000000000 +0100
+++ new/crudini-0.9.3/setup.py  2019-08-30 13:26:35.000000000 +0200
@@ -7,9 +7,10 @@
 def read(fname):
     return open(os.path.join(os.path.dirname(__file__), fname)).read()
 
+
 setup(
     name="crudini",
-    version="0.9",
+    version="0.9.3",
     author="Pádraig Brady",
     author_email="[email protected]",
     description=("A utility for manipulating ini files"),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/crudini-0.9/tests/test.sh 
new/crudini-0.9.3/tests/test.sh
--- old/crudini-0.9/tests/test.sh       2016-12-13 14:21:22.000000000 +0100
+++ new/crudini-0.9.3/tests/test.sh     2019-01-01 16:06:31.000000000 +0100
@@ -499,3 +499,7 @@
 done
 crudini --set noequals.ini noequals new_equals '' || fail
 diff -u noequals.ini noequals_new.ini && ok || fail
+
+# Test can read windows format files
+printf '%s\r\n' '' 'param = value' > test.ini
+crudini --get test.ini DEFAULT param > /dev/null || fail


Reply via email to