Check-in [862bf6f56b]
Overview
Comment:Updated to use a fallback mime.types file if specified one is unavailable
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 862bf6f56be0ac799109b61cc9f89146c24b964a
User & Date: rkeene on 2014-08-31 18:07:10
Other Links: manifest | tags
Context
2014-10-13
08:04
Updated to support HTTP Connection Keep-Alive check-in: b4fa45b6aa user: rkeene tags: trunk
2014-08-31
18:07
Updated to use a fallback mime.types file if specified one is unavailable check-in: 862bf6f56b user: rkeene tags: trunk
2014-07-23
07:53
Made wording slightly more clear check-in: f74837eecc user: rkeene tags: trunk
Changes

Modified Makefile from [a294b2122c] to [8247ae4962].

12
13
14
15
16
17
18
19
20

21
22
23
24
25
26
27
all: filed

filed: filed.o
	$(CC) $(CFLAGS) $(LDFLAGS) -o "$@" $^ $(LIBS)

filed.o: filed.c filed-mime-types.h

filed-mime-types.h: generate-mime-types
	./generate-mime-types "$(MIMETYPES)" > filed-mime-types.h.new

	mv filed-mime-types.h.new filed-mime-types.h

install: filed filed.1
	test -d "$(DESTDIR)$(mandir)/man1" || mkdir -p "$(DESTDIR)$(mandir)/man1"
	test -d "$(DESTDIR)$(bindir)" || mkdir -p "$(DESTDIR)$(bindir)"
	cp filed.1 "$(DESTDIR)$(mandir)/man1/"
	cp filed "$(DESTDIR)$(bindir)/"







|
|
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
all: filed

filed: filed.o
	$(CC) $(CFLAGS) $(LDFLAGS) -o "$@" $^ $(LIBS)

filed.o: filed.c filed-mime-types.h

filed-mime-types.h: generate-mime-types mime.types
	./generate-mime-types "$(MIMETYPES)" > filed-mime-types.h.new || \
		./generate-mime-types mime.types > filed-mime-types.h.new
	mv filed-mime-types.h.new filed-mime-types.h

install: filed filed.1
	test -d "$(DESTDIR)$(mandir)/man1" || mkdir -p "$(DESTDIR)$(mandir)/man1"
	test -d "$(DESTDIR)$(bindir)" || mkdir -p "$(DESTDIR)$(bindir)"
	cp filed.1 "$(DESTDIR)$(mandir)/man1/"
	cp filed "$(DESTDIR)$(bindir)/"

Modified generate-mime-types from [64211e4a81] to [bd758d28dd].

40
41
42
43
44
45
46

47
48
49









50
51
52
53
54
55
56
	set retval [expr {$retval % $mod}]

	return $retval

}

# Read contents of mime types file

set fd [open $mimeinfofile]
set mimeinfo [read $fd]
close $fd










# Parse into type and extensions pairs
foreach line [split $mimeinfo "\n"] {
	regsub {#.*} $line {} line
	set line [string trim $line]

	if {$line == ""} {







>
|
|
|
>
>
>
>
>
>
>
>
>







40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
	set retval [expr {$retval % $mod}]

	return $retval

}

# Read contents of mime types file
catch {
	set fd [open $mimeinfofile]
	set mimeinfo [read $fd]
	close $fd
}

if {![info exists mimeinfo]} {
	puts stderr "Not using $mimeinfofile, unreadable."

	exit 1
}

puts stderr "Using $mimeinfofile as mime.types"

# Parse into type and extensions pairs
foreach line [split $mimeinfo "\n"] {
	regsub {#.*} $line {} line
	set line [string trim $line]

	if {$line == ""} {

Added mime.types version [099ee45806].











>
>
>
>
>
1
2
3
4
5
text/html html htm
test/plain txt text
video/mp4 mp4 mpg4
audio/mpeg mp3 mpg3
application/zip zip