IEEE 802.15.4 subsystem
Sign in or create your account | Project List | Help
IEEE 802.15.4 subsystem Commit Details
Date: | 2010-08-29 08:41:54 (13 years 6 months ago) |
---|---|
Author: | Werner Almesberger |
Commit: | cfbdd4532333f1851e0f4dd71cb54f7aebd05e6c |
Message: | Despite trying to be careful with quoting, some spaces in file names
still did upset things. - scripts/schhist2web: backticks in command invocation need quoting - scripts/schhist2web: the change below needs a bashism, so we switch from /bin/sh to /bin/bash - scripts/schhist2web: seems that there's no safe way to use ls -1 in the word list of "for". Use while read ...; ... done < <(ls -1) instead. (We couldn't just pipe this into the while loop, because that would put the loop into a subshell and changes to global variables would thus be lost.) |
Files: |
scripts/schhist2web (7 diffs) |
Change Details
scripts/schhist2web | ||
---|---|---|
1 | #!/bin/sh | |
1 | #!/bin/bash | |
2 | 2 | # |
3 | 3 | # schhist2web - Web-browseable graphical revision history of schematics |
4 | 4 | # |
... | ... | |
208 | 208 | if [ ! -z "$head" ]; then |
209 | 209 | prev="$cache/ppm_$head"/`basename "$m"` |
210 | 210 | if [ -r "$prev" ] && cmp -s "$prev" "$m"; then |
211 | symlink "../ppm_$head"/`basename "$m"` "$m" | |
212 | symlink "../fat_$head"/`basename "$m"` \ | |
213 | "$cache/fat_$n"/`basename "$m"` | |
211 | symlink "../ppm_$head/`basename \"$m\"`" "$m" | |
212 | symlink "../fat_$head/`basename \"$m\"`" \ | |
213 | "$cache/fat_$n/`basename \"$m\"`" | |
214 | 214 | fi |
215 | 215 | fi |
216 | touch "$out/names/"`basename "$m" .ppm` | |
216 | touch "$out/names/`basename \"$m\" .ppm`" | |
217 | 217 | done |
218 | 218 | trap 0 |
219 | 219 | head=$n |
... | ... | |
249 | 249 | <TABLE bgcolor="$BG_COLOR" callpadding=1> |
250 | 250 | <TR bgcolor="$FNAME_COLOR"> |
251 | 251 | EOF |
252 | for m in `ls -1 "$out/names"`; do | |
252 | while read m; do | |
253 | 253 | echo "<TD><B>$m</B>" |
254 | done | |
254 | done < <(ls -1 "$out/names") | |
255 | 255 | } >"$index" |
256 | 256 | |
257 | 257 | |
... | ... | |
264 | 264 | empty=true |
265 | 265 | s="<TR>" |
266 | 266 | mkdir -p "$out/diff_$next" "$out/thumb_$next" |
267 | for m in `ls -1 "$out/names"`; do | |
267 | while read m; do | |
268 | 268 | a="$cache/ppm_$n/$m.ppm" |
269 | 269 | fat_a="$cache/fat_$n/$m.ppm" |
270 | 270 | b="$cache/ppm_$next/$m.ppm" |
... | ... | |
298 | 298 | s= |
299 | 299 | empty=false |
300 | 300 | echo "<A href=\"diff_$next/$m.png\"><IMG src=\"thumb_$next/$m.png\"></A>" >>"$index" |
301 | done | |
301 | done < <(ls -1 "$out/names") | |
302 | 302 | if ! $empty; then |
303 | 303 | echo "$s<TD valign=\"middle\">" >>"$index" |
304 | 304 | commit_entry "$dir" $next >>"$index" |
... | ... | |
314 | 314 | empty=true |
315 | 315 | echo "<TR>" >>"$index" |
316 | 316 | mkdir -p "$out/diff_$next" "$out/thumb_$next" |
317 | for m in `ls -1 "$out/names"`; do | |
317 | while read m; do | |
318 | 318 | ppm="$cache/ppm_$next/$m.ppm" |
319 | 319 | fat="$cache/fat_$next/$m.ppm" |
320 | 320 | diff="$out/diff_$next/$m.png" |
... | ... | |
327 | 327 | || exit |
328 | 328 | empty=false |
329 | 329 | echo "<A href=\"diff_$next/$m.png\"><IMG src=\"thumb_$next/$m.png\"></A>" >>"$index" |
330 | done | |
330 | done < <(ls -1 "$out/names") | |
331 | 331 | if ! $empty; then |
332 | 332 | echo "<TD valign=\"middle\">" >>"$index" |
333 | 333 | commit_entry "$dir" $next >>"$index" |