implement file inclusion

This commit is contained in:
Ward Wouts 2005-01-28 20:06:45 +00:00
parent 53e51c9b54
commit 70c130d89a
4 changed files with 22 additions and 7 deletions

View file

@ -1,6 +1,6 @@
#!/usr/local/bin/ruby -w
# $Dwarf: ripnews.rb,v 1.84 2004/09/01 11:24:15 ward Exp $
# $Dwarf: ripnews.rb,v 1.85 2004/10/14 11:47:37 ward Exp $
# $Source$
#
@ -192,6 +192,13 @@ def parse_config(default = {})
grouparr = []
config = {}
lines.collect!{|x|
if x =~ /^\s*INCLUDEFILE=(.*?)\s*$/i
x = File.new($1).readlines
end
x
}
lines.collect!{|x|
x.sub!(/^\s*/, "")
x.sub!(/\#.*$/, "")
@ -380,7 +387,14 @@ def get_multi(subj, group)
print "filename #{filename}\n"
return false unless check_ext(group, filename, "m", subj)
print " YDecoding...\n"
mode, filename, body = YEnc.ydecode(body)
begin
mode, filename, body = YEnc.ydecode(body)
rescue YencError
# XXX if there is a yenc problem I want the data so I can research it
output_data(subj, 0600, "YencProblem", body)
# XXX return succes even though it's not true
return true
end
else
print " Unknown encoding (not UU, not yEnc), skipping...\n"
return false