Bug#1034244: unblock (pre-approval): lua-readline/3.2-2

2023-04-12 Thread Sergei Golovan
Control: tags -1 - moreinfo

On Wed, Apr 12, 2023 at 12:04 AM Sebastian Ramacher
 wrote:
> On 2023-04-11 12:15:40 +0300, Sergei Golovan wrote:
> > Package: release.debian.org
> > Severity: normal
> > User: release.debian@packages.debian.org
> > Usertags: unblock
> > X-Debbugs-Cc: lua-readl...@packages.debian.org
> > Control: affects -1 + src:lua-readline
> >
> > I'd like to upload lua-readline with a bugfix for #1034078 (see [1]).
>
> Please go ahead and remove the moreinfo tag once the new version is
> available in unstable.

Done!

Cheers!
-- 
Sergei Golovan



Bug#1034244: unblock (pre-approval): lua-readline/3.2-2

2023-04-11 Thread Sebastian Ramacher
Control: tags -1 moreinfo confirmed

On 2023-04-11 12:15:40 +0300, Sergei Golovan wrote:
> Package: release.debian.org
> Severity: normal
> User: release.debian@packages.debian.org
> Usertags: unblock
> X-Debbugs-Cc: lua-readl...@packages.debian.org
> Control: affects -1 + src:lua-readline
> 
> I'd like to upload lua-readline with a bugfix for #1034078 (see [1]).

Please go ahead and remove the moreinfo tag once the new version is
available in unstable.

Cheers

> 
> [ Reason ]
> This upload fixes #1034078. The patch is made upstream and taken
> from newly released version 3.3.
> 
> [ Impact ]
> This bug is a regression in version 3.2 which significantly
> worsens user experience (standard Ctrl+D isn't interpreted as EOF).
> 
> [ Tests ]
> There aren't automated tests, but manual testing using upstream test
> code doesn't reveal any other regressions/bugs.
> 
> [ Risks ]
> The code change is trivial, the bug currently affects the prosody
> packhage in a way that its admin cannot simply exit from the
> prosody server management console.
> 
> [ Checklist ]
>   [+] all changes are documented in the d/changelog
>   [+] I reviewed all changes and I approve them
>   [+] attach debdiff against the package in testing
> 
> [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1034078
> 
> unblock lua-readline/3.2-2

> diff --git a/debian/changelog b/debian/changelog
> index 4456e53..7450934 100644
> --- a/debian/changelog
> +++ b/debian/changelog
> @@ -1,3 +1,10 @@
> +lua-readline (3.2-2) unstable; urgency=medium
> +
> +  * Fix regression which does not allow to use Ctrl-D (EOF) to close
> +readline session (closes: #1034078).
> +
> + -- Sergei Golovan   Sun, 09 Apr 2023 12:28:12 +0300
> +
>  lua-readline (3.2-1) unstable; urgency=medium
>  
>* New upstream release.
> diff --git a/debian/patches/eof.patch b/debian/patches/eof.patch
> new file mode 100644
> index 000..2ac8eeb
> --- /dev/null
> +++ b/debian/patches/eof.patch
> @@ -0,0 +1,39 @@
> +Author: Upstream
> +Description: Patch restores processing EOF (Ctrl+D), when readline()
> + returns NULL, distinguishable from an empty string.
> +Debian-Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1034078
> +
> +--- a/C-readline.c
>  b/C-readline.c
> +@@ -65,7 +65,13 @@
> + /* rl_cleanup_after_signal(); rl_clear_signals();  no effect :-( 1.3 */
> + /* lua_pushstring(L, line); */
> + /* 3.2 did lua_pushstring create a copy of the string ? */
> +-lua_pushfstring(L, "%s", line);   /* 3.2 */
> ++/* lua_pushfstring(L, "%s", line);   3.2 */
> ++if (line == NULL) { /* 3.3 fix by zash.se, Prosody developer */
> ++lua_pushnil(L);
> ++} else {
> ++lua_pushfstring(L, "%s", line);
> ++// lua_pushstring(L, line); should be fine as well
> ++}
> + if (tty_stream != NULL) { fclose(tty_stream); }
> + free(line);  /* 3.2 fixes memory leak */
> + return 1;
> +@@ -135,13 +141,15 @@
> + return 0;
> + }
> + 
> +-static int c_write_history(lua_State *L) {  /* filename in, returncode out 
> */
> ++/* unused ...
> ++static int c_write_history(lua_State *L) {  //  filename in, returncode out
> + size_t len;
> + const char *filename  = lua_tolstring(L, 1, );
> + lua_Integer rc = write_history(filename);
> + lua_pushinteger(L, rc);
> + return 1;
> + }
> ++*/
> + 
> + static int c_history_truncate_file(lua_State *L) { /* filename,num in rc 
> out */
> + size_t len;
> diff --git a/debian/patches/series b/debian/patches/series
> new file mode 100644
> index 000..84626e5
> --- /dev/null
> +++ b/debian/patches/series
> @@ -0,0 +1 @@
> +eof.patch


-- 
Sebastian Ramacher



Bug#1034244: unblock (pre-approval): lua-readline/3.2-2

2023-04-11 Thread Sergei Golovan
Package: release.debian.org
Severity: normal
User: release.debian@packages.debian.org
Usertags: unblock
X-Debbugs-Cc: lua-readl...@packages.debian.org
Control: affects -1 + src:lua-readline

I'd like to upload lua-readline with a bugfix for #1034078 (see [1]).

[ Reason ]
This upload fixes #1034078. The patch is made upstream and taken
from newly released version 3.3.

[ Impact ]
This bug is a regression in version 3.2 which significantly
worsens user experience (standard Ctrl+D isn't interpreted as EOF).

[ Tests ]
There aren't automated tests, but manual testing using upstream test
code doesn't reveal any other regressions/bugs.

[ Risks ]
The code change is trivial, the bug currently affects the prosody
packhage in a way that its admin cannot simply exit from the
prosody server management console.

[ Checklist ]
  [+] all changes are documented in the d/changelog
  [+] I reviewed all changes and I approve them
  [+] attach debdiff against the package in testing

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1034078

unblock lua-readline/3.2-2
diff --git a/debian/changelog b/debian/changelog
index 4456e53..7450934 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+lua-readline (3.2-2) unstable; urgency=medium
+
+  * Fix regression which does not allow to use Ctrl-D (EOF) to close
+readline session (closes: #1034078).
+
+ -- Sergei Golovan   Sun, 09 Apr 2023 12:28:12 +0300
+
 lua-readline (3.2-1) unstable; urgency=medium
 
   * New upstream release.
diff --git a/debian/patches/eof.patch b/debian/patches/eof.patch
new file mode 100644
index 000..2ac8eeb
--- /dev/null
+++ b/debian/patches/eof.patch
@@ -0,0 +1,39 @@
+Author: Upstream
+Description: Patch restores processing EOF (Ctrl+D), when readline()
+ returns NULL, distinguishable from an empty string.
+Debian-Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1034078
+
+--- a/C-readline.c
 b/C-readline.c
+@@ -65,7 +65,13 @@
+   /* rl_cleanup_after_signal(); rl_clear_signals();  no effect :-( 1.3 */
+   /* lua_pushstring(L, line); */
+   /* 3.2 did lua_pushstring create a copy of the string ? */
+-  lua_pushfstring(L, "%s", line);   /* 3.2 */
++  /* lua_pushfstring(L, "%s", line);   3.2 */
++  if (line == NULL) { /* 3.3 fix by zash.se, Prosody developer */
++  lua_pushnil(L);
++  } else {
++  lua_pushfstring(L, "%s", line);
++  // lua_pushstring(L, line); should be fine as well
++  }
+   if (tty_stream != NULL) { fclose(tty_stream); }
+   free(line);  /* 3.2 fixes memory leak */
+   return 1;
+@@ -135,13 +141,15 @@
+   return 0;
+ }
+ 
+-static int c_write_history(lua_State *L) {  /* filename in, returncode out */
++/* unused ...
++static int c_write_history(lua_State *L) {  //  filename in, returncode out
+   size_t len;
+   const char *filename  = lua_tolstring(L, 1, );
+ lua_Integer rc = write_history(filename);
+   lua_pushinteger(L, rc);
+   return 1;
+ }
++*/
+ 
+ static int c_history_truncate_file(lua_State *L) { /* filename,num in rc out 
*/
+   size_t len;
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 000..84626e5
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+eof.patch