Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-patatt for openSUSE:Factory 
checked in at 2022-05-28 22:15:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-patatt (Old)
 and      /work/SRC/openSUSE:Factory/.python-patatt.new.2254 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-patatt"

Sat May 28 22:15:05 2022 rev:4 rq:979514 version:0.4.9

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-patatt/python-patatt.changes      
2021-06-11 00:19:18.769383542 +0200
+++ /work/SRC/openSUSE:Factory/.python-patatt.new.2254/python-patatt.changes    
2022-05-28 22:15:10.460821956 +0200
@@ -1,0 +2,9 @@
+Fri May 27 12:41:34 UTC 2022 - Jiri Slaby <jsl...@suse.cz>
+
+- update to 0.4.9
+ * install-hook: make sure the hooks path exists
+ * Always prefer files passed as params
+ * Use a symlink to make the new key default
+ * Add patatt install-hook subcommand
+
+-------------------------------------------------------------------

Old:
----
  patatt-0.4.6.tar.asc
  patatt-0.4.6.tar.gz

New:
----
  patatt-0.4.9.tar.asc
  patatt-0.4.9.tar.gz

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

Other differences:
------------------
++++++ python-patatt.spec ++++++
--- /var/tmp/diff_new_pack.wquL8g/_old  2022-05-28 22:15:10.916822867 +0200
+++ /var/tmp/diff_new_pack.wquL8g/_new  2022-05-28 22:15:10.920822876 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package python-patatt
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
 %define skip_python2 1
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-patatt
-Version:        0.4.6
+Version:        0.4.9
 Release:        0
 Summary:        Cryptographic patch attestation for the masses
 License:        MIT-0
@@ -34,7 +34,7 @@
 BuildRequires:  git-core
 # /SECTION
 Requires(post):   update-alternatives
-Requires(postun): update-alternatives
+Requires(postun):update-alternatives
 %python_subpackages
 
 %description

++++++ patatt-0.4.6.tar.gz -> patatt-0.4.9.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/patatt-0.4.6/README.rst new/patatt-0.4.9/README.rst
--- old/patatt-0.4.6/README.rst 2021-06-09 21:00:01.000000000 +0200
+++ new/patatt-0.4.9/README.rst 2021-10-04 22:29:13.000000000 +0200
@@ -182,7 +182,12 @@
 Automatic signing via the sendemail-validate hook
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 If everything is working well, you can start automatically signing all
-outgoing patches sent via git-send-email::
+outgoing patches sent via git-send-email. Inside the repo you want enabled
+for signing, run::
+
+    $ patatt install-hook
+
+Or you can do it manually::
 
     $ echo 'patatt sign --hook "${1}"' > "$(git rev-parse 
--git-dir)/hooks/sendemail-validate"
     $ chmod a+x "$(git rev-parse --git-dir)/hooks/sendemail-validate"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/patatt-0.4.6/man/patatt.5 
new/patatt-0.4.9/man/patatt.5
--- old/patatt-0.4.6/man/patatt.5       2021-06-09 21:00:01.000000000 +0200
+++ new/patatt-0.4.9/man/patatt.5       2021-10-04 22:29:13.000000000 +0200
@@ -1,6 +1,6 @@
 .\" Man page generated from reStructuredText.
 .
-.TH PATATT 5 "2021-05-21" "0.4.0" ""
+.TH PATATT 5 "2021-10-04" "0.4.9" ""
 .SH NAME
 PATATT \- DKIM-like cryptographic patch attestation
 .
@@ -32,7 +32,7 @@
 ..
 .SH SYNOPSIS
 .sp
-patatt {sign,validate,genkey} [options]
+patatt {sign,validate,genkey,install\-hook} [options]
 .SH DESCRIPTION
 .sp
 This tools allows cryptographically signing patches sent via email
@@ -75,7 +75,20 @@
 .SH USING AS A GIT HOOK
 .sp
 If you use \fBgit\-send\-email\fP for sending patches, then you can get
-them automatically signed via the \fBsendemail\-validate\fP hook:
+them automatically signed via the \fBsendemail\-validate\fP hook. To install,
+run the following command in the repository you want enabled for signing:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+$ patatt install\-hook
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+Or you can install it manually:
 .INDENT 0.0
 .INDENT 3.5
 .sp
@@ -95,6 +108,8 @@
 \fIpatatt validate\fP: basic validation for signed messages
 .IP \(bu 2
 \fIpatatt genkey\fP: generate a new ed25519 keypair
+.IP \(bu 2
+\fIpatatt install\-hook\fP: install sendemail\-validate hook in the current 
repository
 .UNINDENT
 .sp
 You can run \fBpatatt [subcommand] \-\-help\fP to see a summary of flags for
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/patatt-0.4.6/man/patatt.5.rst 
new/patatt-0.4.9/man/patatt.5.rst
--- old/patatt-0.4.6/man/patatt.5.rst   2021-06-09 21:00:01.000000000 +0200
+++ new/patatt-0.4.9/man/patatt.5.rst   2021-10-04 22:29:13.000000000 +0200
@@ -5,15 +5,15 @@
 -----------------------------------------
 
 :Author:    mri...@kernel.org
-:Date:      2021-05-21
+:Date:      2021-10-04
 :Copyright: The Linux Foundation and contributors
 :License:   MIT-0
-:Version:   0.4.0
+:Version:   0.4.9
 :Manual section: 5
 
 SYNOPSIS
 --------
-patatt {sign,validate,genkey} [options]
+patatt {sign,validate,genkey,install-hook} [options]
 
 DESCRIPTION
 -----------
@@ -42,7 +42,12 @@
 USING AS A GIT HOOK
 -------------------
 If you use ``git-send-email`` for sending patches, then you can get
-them automatically signed via the ``sendemail-validate`` hook::
+them automatically signed via the ``sendemail-validate`` hook. To install,
+run the following command in the repository you want enabled for signing::
+
+    $ patatt install-hook
+
+Or you can install it manually::
 
     $ echo 'patatt sign --hook "${1}"' >> .git/hooks/sendemail-validate
     $ chmod a+x .git/hooks/sendemail-validate
@@ -52,6 +57,7 @@
 * *patatt sign*: sign stdin or RFC2822 files passed as arguments
 * *patatt validate*: basic validation for signed messages
 * *patatt genkey*: generate a new ed25519 keypair
+* *patatt install-hook*: install sendemail-validate hook in the current 
repository
 
 You can run ``patatt [subcommand] --help`` to see a summary of flags for
 each subcommand.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/patatt-0.4.6/patatt/__init__.py 
new/patatt-0.4.9/patatt/__init__.py
--- old/patatt-0.4.6/patatt/__init__.py 2021-06-09 21:00:01.000000000 +0200
+++ new/patatt-0.4.9/patatt/__init__.py 2021-10-04 22:29:13.000000000 +0200
@@ -47,7 +47,7 @@
 KEYCACHE = dict()
 
 # My version
-__VERSION__ = '0.4.6'
+__VERSION__ = '0.4.9'
 MAX_SUPPORTED_FORMAT_VERSION = 1
 
 
@@ -811,14 +811,14 @@
 
 def _load_messages(cmdargs) -> dict:
     import sys
-    if not sys.stdin.isatty():
-        messages = {'-': sys.stdin.buffer.read()}
-    elif len(cmdargs.msgfile):
+    if len(cmdargs.msgfile):
         # Load all message from the files passed to make sure they all parse 
correctly
         messages = dict()
         for msgfile in cmdargs.msgfile:
             with open(msgfile, 'rb') as fh:
                 messages[msgfile] = fh.read()
+    elif not sys.stdin.isatty():
+        messages = {'-': sys.stdin.buffer.read()}
     else:
         logger.critical('E: Pipe a message to sign or pass filenames with 
individual messages')
         raise RuntimeError('Nothing to do')
@@ -1089,17 +1089,15 @@
         logger.critical('Wrote: %s', pkey)
 
     # Also copy it into our local keyring
+    spkey = os.path.join(pdir, make_pkey_path('ed25519', 
config.get('identity'), identifier))
+    Path(os.path.dirname(spkey)).mkdir(parents=True, exist_ok=True)
+    with open(spkey, 'wb') as fh:
+        fh.write(base64.b64encode(newkey.verify_key.encode()))
+        logger.critical('Wrote: %s', spkey)
     dpkey = os.path.join(pdir, make_pkey_path('ed25519', 
config.get('identity'), 'default'))
-    Path(os.path.dirname(dpkey)).mkdir(parents=True, exist_ok=True)
     if not os.path.exists(dpkey):
-        with open(dpkey, 'wb') as fh:
-            fh.write(base64.b64encode(newkey.verify_key.encode()))
-            logger.critical('Wrote: %s', dpkey)
-    else:
-        spkey = os.path.join(pdir, make_pkey_path('ed25519', 
config.get('identity'), identifier))
-        with open(spkey, 'wb') as fh:
-            fh.write(base64.b64encode(newkey.verify_key.encode()))
-            logger.critical('Wrote: %s', spkey)
+        # symlink our new key to be the default
+        os.symlink(identifier, dpkey)
 
     logger.critical('Add the following to your .git/config (or global 
~/.gitconfig):')
     logger.critical('---')
@@ -1115,6 +1113,24 @@
     logger.critical(pkey)
 
 
+def cmd_install_hook(cmdargs, config: dict):  # noqa
+    gitrepo = get_git_toplevel()
+    if not gitrepo:
+        logger.critical('Not in a git tree, cannot install hook')
+        sys.exit(1)
+    hookfile = os.path.join(gitrepo, '.git', 'hooks', 'sendemail-validate')
+    if os.path.exists(hookfile):
+        logger.critical('Hook already exists: %s', hookfile)
+        sys.exit(1)
+    Path(os.path.join(gitrepo, '.git', 'hooks')).mkdir(parents=True, 
exist_ok=True)
+    with open(hookfile, 'w') as fh:
+        fh.write('#!/bin/sh\n')
+        fh.write('# installed by patatt install-hook\n')
+        fh.write('patatt sign --hook "${1}"\n')
+        os.chmod(hookfile, 0o755)
+    logger.critical('Hook installed as %s', hookfile)
+
+
 def command() -> None:
     import argparse
     # noinspection PyTypeChecker
@@ -1150,6 +1166,9 @@
                         help='Overwrite any existing keys, if found')
     sp_gen.set_defaults(func=cmd_genkey)
 
+    sp_install = subparsers.add_parser('install-hook', help='Install 
sendmail-validate hook into the current repo')
+    sp_install.set_defaults(func=cmd_install_hook)
+
     _args = parser.parse_args()
 
     logger.setLevel(logging.DEBUG)

Reply via email to