1 |
desultory 09/07/30 23:07:07 |
2 |
|
3 |
Modified: sitemap.pl |
4 |
Log: |
5 |
Error handling fixes. |
6 |
|
7 |
Revision Changes Path |
8 |
1.2 forums/scripts/sitemap.pl |
9 |
|
10 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-projects/forums/scripts/sitemap.pl?rev=1.2&view=markup |
11 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-projects/forums/scripts/sitemap.pl?rev=1.2&content-type=text/plain |
12 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-projects/forums/scripts/sitemap.pl?r1=1.1&r2=1.2 |
13 |
|
14 |
Index: sitemap.pl |
15 |
=================================================================== |
16 |
RCS file: /var/cvsroot/gentoo-projects/forums/scripts/sitemap.pl,v |
17 |
retrieving revision 1.1 |
18 |
retrieving revision 1.2 |
19 |
diff -u -r1.1 -r1.2 |
20 |
--- sitemap.pl 30 Jul 2009 11:36:56 -0000 1.1 |
21 |
+++ sitemap.pl 30 Jul 2009 23:07:07 -0000 1.2 |
22 |
@@ -60,7 +60,7 @@ |
23 |
my $forumsQuery = 'SELECT forum_id,forum_name,forum_desc,cat_id,forum_order,parent_id FROM phpbb_forums WHERE auth_view=0 AND auth_read=0 AND forum_id != "'. $dustbin .'" ORDER BY cat_id, forum_order;'; |
24 |
my $forums = query($forumsQuery); # public,readable,viewable forums, aside from dustbin, it's an arayref. |
25 |
|
26 |
-open( SITEMAP, '>', "$sitemap.$suffix" ); |
27 |
+open( SITEMAP, '>', "$sitemap.$suffix" ) or die "Can't open $sitemap.$suffix : $!\n"; |
28 |
|
29 |
print SITEMAP page_header( "${sitename} site map" ); |
30 |
|
31 |
@@ -73,7 +73,7 @@ |
32 |
my $sectionIndex = $forumId.'.html'; |
33 |
my $newSectionIndex = "${sectionIndex}.$suffix"; |
34 |
|
35 |
- open( SECTIONMAP, '>', "$newSectionIndex" ); |
36 |
+ open( SECTIONMAP, '>', "$newSectionIndex" ) or die "Can't open $sitemap.$suffix : $!\n"; |
37 |
|
38 |
print SECTIONMAP page_header( 'Index of '.$forumName ); |
39 |
|
40 |
@@ -109,4 +109,4 @@ |
41 |
|
42 |
$dbh->disconnect; |
43 |
|
44 |
-rename( "$sitemap.$suffix", "$sitemap" ); |
45 |
+rename( "$sitemap.$suffix", "$sitemap" ) or die "Could not rename $sitemap.$suffix to $sitemap\n"; |