Add upstream patch to fix nbdsh (for nbdkit tests).

This commit is contained in:
Richard W.M. Jones 2019-09-12 08:39:04 +01:00
parent 2f41901700
commit 52e6bd7cc3
2 changed files with 37 additions and 1 deletions

View File

@ -0,0 +1,30 @@
From d6cbd130101add28431bd6e67aa2ea0430a9234e Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Wed, 11 Sep 2019 22:25:57 +0100
Subject: [PATCH] nbdsh: Fix behaviour of globals.
https://stackoverflow.com/a/11754346
---
python/nbdsh.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/python/nbdsh.py b/python/nbdsh.py
index bb0db64..553e632 100644
--- a/python/nbdsh.py
+++ b/python/nbdsh.py
@@ -57,8 +57,10 @@ help (nbd) # Display documentation
if not args.command:
code.interact (banner = banner, local = locals(), exitmsg = '')
else:
+ # https://stackoverflow.com/a/11754346
+ d = dict (locals(), **globals())
for c in args.command:
if c != '-':
- exec (c)
+ exec (c, d, d)
else:
- exec (sys.stdin.read ())
+ exec (sys.stdin.read (), d, d)
--
2.23.0

View File

@ -9,7 +9,7 @@
Name: libnbd
Version: 1.1.1
Release: 1%{?dist}
Release: 2%{?dist}
Summary: NBD client library in userspace
License: LGPLv2+
@ -22,6 +22,9 @@ Source1: http://libguestfs.org/download/libnbd/%{source_directory}/%{name
# https://pgp.key-server.io/pks/lookup?search=rjones%40redhat.com&fingerprint=on&op=vindex
Source2: libguestfs.keyring
# Upstream patch to fix nbdsh.
Patch0001: 0001-nbdsh-Fix-behaviour-of-globals.patch
%if 0%{patches_touch_autotools}
BuildRequires: autoconf, automake, libtool
%endif
@ -219,6 +222,9 @@ make %{?_smp_mflags} check || {
%changelog
* Thu Sep 12 2019 Richard W.M. Jones <rjones@redhat.com> - 1.1.1-2
- Add upstream patch to fix nbdsh (for nbdkit tests).
* Sun Sep 08 2019 Richard W.M. Jones <rjones@redhat.com> - 1.1.1-1
- New development version 1.1.1.