[ Yuri D'Elia ]
[ Debian Janitor ]
New upstream release.
Debian Janitor
2 years ago
0 | 0 | PREFIX ?= /usr/local |
1 | 1 | MANPREFIX ?= ${PREFIX}/man |
2 | RELEASE = 4.8 | |
2 | RELEASE = 4.9 | |
3 | 3 | CPPFLAGS += -DRELEASE=\"${RELEASE}\" |
4 | 4 | |
5 | 5 | all: versioncheck entr |
0 | 0 | = Release History |
1 | ||
2 | == 4.9: May 3, 2021 | |
3 | ||
4 | - EV_TRACE also prints file/notify descriptor limit | |
5 | - Don't raise rlim_cur on MacOS | |
6 | - Set 2^16 watches if inotify limits cannot be read | |
7 | - Raise an error and suggest '-n' if terminal attributes cannot be read | |
1 | 8 | |
2 | 9 | == 4.8: February 26, 2021 |
3 | 10 |
35 | 35 | |
36 | 36 | Launch and auto-reload a node.js server: |
37 | 37 | |
38 | $ find . -name '*.js' | entr -r node app.js | |
38 | $ ls *.js | entr -r node app.js | |
39 | 39 | |
40 | 40 | Clear the screen and run a query after the SQL script is updated: |
41 | 41 | |
42 | $ echo my.sql | entr -p psql -f /_ | |
42 | $ echo my.sql | entr -cp psql -f /_ | |
43 | 43 | |
44 | 44 | Rebuild project if a source file is modified or added to the src/ directory: |
45 | 45 | |
46 | $ while sleep 0.1; do find src -name '*.rb' | entr -d make; done | |
46 | $ while sleep 0.1; do ls src/*.rb | entr -d make; done | |
47 | 47 | |
48 | Self-terminate after a file is updated | |
48 | Auto-reload a web server, or terminate if the server exits | |
49 | 49 | |
50 | $ find . -type f | entr -p 'kill $PPID' | |
50 | $ ls * | entr -rz ./httpd | |
51 | 51 | |
52 | 52 | News |
53 | 53 | ---- |
0 | entr (4.8-1) UNRELEASED; urgency=medium | |
0 | entr (4.9-1) UNRELEASED; urgency=medium | |
1 | 1 | |
2 | [ Yuri D'Elia ] | |
2 | 3 | * New upstream version 4.8: |
3 | 4 | - Use control sequences to clear the display and specify '-c' twice to erase |
4 | 5 | the scrollback buffer |
5 | 6 | |
6 | -- Yuri D'Elia <wavexx@thregr.org> Fri, 02 Apr 2021 17:54:54 +0200 | |
7 | [ Debian Janitor ] | |
8 | * New upstream release. | |
9 | ||
10 | -- Yuri D'Elia <wavexx@thregr.org> Sat, 05 Jun 2021 06:52:25 -0000 | |
7 | 11 | |
8 | 12 | entr (4.7-1) unstable; urgency=medium |
9 | 13 |
105 | 105 | int |
106 | 106 | main(int argc, char *argv[]) { |
107 | 107 | struct rlimit rl; |
108 | rlim_t max_watches; | |
109 | 108 | int kq; |
110 | 109 | struct sigaction act; |
111 | 110 | int ttyfd; |
113 | 112 | int n_files; |
114 | 113 | int i; |
115 | 114 | struct kevent evSet; |
116 | long open_max; | |
115 | unsigned open_max; | |
117 | 116 | |
118 | 117 | if ((*test_runner_main)) |
119 | 118 | return(test_runner_main(argc, argv)); |
158 | 157 | if (sigaction(SIGCHLD, &act, NULL) != 0) |
159 | 158 | err(1, "Failed to set SIGCHLD handler"); |
160 | 159 | |
161 | getrlimit(RLIMIT_NOFILE, &rl); | |
162 | ||
163 | 160 | #if defined(_LINUX_PORT) |
164 | max_watches = (rlim_t)fs_sysctl(INOTIFY_MAX_USER_WATCHES); | |
165 | if(max_watches > 0) { | |
166 | rl.rlim_cur = max_watches; | |
167 | open_max = max_watches; | |
168 | goto rlim_set; | |
169 | } | |
170 | #endif | |
171 | /* raise soft limit */ | |
172 | open_max = min(sysconf(_SC_OPEN_MAX), (long)rl.rlim_max); | |
173 | if (open_max == -1) | |
174 | err(1, "_SC_OPEN_MAX"); | |
175 | ||
176 | open_max = min(524288, open_max); /* guard against unrealistic replies */ | |
177 | ||
161 | /* attempt to read inotify limits */ | |
162 | open_max = (unsigned)fs_sysctl(INOTIFY_MAX_USER_WATCHES); | |
163 | if (open_max == 0) | |
164 | open_max = 65536; | |
165 | #elif defined(_MACOS_PORT) | |
166 | /* guard against unrealistic replies */ | |
167 | open_max = min(65536, (unsigned)rl.rlim_cur); | |
168 | if (open_max == 0) | |
169 | open_max = 65536; | |
170 | #else /* BSD */ | |
171 | if (getrlimit(RLIMIT_NOFILE, &rl) == -1) | |
172 | err(1, "getrlimit"); | |
173 | open_max = (unsigned)rl.rlim_max; | |
178 | 174 | rl.rlim_cur = (rlim_t)open_max; |
179 | 175 | if (setrlimit(RLIMIT_NOFILE, &rl) != 0) |
180 | err(1, "setrlimit cannot set rlim_cur to %ld", open_max); | |
181 | ||
182 | rlim_set: | |
176 | err(1, "setrlimit cannot set rlim_cur to %u", open_max); | |
177 | #endif | |
178 | ||
179 | if (getenv("EV_TRACE")) | |
180 | fprintf(stderr, "open_max: %d\n", open_max); | |
183 | 181 | |
184 | 182 | /* prevent interactive utilities from paging output */ |
185 | 183 | setenv("PAGER", "/bin/cat", 0); |
203 | 201 | errx(1, "No regular files to watch"); |
204 | 202 | if (n_files == -1) |
205 | 203 | errx(1, "Too many files listed; the hard limit for your login" |
206 | " class is %ld. Please consult" | |
204 | " class is %u. Please consult" | |
207 | 205 | " http://eradman.com/entrproject/limits.html", open_max); |
208 | 206 | for (i=0; i<n_files; i++) |
209 | 207 | watch_file(kq, files[i]); |
218 | 216 | } |
219 | 217 | |
220 | 218 | /* remember terminal settings */ |
221 | tcgetattr(STDIN_FILENO, &canonical_tty); | |
219 | if (tcgetattr(STDIN_FILENO, &canonical_tty) == -1) | |
220 | errx(1, "unable to get terminal attributes, use '-n' to run non-interactively"); | |
222 | 221 | |
223 | 222 | /* Use keyboard input as a trigger */ |
224 | 223 | EV_SET(&evSet, STDIN_FILENO, EVFILT_READ, EV_ADD, NOTE_LOWAT, 1, NULL); |
260 | 259 | void |
261 | 260 | handle_exit(int sig) { |
262 | 261 | if (!noninteractive_opt) |
263 | xtcsetattr(0, TCSADRAIN, &canonical_tty); | |
262 | xtcsetattr(STDIN_FILENO, TCSADRAIN, &canonical_tty); | |
264 | 263 | terminate_utility(); |
265 | 264 | if ((sig == SIGINT || sig == SIGHUP)) |
266 | 265 | exit(0); |
600 | 599 | |
601 | 600 | main: |
602 | 601 | if (!noninteractive_opt) |
603 | xtcsetattr(0, TCSADRAIN, &character_tty); | |
602 | xtcsetattr(STDIN_FILENO, TCSADRAIN, &character_tty); | |
604 | 603 | if ((reopen_only == 1) || (collate_only == 1)) { |
605 | 604 | nev = xkevent(kq, NULL, 0, evList, 32, &evTimeout); |
606 | 605 | } |
639 | 638 | dir_modified += compare_dir_contents(file); |
640 | 639 | } |
641 | 640 | if (!noninteractive_opt) |
642 | xtcsetattr(0, TCSADRAIN, &canonical_tty); | |
641 | xtcsetattr(STDIN_FILENO, TCSADRAIN, &canonical_tty); | |
643 | 642 | |
644 | 643 | collate_only = 0; |
645 | 644 | for (i=0; i<nev; i++) { |
220 | 220 | fi |
221 | 221 | |
222 | 222 | try "exec single utility when an entire stash of files is reverted" |
223 | setup | |
224 | cp /usr/include/*.h $tmp/ | |
225 | cd $tmp | |
226 | git init -q | |
227 | git add *.h | |
228 | git commit -m "initial checkin" -q | |
229 | for f in `ls *.h | head`; do | |
230 | chmod 644 $f | |
231 | echo "" >> $f | |
232 | done | |
233 | cd - > /dev/null ; zz | |
234 | ls $tmp/*.h | ./entr -p echo "changed" > $tmp/exec.out & | |
235 | bgpid=$! ; zz | |
236 | cd $tmp | |
237 | git checkout *.h -q | |
238 | cd - > /dev/null ; zz | |
239 | kill -INT $bgpid | |
240 | wait $bgpid || assert "$?" "130" | |
241 | assert "$(cat $tmp/exec.out)" "changed" | |
223 | if [ ! -d /usr/include ]; then | |
224 | skip "Operating system does not include files in a standard location" | |
225 | else | |
226 | setup | |
227 | cp /usr/include/*.h $tmp/ | |
228 | cd $tmp | |
229 | git init -q | |
230 | git add *.h | |
231 | git commit -m "initial checkin" -q | |
232 | for f in `ls *.h | head`; do | |
233 | chmod 644 $f | |
234 | echo "" >> $f | |
235 | done | |
236 | cd - > /dev/null ; zz | |
237 | ls $tmp/*.h | ./entr -p echo "changed" > $tmp/exec.out & | |
238 | bgpid=$! ; zz | |
239 | cd $tmp | |
240 | git checkout *.h -q | |
241 | cd - > /dev/null ; zz | |
242 | kill -INT $bgpid | |
243 | wait $bgpid || assert "$?" "130" | |
244 | assert "$(cat $tmp/exec.out)" "changed" | |
245 | fi | |
242 | 246 | |
243 | 247 | try "exec utility when a file is written by Vim" |
244 | 248 | setup |