diff -Nru 9menu-1.9/9menu.1 9menu-1.10/9menu.1 --- 9menu-1.9/9menu.1 2015-07-02 01:38:34.000000000 +0000 +++ 9menu-1.10/9menu.1 2020-04-25 03:47:12.000000000 +0000 @@ -1,4 +1,4 @@ -.TH 9MENU 1 "June 25 2015" +.TH 9MENU 1 "Apr 16 2020" .SH NAME 9menu \- create a menu to run commands .SH SYNOPSIS @@ -184,9 +184,9 @@ .SH EXAMPLES .ft B .nf -9menu \-label Remotes xterm 'acme:rsh acme xterm' 'herman:rsh herman 9term' & +9menu \-label Remotes xterm 'acme:ssh acme xterm' 'herman:ssh herman 9term' & .sp -9menu \-label 'X progs' ghostview xdvi xeyes xneko exit & +9menu \-label 'X progs' gv xdvi xeyes xneko exit & .ft .fi .SH SEE ALSO @@ -199,7 +199,7 @@ .SH VERSION This man page documents .I 9menu -version 1.9. +version 1.10. .PP Source code is available from .BR ftp://ftp.freefriends.org/arnold/Source/9menu.shar.gz . diff -Nru 9menu-1.9/9menu.c 9menu-1.10/9menu.c --- 9menu-1.9/9menu.c 2015-07-02 01:38:34.000000000 +0000 +++ 9menu-1.10/9menu.c 2020-04-25 03:47:12.000000000 +0000 @@ -58,8 +58,10 @@ */ #include +#include #include #include +#include #include #include #include @@ -75,7 +77,7 @@ #include #include -char version[] = "@(#) 9menu version 1.9"; +char version[] = "9menu version 1.10"; Display *dpy; /* lovely X stuff */ int screen; @@ -142,11 +144,11 @@ char *fontname; /* font */ char *labelname; /* window and icon name */ char *filename; /* file to read options or labels from */ -int popup; /* true if we're a popup window */ -int popdown; /* autohide after running a command */ -int iconic; /* start iconified */ -int teleport; /* teleport the menu */ -int warp; /* warp the mouse */ +bool popup = false; /* true if we're a popup window */ +bool popdown = false; /* autohide after running a command */ +bool iconic = false; /* start iconified */ +bool teleport = false; /* teleport the menu */ +bool warp = false; /* warp the mouse */ char **labels; /* list of labels and commands */ char **commands; @@ -154,18 +156,21 @@ char *shell = "/bin/sh"; /* default shell */ -extern void usage(), run_menu(), spawn(), ask_wm_for_delete(); -extern void reap(), set_wm_hints(); -extern void redraw(), teleportmenu(), warpmouse(), restoremouse(); -extern void memory(); -extern int args(); +extern void usage(), run_menu(), spawn(char *com), ask_wm_for_delete(); +extern void reap(int sig), set_wm_hints(int wide, int high); +extern void redraw(int cur, int high, int wide); +extern void teleportmenu(int cur, int wide, int high); +extern void warpmouse(int cur, int wide, int high); +extern void restoremouse(); +extern void memory(char *msg); +extern int args(int argc, char **argv); /* memory --- print the out of memory message and die */ void memory(char *s) { - fprintf(stderr, "%s: couldn't allocate memory for %s\n", progname, s); + fprintf(stderr, "%s: couldn't allocate memory for %s: %s\n", progname, s, strerror(errno)); exit(1); } @@ -176,7 +181,7 @@ { int i; - if (argc == 0 || argv == NULL || argv[0] == '\0') + if (argc == 0 || argv == NULL || argv[0][0] == '\0') return -1; for (i = 0; i < argc && argv[i] != NULL; i++) { @@ -199,15 +204,15 @@ shell = argv[i+1]; i++; } else if (strcmp(argv[i], "-popup") == 0) - popup++; + popup = true; else if (strcmp(argv[i], "-popdown") == 0) - popdown++; + popdown = true; else if (strcmp(argv[i], "-fg") == 0) fgcname = argv[++i]; else if (strcmp(argv[i], "-bg") == 0) bgcname = argv[++i]; else if (strcmp(argv[i], "-iconic") == 0) - iconic++; + iconic = true; else if (strcmp(argv[i], "-path") == 0) { char pathbuf[MAXPATHLEN]; char *s, *t; @@ -221,9 +226,9 @@ putenv(t); } } else if (strcmp(argv[i], "-teleport") == 0) - teleport++; + teleport = true; else if (strcmp(argv[i], "-warp") == 0) - warp++; + warp = true; else if (strcmp(argv[i], "-version") == 0) { printf("%s\n", version); exit(0); @@ -278,11 +283,13 @@ } else { fp = fopen(filename, "r"); } + if (fp == NULL) { - fprintf(stderr, "%s: couldn't open '%s'\n", progname, - filename); + fprintf(stderr, "%s: couldn't open '%s': %s\n", progname, + filename, strerror(errno)); exit(1); } + while (fgets(fbuf, sizeof fbuf, fp)) { char *s = fbuf; strtok(s, "\n"); @@ -368,8 +375,10 @@ fprintf(stderr, "\n"); exit(1); } + screen = DefaultScreen(dpy); root = RootWindow(dpy, screen); + /* * This used to be * black = BlackPixel(dpy, screen); @@ -453,7 +462,7 @@ if (strncmp(com, "exec ", 5) != 0) { pid = fork(); if (pid < 0) { - fprintf(stderr, "%s: can't fork\n", progname); + fprintf(stderr, "%s: can't fork: %s\n", progname, strerror(errno)); return; } else if (pid > 0) return; @@ -471,10 +480,10 @@ /* reap --- collect dead children */ void -reap(int s) +reap(int sig) { (void) wait((int *) NULL); - signal(s, reap); + signal(sig, reap); } /* usage --- print a usage message and die */ @@ -484,9 +493,9 @@ { fprintf(stderr, "usage: %s [-display displayname] [-font fname] ", progname); fprintf(stderr, "[-file filename] [-path]"); - fprintf(stderr, "[-geometry geom] [-shell shell] [-label name] "); - fprintf(stderr, "[-popup] [-popdown] [-iconic] [-teleport] "); - fprintf(stderr, "[-warp] [-version] menitem:command ...\n"); + fprintf(stderr, "[-geometry geom] [-shell shell] [-label name] "); + fprintf(stderr, "[-popup] [-popdown] [-iconic] [-teleport] "); + fprintf(stderr, "[-warp] [-version] menitem:command ...\n"); exit(0); } @@ -585,12 +594,15 @@ && key != CONFIG_MENU_SELECT_KEY) break; + /* adjust i so mapping will work */ if (key == CONFIG_MENU_UP_KEY) { old = cur; cur--; + i--; } else if (key == CONFIG_MENU_DOWN_KEY) { old = cur; cur++; + i++; } while (cur < 0) diff -Nru 9menu-1.9/debian/changelog 9menu-1.10/debian/changelog --- 9menu-1.9/debian/changelog 2019-02-05 03:06:54.000000000 +0000 +++ 9menu-1.10/debian/changelog 2020-04-25 04:06:32.000000000 +0000 @@ -1,3 +1,19 @@ +9menu (1.10-1) unstable; urgency=medium + + * New upstream release. + * Add d/repack.sh script. + * Change my email address and my lastname in debian files. + * Bump standard versions 4.5.0 (no changes). + * Use wrap-and-sort. + * Use debhelper-compat instead of debian/compat. + * Mark Rules-Requires-Root: no as we don't need root for building + * debian/patches + + Refresh 04_signedness.diff patch. + + Refresh 05_morekeys.diff patch. + + Refresh 07_remove-resource-leak.diff patch. + + -- Daniel Echeverri Fri, 24 Apr 2020 23:06:32 -0500 + 9menu (1.9-2) unstable; urgency=medium * Fix FTCBFS uses native compiler. (Closes: #921048) @@ -15,7 +31,7 @@ * Remove some trailing-whitespaces. * Use wrap-and-sort. - -- Daniel Echeverry Mon, 04 Feb 2019 22:06:54 -0500 + -- Daniel Echeverri Mon, 04 Feb 2019 22:06:54 -0500 9menu (1.9-1) unstable; urgency=low @@ -29,7 +45,7 @@ + Remove 06_Imakefile.diff patch merge with upstream + Refresh 07_remove-resource-leak.diff patch - -- Daniel Echeverry Wed, 01 Jul 2015 20:40:20 -0500 + -- Daniel Echeverri Wed, 01 Jul 2015 20:40:20 -0500 9menu (1.8-6) unstable; urgency=low @@ -43,14 +59,14 @@ * debian/rules + Use Hardening flags - -- Daniel Echeverry Wed, 22 Aug 2012 18:52:13 -0500 + -- Daniel Echeverri Wed, 22 Aug 2012 18:52:13 -0500 9menu (1.8-5) unstable; urgency=low * Fix resource leak:fp LP: #479042 + New patch 07_remove-resource-leak.diff - -- Daniel Echeverry Thu, 16 Dec 2010 15:02:55 -0500 + -- Daniel Echeverri Thu, 16 Dec 2010 15:02:55 -0500 9menu (1.8-4) unstable; urgency=low @@ -60,7 +76,7 @@ + New patch: 06_Imakefile.diff * Added header description into old patches - -- Daniel Echeverry Mon, 01 Nov 2010 20:04:56 -0500 + -- Daniel Echeverri Mon, 01 Nov 2010 20:04:56 -0500 9menu (1.8-3) unstable; urgency=low @@ -79,7 +95,7 @@ * debian/compat + Switch compat level 5 to 7 - -- Daniel Echeverry Mon, 27 Sep 2010 19:54:44 -0500 + -- Daniel Echeverri Mon, 27 Sep 2010 19:54:44 -0500 9menu (1.8-2) unstable; urgency=low diff -Nru 9menu-1.9/debian/compat 9menu-1.10/debian/compat --- 9menu-1.9/debian/compat 2019-02-05 03:06:54.000000000 +0000 +++ 9menu-1.10/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -11 diff -Nru 9menu-1.9/debian/control 9menu-1.10/debian/control --- 9menu-1.9/debian/control 2019-02-05 03:06:54.000000000 +0000 +++ 9menu-1.10/debian/control 2020-04-25 04:06:32.000000000 +0000 @@ -1,9 +1,13 @@ Source: 9menu Section: x11 Priority: optional -Maintainer: Daniel Echeverry -Build-Depends: debhelper (>= 11), libx11-dev, x11proto-core-dev, xutils-dev -Standards-Version: 4.3.0 +Maintainer: Daniel Echeverri +Build-Depends: debhelper-compat (= 12), + libx11-dev, + x11proto-core-dev, + xutils-dev +Standards-Version: 4.5.0 +Rules-Requires-Root: no Package: 9menu Architecture: any diff -Nru 9menu-1.9/debian/copyright 9menu-1.10/debian/copyright --- 9menu-1.9/debian/copyright 2019-02-05 03:06:54.000000000 +0000 +++ 9menu-1.10/debian/copyright 2020-04-25 04:06:32.000000000 +0000 @@ -7,7 +7,7 @@ License: custom Files: debian/* -Copyright: 2011-2015 Daniel Echeverry +Copyright: 2011-2015 Daniel Echeverri 2003-2005 Andrew Stribblehill 2000-2003 Stephen Frost 1996-2000 Karl Sackett diff -Nru 9menu-1.9/debian/patches/04_signedness.diff 9menu-1.10/debian/patches/04_signedness.diff --- 9menu-1.9/debian/patches/04_signedness.diff 2015-07-08 02:58:11.000000000 +0000 +++ 9menu-1.10/debian/patches/04_signedness.diff 2020-04-25 04:06:32.000000000 +0000 @@ -2,10 +2,10 @@ Forwarded: yes Author: Andrew Stribblehill Origin: vendor -Last-Update: 2015-07-01 +Last-Update: 2020-04-24 --- a/9menu.c +++ b/9menu.c -@@ -113,7 +113,7 @@ char *fontlist[] = { /* default font lis +@@ -115,7 +115,7 @@ /* the 9menu icon, for garish window managers */ #define nine_menu_width 40 #define nine_menu_height 40 @@ -14,7 +14,7 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x00, 0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x00, 0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x04, -@@ -787,7 +787,7 @@ teleportmenu(int cur, int wide, int high +@@ -799,7 +799,7 @@ Window wdummy; if (XQueryPointer(dpy, menuwin, &wdummy, &wdummy, &x, &y, @@ -23,7 +23,7 @@ XMoveWindow(dpy, menuwin, x-wide/2, y-cur*high-high/2); } -@@ -805,7 +805,7 @@ warpmouse(int cur, int wide, int high) +@@ -817,7 +817,7 @@ offset += 6; /* fudge factor */ if (XQueryPointer(dpy, menuwin, &wdummy, &wdummy, &savex, &savey, diff -Nru 9menu-1.9/debian/patches/05_morekeys.diff 9menu-1.10/debian/patches/05_morekeys.diff --- 9menu-1.9/debian/patches/05_morekeys.diff 2015-07-02 02:19:55.000000000 +0000 +++ 9menu-1.10/debian/patches/05_morekeys.diff 2020-04-25 04:06:32.000000000 +0000 @@ -2,10 +2,10 @@ Forwarded: yes Author: Andrew Stribblehill Origin: vendor -Last-Update: 2015-07-01 +Last-Update: 2020-04-24 --- a/9menu.c +++ b/9menu.c -@@ -136,6 +136,14 @@ static char nine_menu_bits[] = { +@@ -138,6 +138,14 @@ #define CONFIG_MENU_UP_KEY XK_Up #define CONFIG_MENU_DOWN_KEY XK_Down #define CONFIG_MENU_SELECT_KEY XK_Return @@ -20,32 +20,7 @@ char *progname; /* my name */ char *displayname; /* X display */ -@@ -582,13 +590,21 @@ run_menu() - ev.xkey.state & ShiftMask ? 1 : 0); - if (key != CONFIG_MENU_UP_KEY - && key != CONFIG_MENU_DOWN_KEY -- && key != CONFIG_MENU_SELECT_KEY) -+ && key != CONFIG_MENU_SELECT_KEY -+ && key != CONFIG_MENU_ALTERNATE_DOWN_KEY -+ && key != CONFIG_MENU_ALTERNATE_UP_KEY -+ && key != CONFIG_MENU_ALTERNATE_SELECT_KEY -+ && key != CONFIG_MENU_EMACS_DOWN_KEY -+ && key != CONFIG_MENU_EMACS_UP_KEY -+ && key != CONFIG_MENU_VI_DOWN_KEY -+ && key != CONFIG_MENU_VI_UP_KEY -+ && key != CONFIG_MENU_ABORT_KEY) - break; - -- if (key == CONFIG_MENU_UP_KEY) { -+ if (key == CONFIG_MENU_UP_KEY || key == CONFIG_MENU_EMACS_UP_KEY || key == CONFIG_MENU_VI_UP_KEY || key == CONFIG_MENU_ALTERNATE_UP_KEY) { - old = cur; - cur--; -- } else if (key == CONFIG_MENU_DOWN_KEY) { -+ } else if (key == CONFIG_MENU_DOWN_KEY || key == CONFIG_MENU_EMACS_DOWN_KEY || key == CONFIG_MENU_VI_DOWN_KEY || key == CONFIG_MENU_ALTERNATE_DOWN_KEY) { - old = cur; - cur++; - } -@@ -598,7 +614,10 @@ run_menu() +@@ -610,7 +618,10 @@ cur %= numitems; @@ -57,7 +32,7 @@ if (cur == old) break; if (old >= 0 && old < numitems && cur != -1) -@@ -610,7 +629,13 @@ run_menu() +@@ -622,7 +633,13 @@ if (warp) restoremouse(); diff -Nru 9menu-1.9/debian/patches/07_remove-resource-leak.diff 9menu-1.10/debian/patches/07_remove-resource-leak.diff --- 9menu-1.9/debian/patches/07_remove-resource-leak.diff 2015-07-02 02:20:18.000000000 +0000 +++ 9menu-1.10/debian/patches/07_remove-resource-leak.diff 2020-04-25 04:06:32.000000000 +0000 @@ -1,11 +1,11 @@ Description: Fix resource leak:fp Forwarded: yes -Author: Daniel Echeverry +Author: Daniel Echeverri Origin: vendor -Last-Update: 2015-07-01 +Last-Update: 2020-04-24 --- a/9menu.c +++ b/9menu.c -@@ -335,6 +335,7 @@ main(int argc, char **argv) +@@ -342,6 +342,7 @@ strcpy(f_argv[nlabels], s); ++nlabels; } diff -Nru 9menu-1.9/debian/repack.sh 9menu-1.10/debian/repack.sh --- 9menu-1.9/debian/repack.sh 1970-01-01 00:00:00.000000000 +0000 +++ 9menu-1.10/debian/repack.sh 2020-04-25 04:06:23.000000000 +0000 @@ -0,0 +1,27 @@ +#!/bin/sh +set -e + +if [ -z "$2" ]; then + echo "This script must be run via uscan or by manually specifying the tarball" >&2 + exit 1 +fi +echo "Repackaging..." + +VERSION=$2 +OLDDIR=$PWD +BASEDIR=$PWD/../ + +cd $BASEDIR +mkdir 9menu-${VERSION}/ +mv 9menu-${VERSION}.shar.gz 9menu-${VERSION}/ +cd 9menu-${VERSION}/ +echo "Extracting shar file..." +gzip -d 9menu-${VERSION}.shar.gz +sh 9menu-${VERSION}.shar +rm -rf 9menu-${VERSION}.shar +cd .. +echo "Generating tar.gz tarball" +tar cf 9menu_$VERSION.tar 9menu-${VERSION}/ +xz 9menu_$VERSION.tar +echo "Generating symlink" +ln -sf 9menu_$VERSION.tar.xz 9menu_$VERSION.orig.tar.xz diff -Nru 9menu-1.9/debian/watch 9menu-1.10/debian/watch --- 9menu-1.9/debian/watch 2015-07-02 01:40:15.000000000 +0000 +++ 9menu-1.10/debian/watch 2020-04-25 04:06:23.000000000 +0000 @@ -1,3 +1,3 @@ version=3 -ftp://ftp.freefriends.org/arnold/Source/9menu-(.*)\.shar\.gz +ftp://ftp.freefriends.org/arnold/Source/9menu-(.*)\.shar\.gz debian debian/repack.sh