control: tags -1 patch

Hi,

I was using patched version but forgot to send patch to BTS.

This is updated one with confirmation dialog for q command.

This also update debian/rules to a sane one.

I am sending this as a series of patches so you can pick what you like.

Regards,

Osamu

>From 8d5754f3847bfe4fb597d75aa9ec7e785df51264 Mon Sep 17 00:00:00 2001
From: Osamu Aoki <os...@debian.org>
Date: Mon, 10 Apr 2017 22:40:56 +0900
Subject: [PATCH 1/4] Add safty gurd for the 'q' command

---
 .../0001-Safety-guards-for-the-q-command.patch     | 490 +++++++++++++++++++++
 debian/patches/series                              |   1 +
 2 files changed, 491 insertions(+)
 create mode 100644 debian/patches/0001-Safety-guards-for-the-q-command.patch
 create mode 100644 debian/patches/series

diff --git a/debian/patches/0001-Safety-guards-for-the-q-command.patch b/debian/patches/0001-Safety-guards-for-the-q-command.patch
new file mode 100644
index 0000000..0415507
--- /dev/null
+++ b/debian/patches/0001-Safety-guards-for-the-q-command.patch
@@ -0,0 +1,490 @@
+From: Osamu Aoki <os...@debian.org>
+Date: Mon, 10 Apr 2017 22:14:14 +0900
+Subject: Safety guards for the 'q' command
+
+Provide safe alternative key to the 'a' command
+Prompt for the 'q' command before really quitting
+---
+ imediff2             |  66 +++++++++----
+ imediff2-docbook.xml |  14 ++-
+ imediff2.1           | 255 ++++++++++++++++++++++++++++++---------------------
+ 3 files changed, 208 insertions(+), 127 deletions(-)
+
+diff --git a/imediff2 b/imediff2
+index 8e9d5d6..34c8ed1 100755
+--- a/imediff2
++++ b/imediff2
+@@ -78,31 +78,36 @@ def helptext():
+   global allow_unresolved, editor, colors
+   txt = _("""  KEYBOARD COMMANDS
+ 
+-  arrows          move in document
+-  page up/down    move a screenful
+-  enter           toggle selected change
+-  n, tab, space   jump to next change
+-  p, backspace    jump to previous change
++  arrows            move in document
++  page up/down      move a screenful
++  enter             toggle selected change
++  n, tab, space     jump to next change
++  p, backspace      jump to previous change
+ 
+-  a               set current chunk to version A
+-  b               set current chunk to version B
+-  shift-a         set all changes to version A
+-  shitf-b         set all changes to version B
++  a (v)             set current chunk to version A
++  b                 set current chunk to version B
++  shift-a (shift-v) set all changes to version A
++  shitf-b           set all changes to version B
+ 
+-  u               set current chunk to unresolved
+-  shift-u         set all changes to unresolved""")
++  u                 set current chunk to unresolved
++  shift-u           set all changes to unresolved""")
+ 
+   if not editor is None:
+-    txt += "\n\n" + _("  e               launch external editor")
++    txt += "\n\n" + _("  e                 launch external editor")
+ 
+   if last_old_chunks is not None:
+-    txt += "\n" + _("  r               discard editor-made changes")
++    txt += "\n" + _("  r                 discard editor-made changes")
+ 
+   txt += _("""
+-  x, s            save and exit
+-  q, ^C           exit without saving
+-  home/end        jump to start/end
+-  h, ?            show this help
++  x, s              save and exit
++  q, ^C             exit without saving
++
++  In order to avoid accidentally hitting the q-key when you intend to
++  use the a-key, the v-key next to the b-key is chosen as a safe 
++  alternative keyboard command for the a-key.
++
++  home/end          jump to start/end
++  h, ?              show this help
+ 
+   '?' on bright background is a place holder for
+   an empty string so you can select them. It is only a
+@@ -118,6 +123,10 @@ def helptext():
+   #Press any key to continue""")
+   return txt
+ 
++def quittext():
++  txt = _("""  Do you really wish to quit? (Press 'y' to quit)""")
++  return txt
++
+ def read_lines( filename ):
+   global assume_empty
+   try:
+@@ -390,6 +399,10 @@ def main(stdscr, lines_a, lines_b, start_mode):
+       chunks[active_chunks[sel][2]][0] = 'a'
+       build_contents()
+       redraw_sel = True
++    elif (sel > -1) and (c == ord('v')):
++      chunks[active_chunks[sel][2]][0] = 'a'
++      build_contents()
++      redraw_sel = True
+     elif (sel > -1) and (c == ord('b')):
+       chunks[active_chunks[sel][2]][0] = 'b'
+       build_contents()
+@@ -405,6 +418,10 @@ def main(stdscr, lines_a, lines_b, start_mode):
+       change_all_chunks( 'a' );
+       build_contents()
+       redraw_sel = True
++    elif (c == ord('V')):
++      change_all_chunks( 'a' );
++      build_contents()
++      redraw_sel = True
+     elif (c == ord('B')):
+       change_all_chunks( 'b' );
+       build_contents()
+@@ -454,7 +471,20 @@ def main(stdscr, lines_a, lines_b, start_mode):
+ 
+     # Exit without saving (same as ^C)
+     elif c == ord('q') or c == curses.KEY_CANCEL:
+-      raise KeyboardInterrupt
++      quitw = 0
++      quith = 0
++      for l in string.split(quittext(), "%c"%10):
++        quitw = max(quitw, len(l))
++        quith += 1
++      quitpad = curses.newpad(quith+2, quitw+2)
++      quitpad.addstr(1,0,quittext())
++      quitpad.border()
++      quitpad.refresh( 0,0, 0,0, min(quith+1,winh-1),min(quitw+1,winw-1) )
++      stdscr.refresh()
++      curses.curs_set(0)
++      c = stdscr.getch()
++      if c == ord('y'):
++        raise KeyboardInterrupt
+ 
+     # Save and exit
+     elif c == ord('x') or c == ord('s') or \
+diff --git a/imediff2-docbook.xml b/imediff2-docbook.xml
+index 4f0eb14..c5577fa 100644
+--- a/imediff2-docbook.xml
++++ b/imediff2-docbook.xml
+@@ -200,7 +200,7 @@
+       </varlistentry>
+ 
+       <varlistentry>
+-        <term><keysym>a</keysym></term>
++        <term><keysym>a</keysym>, <keysym>v</keysym></term>
+         <listitem>
+           <para>Set current chunk to version A.</para>
+         </listitem>
+@@ -223,7 +223,8 @@
+ 
+ 
+       <varlistentry>
+-        <term><keycombo action='simul'><keycap>shift</keycap><keysym>a</keysym></keycombo></term>
++        <term><keycombo action='simul'><keycap>shift</keycap><keysym>a</keysym></keycombo>,
++        <keycombo action='simul'><keycap>shift</keycap><keysym>v</keysym></keycombo></term>
+         <listitem>
+           <para>Set all changes to version A.</para>
+         </listitem>
+@@ -285,6 +286,15 @@
+   </refsect1>
+ 
+   <refsect1>
++    <title>NOTE</title>
++
++    <para>In order to avoid accidentally hitting the q-key when you intend to
++      use the a-key, the v-key next to the b-key is chosen as a safe alternative
++      keyboard command for the a-key.
++    </para>
++
++  </refsect1>
++  <refsect1>
+     <title>SEE ALSO</title>
+ 
+     <para>sdiff (1), diff (1), merge (1), diff3 (1).</para>
+diff --git a/imediff2.1 b/imediff2.1
+index 00c95fe..a2766be 100644
+--- a/imediff2.1
++++ b/imediff2.1
+@@ -1,173 +1,214 @@
+-.\"Generated by db2man.xsl. Don't modify this, modify the source.
+-.de Sh \" Subsection
+-.br
+-.if t .Sp
+-.ne 5
+-.PP
+-\fB\\$1\fR
+-.PP
+-..
+-.de Sp \" Vertical space (when we can't use .PP)
+-.if t .sp .5v
+-.if n .sp
+-..
+-.de Ip \" List item
+-.br
+-.ie \\n(.$>=3 .ne \\$3
+-.el .ne 3
+-.IP "\\$1" \\$2
+-..
+-.TH "IMEDIFF2" 1 "2006-03-10" "" ""
+-.SH NAME
+-imediff2 \- An interactive fullscreen 2-way merge tool
+-.SH "SYNOPSIS"
++'\" t
++.\"     Title: imediff2
++.\"    Author: Jarno Elonen
++.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
++.\"      Date: 2006-03-10
++.\"    Manual: imediff2
++.\"    Source: imediff2
++.\"  Language: English
++.\"
++.TH "IMEDIFF2" "1" "2006\-03\-10" "imediff2" "imediff2"
++.\" -----------------------------------------------------------------
++.\" * Define some portability stuff
++.\" -----------------------------------------------------------------
++.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
++.\" http://bugs.debian.org/507673
++.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
++.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
++.ie \n(.g .ds Aq \(aq
++.el       .ds Aq '
++.\" -----------------------------------------------------------------
++.\" * set default formatting
++.\" -----------------------------------------------------------------
++.\" disable hyphenation
++.nh
++.\" disable justification (adjust text to left margin only)
+ .ad l
+-.hy 0
+-.HP 9
+-\fBimediff2\fR [\fB\-m\fR] [\fB\-u\fR] [\fB\-a\fR] [\fB\-b\fR] [\fB\-c\fR] [\fB\-N\ \fInew\-file\fR\fR] [\fB\-o\ \fIoutputfile\fR\fR] {\fIfile1\fR} {\fIfile2\fR}
+-.ad
+-.hy
+-
++.\" -----------------------------------------------------------------
++.\" * MAIN CONTENT STARTS HERE *
++.\" -----------------------------------------------------------------
++.SH "NAME"
++imediff2 \- An interactive fullscreen 2\-way merge tool
++.SH "SYNOPSIS"
++.HP \w'\fBimediff2\fR\ 'u
++\fBimediff2\fR [\fB\-m\fR] [\fB\-u\fR] [\fB\-a\fR] [\fB\-b\fR] [\fB\-c\fR] [\fB\-N\ \fR\fB\fInew\-file\fR\fR] [\fB\-o\ \fR\fB\fIoutputfile\fR\fR] {\fIfile1\fR} {\fIfile2\fR}
+ .SH "DESCRIPTION"
+-
+ .PP
+ Merge two (slightly different) files interactively with a user friendly fullscreen interface in text mode\&.
+-
+ .PP
+-Imediff2 shows the differences of given two files (in color if the terminal supports them), lets you scroll the file and toggle changes between old and new version one by one\&. If the 'unresolved' mode is enabled, you can optionally save both versions\&.
+-
++Imediff2
++shows the differences of given two files (in color if the terminal supports them), lets you scroll the file and toggle changes between old and new version one by one\&. If the \*(Aqunresolved\*(Aq mode is enabled, you can optionally save both versions\&.
+ .PP
+-Additionally, if the \fI$EDITOR\fR environment variable is set or if \fB/usr/bin/editor\fR exists and is executable, you can also launch an external editor and manually edit the half\-merged file before saving it, perhaps to resolve the 'unresolved' parts\&.
+-
++Additionally, if the
++\fI$EDITOR\fR
++environment variable is set or if
++\fB/usr/bin/editor\fR
++exists and is executable, you can also launch an external editor and manually edit the half\-merged file before saving it, perhaps to resolve the \*(Aqunresolved\*(Aq parts\&.
+ .PP
+-Empty lines are shown in reverse colors so you see that you can select them\&. If a line is missing completely from one file, imediff2 displays it as a reversed '?'\&. While it seems to take one line in the editing phase, it is naturally not saved into the output file\&.
+-
++Empty lines are shown in reverse colors so you see that you can select them\&. If a line is missing completely from one file,
++imediff2
++displays it as a reversed \*(Aq?\*(Aq\&. While it seems to take one line in the editing phase, it is naturally not saved into the output file\&.
+ .PP
+-To see a list of keyboard commands, hit h or ? in the editor\&.
+-
++To see a list of keyboard commands, hit
++h
++or
++?
++in the editor\&.
+ .PP
+ The program exits with status 0 if the changes were saved, 1 if the merging was aborted and 2 if the parameters were invalid\&.
+-
+ .SH "OPTIONS"
+-
+-.TP
+-\fB\-o \fIoutputfile\fR\fR, \fB\-\-output=\fIoutputfile\fR\fR
++.PP
++\fB\-o \fR\fB\fIoutputfile\fR\fR, \fB\-\-output=\fR\fB\fIoutputfile\fR\fR
++.RS 4
+ Write output to given file\&. If missing, changes will not be saved\&.
+-
+-.TP
++.RE
++.PP
+ \fB\-N\fR, \fB\-\-new\-file\fR
++.RS 4
+ Treat absent files as empty\&.
+-
+-.TP
++.RE
++.PP
+ \fB\-m\fR, \fB\-\-mono\fR
++.RS 4
+ Force monochrome display\&.
+-
+-.TP
++.RE
++.PP
+ \fB\-u\fR, \fB\-\-unresolved\fR
+-Enable 'unresolved' mode (see above)\&.
+-
+-.TP
++.RS 4
++Enable \*(Aqunresolved\*(Aq mode (see above)\&.
++.RE
++.PP
+ \fB\-a\fR
++.RS 4
+ Start with version A (default)\&.
+-
+-.TP
++.RE
++.PP
+ \fB\-b\fR
++.RS 4
+ Start with version B\&.
+-
+-.TP
++.RE
++.PP
+ \fB\-c\fR
++.RS 4
+ Start with unresolved changes (implies \-u)\&.
+-
+-.TP
++.RE
++.PP
+ \fB\-h\fR, \fB\-\-help\fR
++.RS 4
+ Show summary of options and exit\&.
+-
+-.TP
++.RE
++.PP
+ \fB\-V\fR, \fB\-\-version\fR
++.RS 4
+ Show version and exit\&.
+-
++.RE
+ .SH "KEYBOARD COMMANDS"
+-
+ .PP
+ The following keyboard commands are available in the editor\&.
+-
+-.TP
++.PP
+ h, ?
++.RS 4
+ Show commands\&.
+-
+-.TP
++.RE
++.PP
+ up, down, left, right
++.RS 4
+ Move in document\&.
+-
+-.TP
++.RE
++.PP
+ page up, page down
++.RS 4
+ Move a screenfull\&.
+-
+-.TP
++.RE
++.PP
+ enter
++.RS 4
+ Toggle selected change\&.
+-
+-.TP
++.RE
++.PP
+ n, tab, space
++.RS 4
+ Jump to next change\&.
+-
+-.TP
++.RE
++.PP
+ p
++.RS 4
+ Jump to previous change\&.
+-
+-.TP
+-a
++.RE
++.PP
++a, v
++.RS 4
+ Set current chunk to version A\&.
+-
+-.TP
++.RE
++.PP
+ b
++.RS 4
+ Set current chunk to version B\&.
+-
+-.TP
++.RE
++.PP
+ u
++.RS 4
+ Set current chunk to unresolved\&.
+-
+-.TP
+-shift+a
++.RE
++.PP
++shift+a, shift+v
++.RS 4
+ Set all changes to version A\&.
+-
+-.TP
++.RE
++.PP
+ shift+b
++.RS 4
+ Set all changes to version B\&.
+-
+-.TP
++.RE
++.PP
+ shift+u
++.RS 4
+ Set all changes to unresolved\&.
+-
+-.TP
++.RE
++.PP
+ e
++.RS 4
+ Launch external editor\&.
+-
+-.TP
++.RE
++.PP
+ r
+-Discard editor\-made changes\&. (Available only after e\&.)
+-
+-.TP
++.RS 4
++Discard editor\-made changes\&. (Available only after
++e\&.)
++.RE
++.PP
+ x, s
++.RS 4
+ Save and exit\&.
+-
+-.TP
++.RE
++.PP
+ q, ctrl+c
++.RS 4
+ Exit without saving\&.
+-
+-.TP
++.RE
++.PP
+ home, end
++.RS 4
+ Jump to start or end\&.
+-
++.RE
++.SH "NOTE"
++.PP
++In order to avoid accidentally hitting q\-key, v\-key next to b\-key may be used in place of a\-key\&.
+ .SH "SEE ALSO"
+-
+ .PP
+ sdiff (1), diff (1), merge (1), diff3 (1)\&.
+-
+ .SH "COPYRIGHT"
+-
+ .PP
+-This manual page as well as the program itself was written by Jarno Elonen (<elonen@iki\&.fi>)\&. Unlike the program itself, which is licensed under the GNU General Public License (GPL) version 2 (or any later version, at your option), this document has been placed into the Public Domain\&.
+-
+-.SH AUTHOR
+-Jarno Elonen.
++This manual page as well as the program itself was written by
++Jarno Elonen
++(<elonen@iki\&.fi>)\&. Unlike the program itself, which is licensed under the GNU General Public License (GPL) version 2 (or any later version, at your option), this document has been placed into the Public Domain\&.
++.SH "AUTHOR"
++.PP
++\fBJarno Elonen\fR
++.RS 4
++Author.
++.RE
++.SH "COPYRIGHT"
++.br
++Copyright \(co 2003-2006 elonen
++.br
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..5c4ce66
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-Safety-guards-for-the-q-command.patch
-- 
2.11.0

>From 01158e29d912a5af070dd3ed79c85bbde026c605 Mon Sep 17 00:00:00 2001
From: Osamu Aoki <os...@debian.org>
Date: Mon, 10 Apr 2017 22:54:07 +0900
Subject: [PATCH 2/4] Set source format to apply patch series

---
 debian/source/format | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 debian/source/format

diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
-- 
2.11.0

>From c0316635891729ccdfb0c669243a87f488fe8e5d Mon Sep 17 00:00:00 2001
From: Osamu Aoki <os...@debian.org>
Date: Mon, 10 Apr 2017 22:43:29 +0900
Subject: [PATCH 3/4] local package

---
 debian/changelog | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 08c1c08..0935869 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+imediff2 (1.1.2-3.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Add safety guards to the 'q' command.  Closes: #799865
+
+ -- Osamu Aoki <os...@debian.org>  Mon, 10 Apr 2017 22:41:47 +0900
+
 imediff2 (1.1.2-3) unstable; urgency=medium
 
   * Add dh-python, python-setuptools and python-all-dev to Build-Depends.
-- 
2.11.0

>From 5979e340d54e39c37a528c4c1c5190a46ebb738c Mon Sep 17 00:00:00 2001
From: Osamu Aoki <os...@debian.org>
Date: Mon, 10 Apr 2017 23:07:24 +0900
Subject: [PATCH 4/4] Modernize packaging

---
 debian/changelog |  5 +++--
 debian/manpages  |  1 +
 debian/rules     | 60 ++++----------------------------------------------------
 3 files changed, 8 insertions(+), 58 deletions(-)
 create mode 100644 debian/manpages

diff --git a/debian/changelog b/debian/changelog
index 0935869..6bf518c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,10 @@
-imediff2 (1.1.2-3.1) UNRELEASED; urgency=medium
+imediff2 (1.1.2-4) UNRELEASED; urgency=medium
 
   * Non-maintainer upload.
   * Add safety guards to the 'q' command.  Closes: #799865
+  * Modern build rules 
 
- -- Osamu Aoki <os...@debian.org>  Mon, 10 Apr 2017 22:41:47 +0900
+ -- Osamu Aoki <os...@debian.org>  Mon, 10 Apr 2017 23:06:45 +0900
 
 imediff2 (1.1.2-3) unstable; urgency=medium
 
diff --git a/debian/manpages b/debian/manpages
new file mode 100644
index 0000000..cc749cf
--- /dev/null
+++ b/debian/manpages
@@ -0,0 +1 @@
+imediff2.1
diff --git a/debian/rules b/debian/rules
index f2441e7..1f4c565 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,59 +1,7 @@
 #!/usr/bin/make -f
+# uncomment to enable verbose mode for debhelper
+#DH_VERBOSE = 1
 
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
+%:
+	dh $@
 
-PYDEF   := $(shell pyversions -d)
-
-configure: configure-stamp
-configure-stamp:
-	dh_testdir
-	touch configure-stamp
-
-build: build-arch build-indep
-build-arch: build-stamp
-build-indep: build-stamp
-build-stamp:
-
-build-stamp: configure-stamp
-	dh_testdir
-	make imediff2.1
-	touch build-stamp
-
-clean:
-	dh_testdir
-	dh_testroot
-	rm -f build-stamp configure-stamp
-	dh_clean
-
-install: build
-	dh_testdir
-	dh_testroot
-	dh_prep
-	dh_installdirs
-
-# Build architecture-dependent files here.
-binary-arch:
-# We have nothing to do by default.
-
-# Build architecture-independent files here.
-binary-indep: build install
-	dh_testdir
-	dh_testroot
-	dh_installchangelogs
-	dh_installdocs
-	dh_installexamples
-	dh_install
-	dh_installman imediff2.1
-	dh_link
-	dh_compress
-	dh_fixperms
-	dh_python2
-	dh_installdeb
-	dh_shlibdeps
-	dh_gencontrol
-	dh_md5sums
-	dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
-- 
2.11.0

Reply via email to