diff -Nru evtest-1.32/aclocal.m4 evtest-1.33/aclocal.m4 --- evtest-1.32/aclocal.m4 2014-08-09 20:43:43.000000000 +0000 +++ evtest-1.33/aclocal.m4 2015-07-25 08:43:39.000000000 +0000 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.14.1 -*- Autoconf -*- +# generated automatically by aclocal 1.15 -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -235,7 +235,7 @@ AS_VAR_IF([$1], [""], [$5], [$4])dnl ])# PKG_CHECK_VAR -# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# Copyright (C) 2002-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -247,10 +247,10 @@ # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.14' +[am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.14.1], [], +m4_if([$1], [1.15], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -266,14 +266,14 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.14.1])dnl +[AM_AUTOMAKE_VERSION([1.15])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -318,15 +318,14 @@ # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -357,7 +356,7 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -548,7 +547,7 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -624,7 +623,7 @@ # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -714,8 +713,8 @@ # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl @@ -789,6 +788,9 @@ AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not @@ -818,7 +820,7 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -829,7 +831,7 @@ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -839,7 +841,7 @@ fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2013 Free Software Foundation, Inc. +# Copyright (C) 2003-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -860,7 +862,7 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -910,7 +912,7 @@ # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -949,7 +951,7 @@ # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -978,7 +980,7 @@ AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1025,7 +1027,7 @@ # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1044,7 +1046,7 @@ # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1125,7 +1127,7 @@ rm -f conftest.file ]) -# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# Copyright (C) 2009-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1185,7 +1187,7 @@ _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1213,7 +1215,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2013 Free Software Foundation, Inc. +# Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1232,7 +1234,7 @@ # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2013 Free Software Foundation, Inc. +# Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff -Nru evtest-1.32/compile evtest-1.33/compile --- evtest-1.32/compile 2014-08-09 20:43:43.000000000 +0000 +++ evtest-1.33/compile 2015-07-25 08:43:39.000000000 +0000 @@ -3,7 +3,7 @@ scriptversion=2012-10-14.11; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify diff -Nru evtest-1.32/configure evtest-1.33/configure --- evtest-1.32/configure 2014-08-09 20:43:43.000000000 +0000 +++ evtest-1.33/configure 2015-07-25 08:43:39.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for evtest 1.32. +# Generated by GNU Autoconf 2.69 for evtest 1.33. # # Report bugs to . # @@ -580,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='evtest' PACKAGE_TARNAME='evtest' -PACKAGE_VERSION='1.32' -PACKAGE_STRING='evtest 1.32' +PACKAGE_VERSION='1.33' +PACKAGE_STRING='evtest 1.33' PACKAGE_BUGREPORT='https://bugzilla.freedesktop.org/enter_bug.cgi?product=evtest' PACKAGE_URL='' @@ -1240,7 +1240,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures evtest 1.32 to adapt to many kinds of systems. +\`configure' configures evtest 1.33 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1306,7 +1306,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of evtest 1.32:";; + short | recursive ) echo "Configuration of evtest 1.33:";; esac cat <<\_ACEOF @@ -1403,7 +1403,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -evtest configure 1.32 +evtest configure 1.33 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1458,7 +1458,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by evtest $as_me 1.32, which was +It was created by evtest $as_me 1.33, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -1806,7 +1806,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -am__api_version='1.14' +am__api_version='1.15' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do @@ -2007,8 +2007,8 @@ ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in @@ -2027,7 +2027,7 @@ $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -2321,7 +2321,7 @@ # Define the identity of the package. PACKAGE='evtest' - VERSION='1.32' + VERSION='1.33' cat >>confdefs.h <<_ACEOF @@ -2355,8 +2355,8 @@ # mkdir_p='$(MKDIR_P)' -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' @@ -4266,7 +4266,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by evtest $as_me 1.32, which was +This file was extended by evtest $as_me 1.33, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4332,7 +4332,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -evtest config.status 1.32 +evtest config.status 1.33 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru evtest-1.32/configure.ac evtest-1.33/configure.ac --- evtest-1.32/configure.ac 2014-08-09 20:38:22.000000000 +0000 +++ evtest-1.33/configure.ac 2015-07-25 08:41:16.000000000 +0000 @@ -1,5 +1,5 @@ AC_PREREQ([2.57]) -AC_INIT(evtest,[1.32], [https://bugzilla.freedesktop.org/enter_bug.cgi?product=evtest], evtest) +AC_INIT(evtest,[1.33], [https://bugzilla.freedesktop.org/enter_bug.cgi?product=evtest], evtest) AM_INIT_AUTOMAKE([foreign dist-bzip2]) AC_CONFIG_HEADERS(config.h) diff -Nru evtest-1.32/debian/changelog evtest-1.33/debian/changelog --- evtest-1.32/debian/changelog 2014-08-09 21:19:36.000000000 +0000 +++ evtest-1.33/debian/changelog 2015-07-25 11:50:59.000000000 +0000 @@ -1,3 +1,10 @@ +evtest (1:1.33-1) unstable; urgency=medium + + * New upstream version. + * Standards-Version 3.9.6, no change required. + + -- Stephen Kitt Sat, 25 Jul 2015 13:50:53 +0200 + evtest (1:1.32-1) unstable; urgency=medium * New upstream version. diff -Nru evtest-1.32/debian/control evtest-1.33/debian/control --- evtest-1.32/debian/control 2014-08-09 21:18:25.000000000 +0000 +++ evtest-1.33/debian/control 2015-07-25 11:50:08.000000000 +0000 @@ -9,7 +9,7 @@ pkg-config, xmlto, xsltproc -Standards-Version: 3.9.5 +Standards-Version: 3.9.6 Homepage: http://cgit.freedesktop.org/evtest/ Vcs-Git: git://anonscm.debian.org/collab-maint/evtest.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/evtest.git;a=summary diff -Nru evtest-1.32/depcomp evtest-1.33/depcomp --- evtest-1.32/depcomp 2014-08-09 20:43:43.000000000 +0000 +++ evtest-1.33/depcomp 2015-07-25 08:43:39.000000000 +0000 @@ -3,7 +3,7 @@ scriptversion=2013-05-30.07; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2014 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -Nru evtest-1.32/evtest.1 evtest-1.33/evtest.1 --- evtest-1.32/evtest.1 2014-08-09 20:43:45.000000000 +0000 +++ evtest-1.33/evtest.1 2015-07-25 08:44:15.000000000 +0000 @@ -2,12 +2,12 @@ .\" Title: evtest .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 08/09/2014 +.\" Date: 07/25/2015 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "EVTEST" "1" "08/09/2014" "\ \&" "\ \&" +.TH "EVTEST" "1" "07/25/2015" "\ \&" "\ \&" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -32,7 +32,7 @@ .SH "SYNOPSIS" .sp .nf -evtest /dev/input/eventX +evtest [\-\-grab] /dev/input/eventX .fi .sp .nf @@ -42,6 +42,8 @@ .sp The first invocation type displayed above ("capture mode") causes evtest to display information about the specified input device, including all the events supported by the device\&. It then monitors the device and displays all the events layer events generated\&. .sp +If the \-\-grab flag is given in capture mode, evtest keeps an EVIOCGRAB on the device\&. While this grab is active, other processes will not receive events from the kernel devices\&. The grab is released again when evtest quits\&. +.sp In the second invocation type ("query mode"), evtest performs a one\-shot query of the state of a specific key \fBvalue\fR of an event \fBtype\fR\&. .sp \fBtype\fR is one of: \fBEV_KEY\fR, \fBEV_SW\fR, \fBEV_SND\fR, \fBEV_LED\fR (or the numerical value) diff -Nru evtest-1.32/evtest.c evtest-1.33/evtest.c --- evtest-1.32/evtest.c 2014-08-09 20:38:22.000000000 +0000 +++ evtest-1.33/evtest.c 2015-07-25 08:41:16.000000000 +0000 @@ -55,6 +55,10 @@ #include #include #include +#include +#include +#include +#include #define BITS_PER_LONG (sizeof(long) * 8) #define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1) @@ -100,6 +104,14 @@ { "EV_SW", EV_SW, SW_MAX, EVIOCGSW(SW_MAX) }, }; +static int grab_flag = 0; +static volatile sig_atomic_t stop = 0; + +static void interrupt_handler(int sig) +{ + stop = 1; +} + /** * Look up an entry in the query_modes table by its textual name. * @@ -192,6 +204,12 @@ NAME_ELEMENT(INPUT_PROP_DIRECT), NAME_ELEMENT(INPUT_PROP_BUTTONPAD), NAME_ELEMENT(INPUT_PROP_SEMI_MT), +#ifdef INPUT_PROP_TOPBUTTONPAD + NAME_ELEMENT(INPUT_PROP_TOPBUTTONPAD), +#endif +#ifdef INPUT_PROP_POINTING_STICK + NAME_ELEMENT(INPUT_PROP_POINTING_STICK), +#endif }; #endif @@ -349,10 +367,39 @@ NAME_ELEMENT(KEY_DATABASE), NAME_ELEMENT(KEY_NEWS), NAME_ELEMENT(KEY_VOICEMAIL), NAME_ELEMENT(KEY_ADDRESSBOOK), NAME_ELEMENT(KEY_MESSENGER), NAME_ELEMENT(KEY_DISPLAYTOGGLE), - NAME_ELEMENT(KEY_SPELLCHECK), NAME_ELEMENT(KEY_LOGOFF), - NAME_ELEMENT(KEY_DOLLAR), NAME_ELEMENT(KEY_EURO), - NAME_ELEMENT(KEY_FRAMEBACK), NAME_ELEMENT(KEY_FRAMEFORWARD), - NAME_ELEMENT(KEY_CONTEXT_MENU), NAME_ELEMENT(KEY_MEDIA_REPEAT), +#ifdef KEY_SPELLCHECK + NAME_ELEMENT(KEY_SPELLCHECK), +#endif +#ifdef KEY_LOGOFF + NAME_ELEMENT(KEY_LOGOFF), +#endif +#ifdef KEY_DOLLAR + NAME_ELEMENT(KEY_DOLLAR), +#endif +#ifdef KEY_EURO + NAME_ELEMENT(KEY_EURO), +#endif +#ifdef KEY_FRAMEBACK + NAME_ELEMENT(KEY_FRAMEBACK), +#endif +#ifdef KEY_FRAMEFORWARD + NAME_ELEMENT(KEY_FRAMEFORWARD), +#endif +#ifdef KEY_CONTEXT_MENU + NAME_ELEMENT(KEY_CONTEXT_MENU), +#endif +#ifdef KEY_MEDIA_REPEAT + NAME_ELEMENT(KEY_MEDIA_REPEAT), +#endif +#ifdef KEY_10CHANNELSUP + NAME_ELEMENT(KEY_10CHANNELSUP), +#endif +#ifdef KEY_10CHANNELSDOWN + NAME_ELEMENT(KEY_10CHANNELSDOWN), +#endif +#ifdef KEY_IMAGES + NAME_ELEMENT(KEY_IMAGES), +#endif NAME_ELEMENT(KEY_DEL_EOL), NAME_ELEMENT(KEY_DEL_EOS), NAME_ELEMENT(KEY_INS_LINE), NAME_ELEMENT(KEY_DEL_LINE), NAME_ELEMENT(KEY_FN), NAME_ELEMENT(KEY_FN_ESC), @@ -371,28 +418,54 @@ NAME_ELEMENT(KEY_BRL_DOT5), NAME_ELEMENT(KEY_BRL_DOT6), NAME_ELEMENT(KEY_BRL_DOT7), NAME_ELEMENT(KEY_BRL_DOT8), NAME_ELEMENT(KEY_BRL_DOT9), NAME_ELEMENT(KEY_BRL_DOT10), +#ifdef KEY_NUMERIC_0 NAME_ELEMENT(KEY_NUMERIC_0), NAME_ELEMENT(KEY_NUMERIC_1), NAME_ELEMENT(KEY_NUMERIC_2), NAME_ELEMENT(KEY_NUMERIC_3), NAME_ELEMENT(KEY_NUMERIC_4), NAME_ELEMENT(KEY_NUMERIC_5), NAME_ELEMENT(KEY_NUMERIC_6), NAME_ELEMENT(KEY_NUMERIC_7), NAME_ELEMENT(KEY_NUMERIC_8), NAME_ELEMENT(KEY_NUMERIC_9), NAME_ELEMENT(KEY_NUMERIC_STAR), NAME_ELEMENT(KEY_NUMERIC_POUND), +#endif NAME_ELEMENT(KEY_BATTERY), NAME_ELEMENT(KEY_BLUETOOTH), NAME_ELEMENT(KEY_BRIGHTNESS_CYCLE), - NAME_ELEMENT(KEY_BRIGHTNESS_ZERO), NAME_ELEMENT(KEY_DASHBOARD), + NAME_ELEMENT(KEY_BRIGHTNESS_ZERO), +#ifdef KEY_DASHBOARD + NAME_ELEMENT(KEY_DASHBOARD), +#endif NAME_ELEMENT(KEY_DISPLAY_OFF), NAME_ELEMENT(KEY_DOCUMENTS), NAME_ELEMENT(KEY_FORWARDMAIL), NAME_ELEMENT(KEY_NEW), NAME_ELEMENT(KEY_KBDILLUMDOWN), NAME_ELEMENT(KEY_KBDILLUMUP), NAME_ELEMENT(KEY_KBDILLUMTOGGLE), NAME_ELEMENT(KEY_REDO), NAME_ELEMENT(KEY_REPLY), NAME_ELEMENT(KEY_SAVE), - NAME_ELEMENT(KEY_SCALE), NAME_ELEMENT(KEY_SEND), +#ifdef KEY_SCALE + NAME_ELEMENT(KEY_SCALE), +#endif + NAME_ELEMENT(KEY_SEND), NAME_ELEMENT(KEY_SCREENLOCK), NAME_ELEMENT(KEY_SWITCHVIDEOMODE), - NAME_ELEMENT(KEY_UWB), NAME_ELEMENT(KEY_VIDEO_NEXT), - NAME_ELEMENT(KEY_VIDEO_PREV), NAME_ELEMENT(KEY_WIMAX), +#ifdef KEY_UWB + NAME_ELEMENT(KEY_UWB), +#endif +#ifdef KEY_VIDEO_NEXT + NAME_ELEMENT(KEY_VIDEO_NEXT), +#endif +#ifdef KEY_VIDEO_PREV + NAME_ELEMENT(KEY_VIDEO_PREV), +#endif +#ifdef KEY_WIMAX + NAME_ELEMENT(KEY_WIMAX), +#endif +#ifdef KEY_WLAN NAME_ELEMENT(KEY_WLAN), +#endif #ifdef KEY_RFKILL NAME_ELEMENT(KEY_RFKILL), #endif +#ifdef KEY_MICMUTE + NAME_ELEMENT(KEY_MICMUTE), +#endif +#ifdef KEY_CAMERA_FOCUS + NAME_ELEMENT(KEY_CAMERA_FOCUS), +#endif #ifdef KEY_WPS_BUTTON NAME_ELEMENT(KEY_WPS_BUTTON), #endif @@ -445,7 +518,10 @@ NAME_ELEMENT(BTN_TOOL_MOUSE), NAME_ELEMENT(BTN_TOOL_LENS), NAME_ELEMENT(BTN_TOUCH), NAME_ELEMENT(BTN_STYLUS), NAME_ELEMENT(BTN_STYLUS2), NAME_ELEMENT(BTN_TOOL_DOUBLETAP), - NAME_ELEMENT(BTN_TOOL_TRIPLETAP), NAME_ELEMENT(BTN_TOOL_QUADTAP), + NAME_ELEMENT(BTN_TOOL_TRIPLETAP), +#ifdef BTN_TOOL_QUADTAP + NAME_ELEMENT(BTN_TOOL_QUADTAP), +#endif NAME_ELEMENT(BTN_GEAR_DOWN), NAME_ELEMENT(BTN_GEAR_UP), @@ -453,7 +529,54 @@ NAME_ELEMENT(BTN_DPAD_UP), NAME_ELEMENT(BTN_DPAD_DOWN), NAME_ELEMENT(BTN_DPAD_LEFT), NAME_ELEMENT(BTN_DPAD_RIGHT), #endif - +#ifdef KEY_ALS_TOGGLE + NAME_ELEMENT(KEY_ALS_TOGGLE), +#endif +#ifdef KEY_BUTTONCONFIG + NAME_ELEMENT(KEY_BUTTONCONFIG), +#endif +#ifdef KEY_TASKMANAGER + NAME_ELEMENT(KEY_TASKMANAGER), +#endif +#ifdef KEY_JOURNAL + NAME_ELEMENT(KEY_JOURNAL), +#endif +#ifdef KEY_CONTROLPANEL + NAME_ELEMENT(KEY_CONTROLPANEL), +#endif +#ifdef KEY_APPSELECT + NAME_ELEMENT(KEY_APPSELECT), +#endif +#ifdef KEY_SCREENSAVER + NAME_ELEMENT(KEY_SCREENSAVER), +#endif +#ifdef KEY_VOICECOMMAND + NAME_ELEMENT(KEY_VOICECOMMAND), +#endif +#ifdef KEY_BRIGHTNESS_MIN + NAME_ELEMENT(KEY_BRIGHTNESS_MIN), +#endif +#ifdef KEY_BRIGHTNESS_MAX + NAME_ELEMENT(KEY_BRIGHTNESS_MAX), +#endif +#ifdef KEY_KBDINPUTASSIST_PREV + NAME_ELEMENT(KEY_KBDINPUTASSIST_PREV), +#endif +#ifdef KEY_KBDINPUTASSIST_NEXT + NAME_ELEMENT(KEY_KBDINPUTASSIST_NEXT), +#endif +#ifdef KEY_KBDINPUTASSIST_PREVGROUP + NAME_ELEMENT(KEY_KBDINPUTASSIST_PREVGROUP), +#endif +#ifdef KEY_KBDINPUTASSIST_NEXTGROUP + NAME_ELEMENT(KEY_KBDINPUTASSIST_NEXTGROUP), +#endif +#ifdef KEY_KBDINPUTASSIST_ACCEPT + NAME_ELEMENT(KEY_KBDINPUTASSIST_ACCEPT), +#endif +#ifdef KEY_KBDINPUTASSIST_CANCEL + NAME_ELEMENT(KEY_KBDINPUTASSIST_CANCEL), +#endif #ifdef BTN_TRIGGER_HAPPY NAME_ELEMENT(BTN_TRIGGER_HAPPY1), NAME_ELEMENT(BTN_TRIGGER_HAPPY11), NAME_ELEMENT(BTN_TRIGGER_HAPPY2), NAME_ELEMENT(BTN_TRIGGER_HAPPY12), @@ -554,6 +677,12 @@ NAME_ELEMENT(LED_KANA), NAME_ELEMENT(LED_SLEEP), NAME_ELEMENT(LED_SUSPEND), NAME_ELEMENT(LED_MUTE), NAME_ELEMENT(LED_MISC), +#ifdef LED_MAIL + NAME_ELEMENT(LED_MAIL), +#endif +#ifdef LED_CHARGING + NAME_ELEMENT(LED_CHARGING), +#endif }; static const char * const repeats[REP_MAX + 1] = { @@ -580,11 +709,21 @@ NAME_ELEMENT(SW_LID), NAME_ELEMENT(SW_TABLET_MODE), NAME_ELEMENT(SW_HEADPHONE_INSERT), +#ifdef SW_RFKILL_ALL NAME_ELEMENT(SW_RFKILL_ALL), +#endif +#ifdef SW_MICROPHONE_INSERT NAME_ELEMENT(SW_MICROPHONE_INSERT), +#endif +#ifdef SW_DOCK NAME_ELEMENT(SW_DOCK), +#endif +#ifdef SW_LINEOUT_INSERT NAME_ELEMENT(SW_LINEOUT_INSERT), +#endif +#ifdef SW_JACK_PHYSICAL_INSERT NAME_ELEMENT(SW_JACK_PHYSICAL_INSERT), +#endif #ifdef SW_VIDEOOUT_INSERT NAME_ELEMENT(SW_VIDEOOUT_INSERT), #endif @@ -596,6 +735,12 @@ #ifdef SW_ROTATE_LOCK NAME_ELEMENT(SW_ROTATE_LOCK), #endif +#ifdef SW_LINEIN_INSERT + NAME_ELEMENT(SW_LINEIN_INSERT), +#endif +#ifdef SW_MUTE_DEVICE + NAME_ELEMENT(SW_MUTE_DEVICE), +#endif }; static const char * const force[FF_MAX + 1] = { @@ -617,7 +762,7 @@ static const char * const * const names[EV_MAX + 1] = { [0 ... EV_MAX] = NULL, - [EV_SYN] = events, [EV_KEY] = keys, + [EV_SYN] = syns, [EV_KEY] = keys, [EV_REL] = relatives, [EV_ABS] = absolutes, [EV_MSC] = misc, [EV_LED] = leds, [EV_SND] = sounds, [EV_REP] = repeats, @@ -684,6 +829,7 @@ struct dirent **namelist; int i, ndev, devnum; char *filename; + int max_device = 0; ndev = scandir(DEV_INPUT_EVENT, &namelist, is_event_device, versionsort); if (ndev <= 0) @@ -706,13 +852,18 @@ fprintf(stderr, "%s: %s\n", fname, name); close(fd); + + sscanf(namelist[i]->d_name, "event%d", &devnum); + if (devnum > max_device) + max_device = devnum; + free(namelist[i]); } - fprintf(stderr, "Select the device event number [0-%d]: ", ndev - 1); + fprintf(stderr, "Select the device event number [0-%d]: ", max_device); scanf("%d", &devnum); - if (devnum >= ndev || devnum < 0) + if (devnum > max_device || devnum < 0) return NULL; asprintf(&filename, "%s/%s%d", @@ -738,8 +889,9 @@ static int usage(void) { printf("USAGE:\n"); - printf(" Grab mode:\n"); - printf(" %s /dev/input/eventX\n", program_invocation_short_name); + printf(" Capture mode:\n"); + printf(" %s [--grab] /dev/input/eventX\n", program_invocation_short_name); + printf(" --grab grab the device for exclusive access\n"); printf("\n"); printf(" Query mode: (check exit code)\n"); printf(" %s --query /dev/input/eventX \n", @@ -802,6 +954,32 @@ } #endif +static int get_state(int fd, unsigned int type, unsigned long *array, size_t size) +{ + int rc; + + switch(type) { + case EV_LED: + rc = ioctl(fd, EVIOCGLED(size), array); + break; + case EV_SND: + rc = ioctl(fd, EVIOCGSND(size), array); + break; + case EV_SW: + rc = ioctl(fd, EVIOCGSW(size), array); + break; + case EV_KEY: + /* intentionally not printing the value for EV_KEY, let the + * repeat handle this */ + default: + return 1; + } + if (rc == -1) + return 1; + + return 0; +} + /** * Print static device information (no events). This information includes * version numbers, device name and all bits supported by this device. @@ -811,14 +989,18 @@ */ static int print_device_info(int fd) { - unsigned int type, code, prop; + unsigned int type, code; int version; unsigned short id[4]; char name[256] = "Unknown"; unsigned long bit[EV_MAX][NBITS(KEY_MAX)]; + unsigned long state[KEY_CNT] = {0}; #ifdef INPUT_PROP_SEMI_MT + unsigned int prop; unsigned long propbits[INPUT_PROP_MAX]; #endif + int stateval; + int have_state; if (ioctl(fd, EVIOCGVERSION, &version)) { perror("evtest: can't get version"); @@ -841,12 +1023,20 @@ for (type = 0; type < EV_MAX; type++) { if (test_bit(type, bit[0]) && type != EV_REP) { + have_state = (get_state(fd, type, state, sizeof(state)) == 0); + printf(" Event type %d (%s)\n", type, typename(type)); if (type == EV_SYN) continue; ioctl(fd, EVIOCGBIT(type, KEY_MAX), bit[type]); for (code = 0; code < KEY_MAX; code++) if (test_bit(code, bit[type])) { - printf(" Event code %d (%s)\n", code, codename(type, code)); + if (have_state) { + stateval = test_bit(code, state); + printf(" Event code %d (%s) state %d\n", + code, codename(type, code), stateval); + } else { + printf(" Event code %d (%s)\n", code, codename(type, code)); + } if (type == EV_ABS) print_absdata(fd, code); } @@ -881,9 +1071,16 @@ { struct input_event ev[64]; int i, rd; + fd_set rdfs; - while (1) { - rd = read(fd, ev, sizeof(struct input_event) * 64); + FD_ZERO(&rdfs); + FD_SET(fd, &rdfs); + + while (!stop) { + select(fd + 1, &rdfs, NULL, NULL, NULL); + if (stop) + break; + rd = read(fd, ev, sizeof(ev)); if (rd < (int) sizeof(struct input_event)) { printf("expected %d bytes, got %d\n", (int) sizeof(struct input_event), rd); @@ -902,6 +1099,8 @@ if (type == EV_SYN) { if (code == SYN_MT_REPORT) printf("++++++++++++++ %s ++++++++++++\n", codename(type, code)); + else if (code == SYN_DROPPED) + printf(">>>>>>>>>>>>>> %s <<<<<<<<<<<<\n", codename(type, code)); else printf("-------------- %s ------------\n", codename(type, code)); } else { @@ -916,6 +1115,9 @@ } } + + ioctl(fd, EVIOCGRAB, (void*)0); + return EXIT_SUCCESS; } /** @@ -924,13 +1126,13 @@ * @param fd The file descriptor to the device. * @return 0 if the grab was successful, or 1 otherwise. */ -static int test_grab(int fd) +static int test_grab(int fd, int grab_flag) { int rc; rc = ioctl(fd, EVIOCGRAB, (void*)1); - if (!rc) + if (rc == 0 && !grab_flag) ioctl(fd, EVIOCGRAB, (void*)0); return rc; @@ -943,7 +1145,7 @@ * @param device The device to monitor, or NULL if the user should be prompted. * @return 0 on success, non-zero on error. */ -static int do_capture(const char *device) +static int do_capture(const char *device, int grab_flag) { int fd; char *filename = NULL; @@ -981,7 +1183,7 @@ printf("Testing ... (interrupt to exit)\n"); - if (test_grab(fd)) + if (test_grab(fd, grab_flag)) { printf("***********************************************\n"); printf(" This device is grabbed by another process.\n"); @@ -995,6 +1197,9 @@ printf("***********************************************\n"); } + signal(SIGINT, interrupt_handler); + signal(SIGTERM, interrupt_handler); + free(filename); return print_events(fd); @@ -1077,6 +1282,7 @@ } static const struct option long_options[] = { + { "grab", no_argument, &grab_flag, 1 }, { "query", no_argument, NULL, MODE_QUERY }, { "version", no_argument, NULL, MODE_VERSION }, { 0, }, @@ -1095,6 +1301,8 @@ if (c == -1) break; switch (c) { + case 0: + break; case MODE_QUERY: mode = c; break; @@ -1109,7 +1317,7 @@ device = argv[optind++]; if (mode == MODE_CAPTURE) - return do_capture(device); + return do_capture(device, grab_flag); if ((argc - optind) < 2) { fprintf(stderr, "Query mode requires device, type and key parameters\n"); diff -Nru evtest-1.32/evtest.txt evtest-1.33/evtest.txt --- evtest-1.32/evtest.txt 2014-08-09 20:38:22.000000000 +0000 +++ evtest-1.33/evtest.txt 2015-07-25 08:41:16.000000000 +0000 @@ -8,7 +8,7 @@ SYNOPSIS -------- - evtest /dev/input/eventX + evtest [--grab] /dev/input/eventX evtest --query /dev/input/eventX @@ -19,6 +19,10 @@ supported by the device. It then monitors the device and displays all the events layer events generated. +If the --grab flag is given in capture mode, evtest keeps an EVIOCGRAB on the +device. While this grab is active, other processes will not receive events +from the kernel devices. The grab is released again when evtest quits. + In the second invocation type ("query mode"), evtest performs a one-shot query of the state of a specific key *value* of an event *type*. diff -Nru evtest-1.32/install-sh evtest-1.33/install-sh --- evtest-1.32/install-sh 2014-08-09 20:43:43.000000000 +0000 +++ evtest-1.33/install-sh 2015-07-25 08:43:39.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-11-20.07; # UTC +scriptversion=2013-12-25.23; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -41,19 +41,15 @@ # This script is compatible with the BSD install script, but was written # from scratch. +tab=' ' nl=' ' -IFS=" "" $nl" +IFS=" $tab$nl" -# set DOITPROG to echo to test this script +# Set DOITPROG to "echo" to test this script. -# Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi +doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. @@ -68,17 +64,6 @@ rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - posix_mkdir= # Desired mode of installed file. @@ -97,7 +82,7 @@ dst_arg= copy_on_change=false -no_target_directory= +is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE @@ -137,46 +122,57 @@ -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" - shift;; + shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; -o) chowncmd="$chownprog $2" - shift;; + shift;; -s) stripcmd=$stripprog;; - -t) dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - shift;; + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; - -T) no_target_directory=true;; + -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; - --) shift - break;; + --) shift + break;; - -*) echo "$0: invalid option: $1" >&2 - exit 1;; + -*) echo "$0: invalid option: $1" >&2 + exit 1;; *) break;; esac shift done +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. @@ -208,6 +204,15 @@ fi if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 @@ -223,16 +228,16 @@ *[0-7]) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw='% 200' + u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw=,u+rw + u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac @@ -269,41 +274,15 @@ # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - + dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi @@ -314,74 +293,74 @@ if test $dstdir_status != 0; then case $posix_mkdir in '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; esac if $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else @@ -391,53 +370,51 @@ # directory the slow way, step by step, checking for races as we go. case $dstdir in - /*) prefix='/';; - [-=\(\)!]*) prefix='./';; - *) prefix='';; + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; esac - eval "$initialize_posix_glob" - oIFS=$IFS IFS=/ - $posix_glob set -f + set -f set fnord $dstdir shift - $posix_glob set +f + set +f IFS=$oIFS prefixes= for d do - test X"$d" = X && continue + test X"$d" = X && continue - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ done if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true fi fi fi @@ -472,15 +449,12 @@ # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - + set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then @@ -493,24 +467,24 @@ # to itself, or perhaps because mv is so ancient that it does not # support -f. { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 diff -Nru evtest-1.32/Makefile.in evtest-1.33/Makefile.in --- evtest-1.32/Makefile.in 2014-08-09 20:43:43.000000000 +0000 +++ evtest-1.33/Makefile.in 2015-07-25 08:43:39.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -15,7 +15,17 @@ @SET_MAKE@ VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -79,14 +89,12 @@ bin_PROGRAMS = evtest$(EXEEXT) @HAVE_DOCTOOLS_TRUE@am__append_1 = $(man_pages_src) $(man_pages) subdir = . -DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/configure $(am__configure_deps) \ - $(srcdir)/config.h.in depcomp $(dist_man_MANS) COPYING INSTALL \ - README compile install-sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d @@ -185,6 +193,9 @@ CTAGS = ctags CSCOPE = cscope AM_RECURSIVE_TARGETS = cscope +am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in \ + $(srcdir)/config.h.in COPYING INSTALL README compile depcomp \ + install-sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -321,7 +332,6 @@ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ @@ -581,15 +591,15 @@ $(am__post_remove_distdir) dist-tarZ: distdir - @echo WARNING: "Support for shar distribution archives is" \ - "deprecated." >&2 + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir - @echo WARNING: "Support for distribution archives compressed with" \ - "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) @@ -625,17 +635,17 @@ esac chmod -R a-w $(distdir) chmod u+w $(distdir) - mkdir $(distdir)/_build $(distdir)/_inst + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ - && ../configure \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ - --srcdir=.. --prefix="$$dc_install_base" \ + --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -821,6 +831,8 @@ uninstall-am uninstall-binPROGRAMS uninstall-man \ uninstall-man1 +.PRECIOUS: Makefile + @HAVE_DOCTOOLS_TRUE@.xml.1: @HAVE_DOCTOOLS_TRUE@ @$(XMLTO) man $< diff -Nru evtest-1.32/missing evtest-1.33/missing --- evtest-1.32/missing 2014-08-09 20:43:43.000000000 +0000 +++ evtest-1.33/missing 2015-07-25 08:43:39.000000000 +0000 @@ -3,7 +3,7 @@ scriptversion=2013-10-28.13; # UTC -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify