New upstream snapshot.
Debian Janitor
2 years ago
0 | 0 |
PREFIX ?= /usr/local
|
1 | 1 |
MANPREFIX ?= ${PREFIX}/man
|
2 | |
RELEASE = 5.0
|
|
2 |
RELEASE = 5.1
|
3 | 3 |
CPPFLAGS += -DRELEASE=\"${RELEASE}\"
|
4 | 4 |
|
5 | 5 |
all: versioncheck entr
|
|
0 |
= Next Release: 5.1
|
|
1 |
|
|
2 |
- Detect files moved to or from directories on Linux
|
|
3 |
- Allow detection of directory entries beginning with '.' by specifying '-d' twice
|
|
4 |
|
0 | 5 |
= Release History
|
1 | 6 |
|
2 | 7 |
== 5.0: July 2, 2021
|
|
0 |
entr (5.0+git20210813.1.a27e47c-1) UNRELEASED; urgency=low
|
|
1 |
|
|
2 |
* New upstream snapshot.
|
|
3 |
|
|
4 |
-- Debian Janitor <janitor@jelmer.uk> Wed, 10 Nov 2021 07:03:47 -0000
|
|
5 |
|
0 | 6 |
entr (5.0-1) unstable; urgency=medium
|
1 | 7 |
|
2 | 8 |
[ Yuri D'Elia ]
|
12 | 12 |
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
13 | 13 |
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
14 | 14 |
.\"
|
15 | |
.Dd July 2, 2021
|
|
15 |
.Dd August 13, 2021
|
16 | 16 |
.Dt ENTR 1
|
17 | 17 |
.Os
|
18 | 18 |
.Sh NAME
|
|
54 | 54 |
Track the directories of regular files provided as input and exit if a new file
|
55 | 55 |
is added.
|
56 | 56 |
This option also enables directories to be specified explicitly.
|
57 | |
Files with names beginning with
|
|
57 |
If specified twice, all new entries to a directory are recognized,
|
|
58 |
otherwise files with names beginning with
|
58 | 59 |
.Ql \&.
|
59 | 60 |
are ignored.
|
60 | 61 |
.It Fl n
|
30 | 30 |
#include <stdio.h>
|
31 | 31 |
#include <stdlib.h>
|
32 | 32 |
#include <string.h>
|
|
33 |
#include <termios.h>
|
33 | 34 |
#include <time.h>
|
34 | 35 |
#include <unistd.h>
|
35 | |
#include <termios.h>
|
36 | 36 |
|
37 | 37 |
#include "missing/compat.h"
|
38 | 38 |
|
|
78 | 78 |
int clear_opt;
|
79 | 79 |
int dirwatch_opt;
|
80 | 80 |
int noninteractive_opt;
|
|
81 |
int oneshot_opt;
|
81 | 82 |
int postpone_opt;
|
82 | 83 |
int restart_opt;
|
83 | 84 |
int shell_opt;
|
84 | |
int oneshot_opt;
|
85 | 85 |
struct termios canonical_tty;
|
86 | 86 |
|
87 | 87 |
/* forwards */
|
|
317 | 317 |
n_files++;
|
318 | 318 |
}
|
319 | 319 |
/* also watch the directory if it's not already in the list */
|
320 | |
if (dirwatch_opt == 1) {
|
|
320 |
if (dirwatch_opt > 0) {
|
321 | 321 |
if (S_ISDIR(sb.st_mode) != 0)
|
322 | 322 |
path = &buf[0];
|
323 | 323 |
else
|
|
350 | 350 |
if (dfd == NULL)
|
351 | 351 |
errx(1, "unable to open directory: '%s'", dir);
|
352 | 352 |
while((dp = readdir(dfd)) != NULL)
|
353 | |
if (dp->d_name[0] != '.')
|
|
353 |
if ((dirwatch_opt == 2) || (dp->d_name[0] != '.'))
|
354 | 354 |
count++;
|
355 | 355 |
closedir(dfd);
|
356 | 356 |
return count;
|
|
376 | 376 |
clear_opt = clear_opt ? 2 : 1;
|
377 | 377 |
break;
|
378 | 378 |
case 'd':
|
379 | |
dirwatch_opt = 1;
|
|
379 |
dirwatch_opt = dirwatch_opt ? 2 : 1;
|
380 | 380 |
break;
|
381 | 381 |
case 'n':
|
382 | 382 |
noninteractive_opt = 1;
|
83 | 83 |
clear_opt = 0;
|
84 | 84 |
dirwatch_opt = 0;
|
85 | 85 |
noninteractive_opt = 0;
|
|
86 |
oneshot_opt = 0;
|
86 | 87 |
postpone_opt = 0;
|
87 | 88 |
restart_opt = 0;
|
88 | 89 |
shell_opt = 0;
|
89 | |
oneshot_opt = 0;
|
90 | 90 |
|
91 | 91 |
leading_edge = 0;
|
92 | 92 |
files = calloc(max_files, sizeof(WatchFile *));
|
|
933 | 933 |
signal(SIGSEGV, sighandler);
|
934 | 934 |
|
935 | 935 |
/* set up pointers to test doubles */
|
936 | |
xstat = fake_stat;
|
|
936 |
xerrx = fake_errx;
|
|
937 |
xexecvp = fake_execvp;
|
|
938 |
xfork = fake_fork;
|
|
939 |
xfree = fake_free;
|
937 | 940 |
xkevent = fake_kevent;
|
938 | 941 |
xkillpg = fake_killpg;
|
939 | |
xwaitpid = fake_waitpid;
|
940 | |
xexecvp = fake_execvp;
|
941 | |
xfork = fake_fork;
|
|
942 |
xlist_dir = fake_list_dir;
|
942 | 943 |
xopen = fake_open;
|
943 | 944 |
xrealpath = fake_realpath;
|
944 | |
xfree = fake_free;
|
945 | |
xerrx = fake_errx;
|
|
945 |
xstat = fake_stat;
|
|
946 |
xtcsetattr = fake_tcsetattr;
|
|
947 |
xwaitpid = fake_waitpid;
|
946 | 948 |
xwarnx = fake_warnx;
|
947 | |
xlist_dir = fake_list_dir;
|
948 | |
xtcsetattr = fake_tcsetattr;
|
949 | 949 |
|
950 | 950 |
/* all tests */
|
951 | 951 |
run(process_input_01);
|
80 | 80 |
|
81 | 81 |
#define EVENT_SIZE (sizeof (struct inotify_event))
|
82 | 82 |
#define EVENT_BUF_LEN (32 * (EVENT_SIZE + 16))
|
83 | |
#define IN_ALL IN_CLOSE_WRITE|IN_DELETE_SELF|IN_MOVE_SELF|IN_ATTRIB|IN_CREATE
|
|
83 |
#define IN_ALL IN_CLOSE_WRITE|IN_DELETE_SELF|IN_MOVE_SELF|IN_MOVED_TO|IN_MOVED_FROM|IN_ATTRIB|IN_CREATE
|
84 | 84 |
|
85 | 85 |
/*
|
86 | 86 |
* inotify and kqueue ids both have the type `int`
|
|
191 | 191 |
if (iev->mask & IN_CLOSE_WRITE) fflags |= NOTE_WRITE;
|
192 | 192 |
if (iev->mask & IN_CREATE) fflags |= NOTE_WRITE;
|
193 | 193 |
if (iev->mask & IN_MOVE_SELF) fflags |= NOTE_RENAME;
|
|
194 |
if (iev->mask & IN_MOVED_TO) fflags |= NOTE_RENAME;
|
|
195 |
if (iev->mask & IN_MOVED_FROM) fflags |= NOTE_RENAME;
|
194 | 196 |
if (iev->mask & IN_ATTRIB) fflags |= NOTE_ATTRIB;
|
195 | 197 |
if (getenv("ENTR_INOTIFY_WORKAROUND"))
|
196 | 198 |
if (iev->mask & IN_MODIFY) fflags |= NOTE_WRITE;
|
172 | 172 |
assert "$(cat $tmp/exec.out)" "ping"
|
173 | 173 |
assert "$(cat $tmp/exec.err)" "entr: directory altered"
|
174 | 174 |
rmdir $tmp/newdir
|
|
175 |
|
|
176 |
try "exec single shell utility and exit when a hidden subdirectory is added"
|
|
177 |
setup
|
|
178 |
ls -d $tmp | ./entr -ddp sh -c 'echo ping' >$tmp/exec.out 2>$tmp/exec.err \
|
|
179 |
|| true &
|
|
180 |
bgpid=$! ; zz
|
|
181 |
mkdir $tmp/.newdir
|
|
182 |
wait $bgpid || assert "$?" "130"
|
|
183 |
assert "$(cat $tmp/exec.out)" "ping"
|
|
184 |
assert "$(cat $tmp/exec.err)" "entr: directory altered"
|
|
185 |
rmdir $tmp/.newdir
|
175 | 186 |
|
176 | 187 |
try "exec single shell utility and exit when a file is added to a specific path"
|
177 | 188 |
setup
|