Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package entr for openSUSE:Factory checked in at 2022-05-07 23:54:26 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/entr (Old) and /work/SRC/openSUSE:Factory/.entr.new.1538 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "entr" Sat May 7 23:54:26 2022 rev:12 rq:975551 version:5.2 Changes: -------- --- /work/SRC/openSUSE:Factory/entr/entr.changes 2021-12-29 21:11:32.430314328 +0100 +++ /work/SRC/openSUSE:Factory/.entr.new.1538/entr.changes 2022-05-07 23:54:30.044923970 +0200 @@ -1,0 +2,10 @@ +Sat May 7 13:18:32 UTC 2022 - Martin Hauke <[email protected]> + +- Update to version 5.2 + * Update copy of strlcpy(3) for Linux + * Detect file deletion from directories on Linux + * Print the signal that terminated a child when using '-s' + * Return 128+signal that terminated a child when using '-z' + * Ensure terminal settings are reset when '-z' is set + +------------------------------------------------------------------- Old: ---- entr-5.1.tar.gz entr-5.1.tar.gz.sig New: ---- entr-5.2.tar.gz entr-5.2.tar.gz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ entr.spec ++++++ --- /var/tmp/diff_new_pack.YvTJSg/_old 2022-05-07 23:54:30.604924671 +0200 +++ /var/tmp/diff_new_pack.YvTJSg/_new 2022-05-07 23:54:30.604924671 +0200 @@ -1,7 +1,7 @@ # # spec file for package entr # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # Copyright (c) 2016 Daniel Lichtenberger # # All modifications and additions to the file contributed by third parties @@ -18,7 +18,7 @@ Name: entr -Version: 5.1 +Version: 5.2 Release: 0 Summary: A utility for running arbitrary commands when files change License: ISC ++++++ entr-5.1.tar.gz -> entr-5.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/entr-5.1/Makefile.bsd new/entr-5.2/Makefile.bsd --- old/entr-5.1/Makefile.bsd 2021-12-28 03:16:20.000000000 +0100 +++ new/entr-5.2/Makefile.bsd 2022-05-05 17:18:45.000000000 +0200 @@ -1,6 +1,6 @@ PREFIX ?= /usr/local MANPREFIX ?= ${PREFIX}/man -RELEASE = 5.1 +RELEASE = 5.2 CPPFLAGS += -DRELEASE=\"${RELEASE}\" all: versioncheck entr diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/entr-5.1/NEWS new/entr-5.2/NEWS --- old/entr-5.1/NEWS 2021-12-28 03:16:20.000000000 +0100 +++ new/entr-5.2/NEWS 2022-05-05 17:18:45.000000000 +0200 @@ -1,5 +1,13 @@ = Release History +== 5.2: May 05, 2022 + + - Update copy of strlcpy(3) for Linux + - Detect file deletion from directories on Linux + - Print the signal that terminated a child when using '-s' + - Return 128+signal that terminated a child when using '-z' + - Ensure terminal settings are reset when '-z' is set + == 5.1: December 28, 2021 - Detect files moved to or from directories on Linux diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/entr-5.1/entr.1 new/entr-5.2/entr.1 --- old/entr-5.1/entr.1 2021-12-28 03:16:20.000000000 +0100 +++ new/entr-5.2/entr.1 2022-05-05 17:18:45.000000000 +0200 @@ -13,7 +13,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd August 13, 2021 +.Dd May 5, 2022 .Dt ENTR 1 .Os .Sh NAME @@ -146,9 +146,10 @@ .Fl z flag is set and the .Ar utility -is successfully executed, the status of the child process is -returned. -Otherwise +is successfully executed, the status of the child process is returned. +If the child process was terminated by a signal, the exit status is the signal +number plus 128. +.Pp .Nm normally returns one of the following values: .Pp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/entr-5.1/entr.c new/entr-5.2/entr.c --- old/entr-5.1/entr.c 2021-12-28 03:16:20.000000000 +0100 +++ new/entr-5.2/entr.c 2022-05-05 17:18:45.000000000 +0200 @@ -72,7 +72,7 @@ WatchFile **files; WatchFile *leading_edge; int child_pid; -int child_exitstatus; +int child_status; int terminating; int aggressive_opt; @@ -93,6 +93,7 @@ static void terminate_utility(); static void handle_exit(int sig); static void proc_exit(int sig); +static void print_child_status(int status); static int process_input(FILE *, WatchFile *[], int); static int set_options(char *[]); static int list_dir(char *); @@ -251,8 +252,7 @@ if (child_pid > 0) { xkillpg(child_pid, SIGTERM); - if (xwaitpid(child_pid, &status, 0) > 0) - child_exitstatus = WEXITSTATUS(status); + xwaitpid(child_pid, &status, 0); child_pid = 0; } @@ -265,7 +265,9 @@ handle_exit(int sig) { if ((!noninteractive_opt) && (termios_set)) xtcsetattr(STDIN_FILENO, TCSADRAIN, &canonical_tty); + terminate_utility(); + if ((sig == SIGINT || sig == SIGHUP)) exit(0); else @@ -276,17 +278,32 @@ proc_exit(int sig) { int status; - if (wait(&status) > 0) - child_exitstatus = WEXITSTATUS(status); + if ((!noninteractive_opt) && (termios_set)) + xtcsetattr(STDIN_FILENO, TCSADRAIN, &canonical_tty); + + if (wait(&status) != -1) + child_status = status; + if ((oneshot_opt == 1) && (terminating == 0)) { - if ((shell_opt == 1) && (restart_opt == 0)) { - fprintf(stdout, "%s returned exit code %d\n", - basename(getenv("SHELL")), child_exitstatus); - } - exit(child_exitstatus); + if ((shell_opt == 1) && (restart_opt == 0)) + print_child_status(child_status); + + if WIFSIGNALED(child_status) + exit(128 + WTERMSIG(child_status)); + else + exit(WEXITSTATUS(child_status)); } } +void +print_child_status(int status) { + if WIFSIGNALED(status) + fprintf(stdout, "%s terminated by signal %d\n", + basename(getenv("SHELL")), WTERMSIG(status)); + else + fprintf(stdout, "%s returned exit code %d\n", + basename(getenv("SHELL")), WEXITSTATUS(status)); +} /* * Read lines from a file stream (normally STDIN). Returns the number of @@ -492,15 +509,12 @@ } child_pid = pid; - if (restart_opt == 0) { - if (xwaitpid(pid, &status, 0) > 0) - child_exitstatus = WEXITSTATUS(status); - if (shell_opt == 1) - fprintf(stdout, "%s returned exit code %d\n", - basename(getenv("SHELL")), child_exitstatus); + if (restart_opt == 0 && oneshot_opt == 0) { + if (wait(&status) != -1) + child_status = status; - if (oneshot_opt == 1) - exit(child_exitstatus); + if (shell_opt == 1) + print_child_status(child_status); } xfree(arg_buf); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/entr-5.1/entr_spec.c new/entr-5.2/entr_spec.c --- old/entr-5.1/entr_spec.c 2021-12-28 03:16:20.000000000 +0100 +++ new/entr-5.2/entr_spec.c 2022-05-05 17:18:45.000000000 +0200 @@ -806,6 +806,7 @@ argv_offset = set_options(argv); + ok(argv_offset == 2); ok(clear_opt == 2); return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/entr-5.1/missing/compat.h new/entr-5.2/missing/compat.h --- old/entr-5.1/missing/compat.h 2021-12-28 03:16:20.000000000 +0100 +++ new/entr-5.2/missing/compat.h 2022-05-05 17:18:45.000000000 +0200 @@ -6,7 +6,7 @@ #if defined(_LINUX_PORT) && defined(__GLIBC__) #include <sys/types.h> -size_t strlcpy(char *to, const char *from, int l); +size_t strlcpy(char *dst, const char *src, size_t dsize); #endif #if defined(_LINUX_PORT) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/entr-5.1/missing/kqueue_inotify.c new/entr-5.2/missing/kqueue_inotify.c --- old/entr-5.1/missing/kqueue_inotify.c 2021-12-28 03:16:20.000000000 +0100 +++ new/entr-5.2/missing/kqueue_inotify.c 2022-05-05 17:18:45.000000000 +0200 @@ -81,7 +81,7 @@ #define EVENT_SIZE (sizeof (struct inotify_event)) #define EVENT_BUF_LEN (32 * (EVENT_SIZE + 16)) -#define IN_ALL IN_CLOSE_WRITE|IN_DELETE_SELF|IN_MOVE_SELF|IN_MOVED_TO|IN_MOVED_FROM|IN_ATTRIB|IN_CREATE +#define IN_ALL IN_CLOSE_WRITE|IN_DELETE_SELF|IN_MOVE_SELF|IN_MOVE|IN_ATTRIB|IN_CREATE|IN_DELETE /* * inotify and kqueue ids both have the type `int` @@ -191,6 +191,7 @@ if (iev->mask & IN_DELETE_SELF) fflags |= NOTE_DELETE; if (iev->mask & IN_CLOSE_WRITE) fflags |= NOTE_WRITE; if (iev->mask & IN_CREATE) fflags |= NOTE_WRITE; + if (iev->mask & IN_DELETE) fflags |= NOTE_WRITE; if (iev->mask & IN_MOVE_SELF) fflags |= NOTE_RENAME; if (iev->mask & IN_MOVED_TO) fflags |= NOTE_RENAME; if (iev->mask & IN_MOVED_FROM) fflags |= NOTE_RENAME; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/entr-5.1/missing/strlcpy.c new/entr-5.2/missing/strlcpy.c --- old/entr-5.1/missing/strlcpy.c 2021-12-28 03:16:20.000000000 +0100 +++ new/entr-5.2/missing/strlcpy.c 2022-05-05 17:18:45.000000000 +0200 @@ -1,7 +1,7 @@ -/* $OpenBSD: strlcpy.c,v 1.11 2006/05/05 15:27:38 millert Exp $ */ +/* $OpenBSD: strlcpy.c,v 1.16 2019/01/25 00:19:25 millert Exp $ */ /* - * Copyright (c) 1998 Todd C. Miller <[email protected]> + * Copyright (c) 1998, 2015 Todd C. Miller <[email protected]> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -20,32 +20,31 @@ #include <string.h> /* - * Copy src to string dst of size siz. At most siz-1 characters - * will be copied. Always NUL terminates (unless siz == 0). - * Returns strlen(src); if retval >= siz, truncation occurred. + * Copy string src to buffer dst of size dsize. At most dsize-1 + * chars will be copied. Always NUL terminates (unless dsize == 0). + * Returns strlen(src); if retval >= dsize, truncation occurred. */ size_t -strlcpy(char *dst, const char *src, size_t siz) +strlcpy(char *dst, const char *src, size_t dsize) { - char *d = dst; - const char *s = src; - size_t n = siz; - - /* Copy as many bytes as will fit */ - if (n != 0) { - while (--n != 0) { - if ((*d++ = *s++) == '\0') + const char *osrc = src; + size_t nleft = dsize; + + /* Copy as many bytes as will fit. */ + if (nleft != 0) { + while (--nleft != 0) { + if ((*dst++ = *src++) == '\0') break; } } - /* Not enough room in dst, add NUL and traverse rest of src */ - if (n == 0) { - if (siz != 0) - *d = '\0'; /* NUL-terminate dst */ - while (*s++) + /* Not enough room in dst, add NUL and traverse rest of src. */ + if (nleft == 0) { + if (dsize != 0) + *dst = '\0'; /* NUL-terminate dst */ + while (*src++) ; } - return(s - src - 1); /* count does not include NUL */ + return(src - osrc - 1); /* count does not include NUL */ } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/entr-5.1/system_test.sh new/entr-5.2/system_test.sh --- old/entr-5.1/system_test.sh 2021-12-28 03:16:20.000000000 +0100 +++ new/entr-5.2/system_test.sh 2022-05-05 17:18:45.000000000 +0200 @@ -16,9 +16,6 @@ # test runner -trap 'printf "$0: exit code $? on line $LINENO\nFAIL: $this\n"; exit 1' ERR \ - 2> /dev/null || exec bash $0 "$@" -typeset -i tests=0 function try { let tests+=1; this="$1"; } function assert { @@ -95,24 +92,36 @@ try "exec a command using one-shot option" setup - ls $tmp/file* | ./entr -zp cat $tmp/file2 >$tmp/exec.out 2>$tmp/exec.err & + ls $tmp/file2 | ./entr -zp cat $tmp/file2 >$tmp/exec.out 2>$tmp/exec.err & bgpid=$! ; zz echo 456 >> $tmp/file2 ; zz - wait $bgpid || assert "$?" "0" + wait $bgpid; assert "$?" "0" assert "$(cat $tmp/exec.err)" "" assert "$(head -n1 $tmp/exec.out)" "$(printf '456\n')" +try "exec a command using one-shot option and return signal number" + setup + ls $tmp/file2 | ./entr -z sh -c 'kill -9 $$' >$tmp/exec.out 2>$tmp/exec.err + assert "$?" "137" + assert "$(cat $tmp/exec.err)" "" + assert "$(cat $tmp/exec.out)" "" + +try "exec a command using one-shot and shell options and return signal" + setup + ls $tmp/file2 | ./entr -z -s 'kill -9 $$' >$tmp/exec.out 2>$tmp/exec.err + assert "$?" "137" + assert "$(tail -c23 $tmp/exec.out)" "$(printf "terminated by signal 9\n")" + try "fail to exec a command using one-shot option" setup - ls $tmp/file* | ./entr -z /usr/bin/false_X >$tmp/exec.out 2>$tmp/exec.err & - bgpid=$! ; zz - wait $bgpid || assert "$?" "1" + ls $tmp/file* | ./entr -z /usr/bin/false_X 2>$tmp/exec.err + assert "$?" "1" try "exec a command using one-shot option exit code from child" setup ls $tmp/file* | ./entr -z sh -c 'exit 4' & bgpid=$! ; zz - wait $bgpid || assert "$?" "4" + wait $bgpid; assert "$?" "4" try "restart a server when a file is modified using one-shot option" setup @@ -125,7 +134,7 @@ echo "123" | nc -U $tmp/nc.s } ; zz echo 456 >> $tmp/file2 ; zz - wait $bgpid || assert "$?" "130" + wait $bgpid; assert "$?" "0" assert "$(cat $tmp/exec.out)" "123" fi @@ -134,7 +143,7 @@ ls $tmp/file* | ./entr -n tty >$tmp/exec.out & bgpid=$! ; zz kill -INT $bgpid - wait $bgpid || assert "$?" "130" + wait $bgpid; assert "$?" "0" assert "$(cat $tmp/exec.out)" "not a tty" try "exec a command as a background task and ensure stdin is closed" @@ -142,7 +151,7 @@ ls $tmp/file* | ./entr -r sh -c 'test -t 0; echo $?; kill $$' >$tmp/exec.out & bgpid=$! ; zz kill -INT $bgpid - wait $bgpid || assert "$?" "130" + wait $bgpid; assert "$?" "0" assert "$(cat $tmp/exec.out)" "1" try "exec a command as a background task, and verify that read from stdin doesn't complain" @@ -150,7 +159,7 @@ ls $tmp/file* | ./entr -r sh -c 'read X' 2>$tmp/exec.err & bgpid=$! ; zz kill -INT $bgpid - wait $bgpid || assert "$?" "130" + wait $bgpid; assert "$?" "0" assert "$(cat $tmp/exec.err)" "" try "exec single shell utility and exit when a file is added to an implicit watch path" @@ -159,7 +168,7 @@ || true & bgpid=$! ; zz touch $tmp/newfile - wait $bgpid || assert "$?" "130" + wait $bgpid; assert "$?" "0" assert "$(cat $tmp/exec.out)" "ping" assert "$(cat $tmp/exec.err)" "entr: directory altered" @@ -169,7 +178,7 @@ || true & bgpid=$! ; zz mkdir $tmp/newdir - wait $bgpid || assert "$?" "130" + wait $bgpid; assert "$?" "0" assert "$(cat $tmp/exec.out)" "ping" assert "$(cat $tmp/exec.err)" "entr: directory altered" rmdir $tmp/newdir @@ -180,7 +189,7 @@ || true & bgpid=$! ; zz mkdir $tmp/.newdir - wait $bgpid || assert "$?" "130" + wait $bgpid; assert "$?" "0" assert "$(cat $tmp/exec.out)" "ping" assert "$(cat $tmp/exec.err)" "entr: directory altered" rmdir $tmp/.newdir @@ -191,7 +200,7 @@ || true & bgpid=$! ; zz touch $tmp/newfile - wait $bgpid || assert "$?" "130" + wait $bgpid; assert "$?" "0" assert "$(cat $tmp/exec.out)" "ping" assert "$(cat $tmp/exec.err)" "entr: directory altered" @@ -201,7 +210,7 @@ bgpid=$! ; zz echo "123" > $tmp/file1 kill -INT $bgpid - wait $bgpid || assert "$?" "130" + wait $bgpid; assert "$?" "0" assert "$(cat $tmp/exec.out)" "" assert "$(cat $tmp/exec.err)" "" @@ -213,7 +222,7 @@ -c ":r!date" \ -c ":wq" $tmp/file1 ; zz kill -INT $bgpid - wait $bgpid || assert "$?" "130" + wait $bgpid; assert "$?" "0" assert "$(cat $tmp/exec.out)" "changed" assert "$(cat $tmp/exec.err)" "" @@ -224,7 +233,7 @@ bgpid=$! ; zz : > $tmp/file1 ; zz kill -INT $bgpid - wait $bgpid || assert "$?" "130" + wait $bgpid; assert "$?" "0" if [ $(uname | egrep 'Darwin|FreeBSD|DragonFly') ]; then skip "NOTE_TRUNCATE not supported" else @@ -252,7 +261,7 @@ git checkout *.h -q cd - > /dev/null ; zz kill -INT $bgpid - wait $bgpid || assert "$?" "130" + wait $bgpid; assert "$?" "0" assert "$(cat $tmp/exec.out)" "changed" fi @@ -264,7 +273,7 @@ -c ":r!date" \ -c ":wq" $tmp/file1 ; zz kill -INT $bgpid - wait $bgpid || assert "$?" "130" + wait $bgpid; assert "$?" "0" assert "$(cat $tmp/exec.out)" "changed" try "exec shell utility when a file is written by Vim with 'backup'" @@ -276,7 +285,7 @@ -c ":r!date" \ -c ":wq" $tmp/file1 ; zz kill -INT $bgpid - wait $bgpid || assert "$?" "130" + wait $bgpid; assert "$?" "0" assert "$(cat $tmp/exec.out)" "changed" try "exec shell utility when a file is written by Vim with 'nowritebackup'" @@ -288,7 +297,7 @@ -c ":r!date" \ -c ":wq" $tmp/file1 ; zz kill -INT $bgpid - wait $bgpid || assert "$?" "130" + wait $bgpid; assert "$?" "0" assert "$(cat $tmp/exec.out)" "changed" try "restart a server when a file is modified" @@ -299,7 +308,7 @@ assert "$(cat $tmp/exec.out)" "started." echo 456 >> $tmp/file2 ; zz kill -INT $bgpid - wait $bgpid || assert "$?" "130" + wait $bgpid; assert "$?" "0" assert "$(cat $tmp/exec.out)" "$(printf 'started.\nstarted.')" try "ensure that all shell subprocesses are terminated in restart mode" @@ -336,7 +345,7 @@ assert "$(cat $tmp/exec.out)" "started." touch $tmp/newfile kill -INT $bgpid - wait $bgpid || assert "$?" "130" + wait $bgpid; assert "$?" "0" assert "$(cat $tmp/exec.out)" "$(printf 'started.')" try "exec single shell utility when two files change simultaneously" @@ -346,7 +355,7 @@ bgpid=$! ; zz echo 456 >> $tmp/file1 ; zz kill -INT $bgpid - wait $bgpid || assert "$?" "130" + wait $bgpid; assert "$?" "0" assert "$(cat $tmp/exec.out)" "ping" try "exec single shell utility on startup and when a file is changed" @@ -355,7 +364,7 @@ bgpid=$! ; zz echo 456 >> $tmp/file1 ; zz kill -INT $bgpid - wait $bgpid || assert "$?" "130" + wait $bgpid; assert "$?" "0" assert "$(cat $tmp/exec.out)" "pingping" try "exec a command if a file is made executable" @@ -364,7 +373,7 @@ bgpid=$! ; zz chmod +x $tmp/file2 ; zz kill -INT $bgpid - wait $bgpid || assert "$?" "130" + wait $bgpid; assert "$?" "0" assert "$(cat $tmp/exec.out)" "$tmp/file2" try "ensure watches operate on a running executable" @@ -375,7 +384,7 @@ bgpid=$! ; zz cp -f /bin/sleep $tmp/ ; zz kill -INT $bgpid - wait $bgpid || assert "$?" "130" + wait $bgpid; assert "$?" "0" rm -f $tmp/sleep assert "$(cat $tmp/exec.out)" "$(printf 'vroom\nvroom\n')" @@ -385,7 +394,7 @@ bgpid=$! ; zz echo 456 > $tmp/file1 ; zz kill -INT $bgpid - wait $bgpid || assert "$?" "130" + wait $bgpid; assert "$?" "0" assert "$(cat $tmp/exec.out)" "456" try "exec single shell utility using utility substitution" @@ -394,7 +403,7 @@ bgpid=$! ; zz echo 456 >> $tmp/file2; zz kill -INT $bgpid - wait $bgpid || assert "$?" "130" + wait $bgpid; assert "$?" "0" assert "$(cat $tmp/exec.out)" "$tmp/file2: ASCII text" try "watch and exec a program that is overwritten" @@ -407,7 +416,7 @@ echo vroom EOF zz ; kill -INT $bgpid - wait $bgpid || assert "$?" "130" + wait $bgpid; assert "$?" "0" assert "$(cat $tmp/exec.out)" "vroom" try "exec an interactive utility when a file changes" @@ -416,7 +425,7 @@ bgpid=$! ; zz echo 456 >> $tmp/file2 ; zz kill -INT $bgpid - wait $bgpid || assert "$?" "130" + wait $bgpid; assert "$?" "0" if ! test -t 0 ; then skip "A TTY is not available" else @@ -429,7 +438,7 @@ bgpid=$! ; zz echo 456 >> $tmp/file2 ; zz kill -INT $bgpid - wait $bgpid || assert "$?" "130" + wait $bgpid; assert "$?" "0" assert "$(cat $tmp/exec.err)" "" assert "$(head -n1 $tmp/exec.out)" "$(printf ${tmp}'/file2: ASCII text')" @@ -450,7 +459,7 @@ echo "123" > $tmp/file1 sleep 1 kill -INT $bgpid - wait $bgpid || assert "$?" "130" + wait $bgpid; assert "$?" "0" assert "$(cat $tmp/exec.out)" "$(printf 'vroom\nvroom\n')" try "ensure that all subprocesses are terminated in restart mode when a file is removed"
