Front page still horked.

Anderson Lizardo andersonlizardo at yahoo.com.br
Thu Nov 13 18:09:03 PST 2003


Anderson Lizardo wrote:
> Okay, I will write some syntax checker for the news database. If the
> problem still occurs on future, we will have to modify the news
> archiving/publishing system.

Done. It has some limitations, though. It will not complain if you 
forgot to insert the required empty lines between the news item header 
and its content, and before each boundary mark.

What it will detect:
- Missing global header fields: section, mime-version, content-type, 
etc.
- Missing news item header fields: title, date and author.
- Typos on boundary marks (--NEW_ITEM_BOUNDARY :o)
- Missing end boundary mark (--NEWS_ITEM_BOUNDARY--)

The check_syntax() subroutine will check the entire database file, and 
if any error is found, will print it to STDERR along with the line 
number (if possible). Eg:

./manage_news.pl: /home/lizardo/repository/lfs-website/news-test.txt: 
Invalid space character at start of line 7.
./manage_news.pl: /home/lizardo/repository/lfs-website/news-test.txt: 
"Section" field not found.
2 syntax error(s) found on 
/home/lizardo/repository/lfs-website/news-test.txt.

That's it. I hope you like it :)
-- 
Anderson Lizardo




More information about the website mailing list