? excludedocs.patch
Index: buildsite
===================================================================
RCS file: /usr/local/cvsroot/pgweb/portal/tools/buildsite,v
retrieving revision 1.8
diff -c -w -r1.8 buildsite
*** buildsite 20 Jan 2005 09:17:41 -0000 1.8
--- buildsite 20 Jan 2005 15:21:37 -0000
***************
*** 1,10 ****
#!/bin/sh
! if [ "$#" -ne 1 ]; then
! echo "Usage: $0 "
exit
fi
# Update everything
cd $1
/usr/bin/cvs -z9 update -d -P -C
--- 1,19 ----
#!/bin/sh
! if [ "$#" -ne 1 -a "$#" -ne 2 ]; then
! echo "Usage: $0 [-nodocs]"
exit
fi
+ MIRRORPARAM=
+ if [ "$#" -eq 2 ]; then
+ if [ "$2" != "-nodocs" ]; then
+ echo "Invalid parameter '$2'"
+ exit
+ fi
+ MIRRORPARAM="${MIRRORPARAM} -r 'docs/'"
+ fi
+
# Update everything
cd $1
/usr/bin/cvs -z9 update -d -P -C
***************
*** 20,26 ****
# Build the static pages
rm /tmp/mirror.log
! /usr/local/bin/php -d include_path=/usr/local/www/portal.postgresql.org/pear/lib -q $1/tools/mirror.php -v -l /tmp/mirror.log -o $1/static
# Touch the timestamp file
/usr/bin/date -u "+%Y-%m-%d %H:%M:%S UTC" > $1/static/sync_timestamp
--- 29,35 ----
# Build the static pages
rm /tmp/mirror.log
! /usr/local/bin/php -d include_path=/usr/local/www/portal.postgresql.org/pear/lib -q $1/tools/mirror.php -v -l /tmp/mirror.log -o $1/static ${MIRRORPARAM}
# Touch the timestamp file
/usr/bin/date -u "+%Y-%m-%d %H:%M:%S UTC" > $1/static/sync_timestamp
Index: mirror.php
===================================================================
RCS file: /usr/local/cvsroot/pgweb/portal/tools/mirror.php,v
retrieving revision 1.13
diff -c -w -r1.13 mirror.php
*** mirror.php 19 Jan 2005 21:44:11 -0000 1.13
--- mirror.php 20 Jan 2005 15:21:37 -0000
***************
*** 37,43 ****
* 'prefix' prefix for URLs to follow
* 'index' name of index file
* 'outputDir' directory to save files to
! * 'reject' array of regex patterns for URLs not to follow
*
* @access public
* @param object Log
--- 37,45 ----
* 'prefix' prefix for URLs to follow
* 'index' name of index file
* 'outputDir' directory to save files to
! * 'reject' array of regex patterns for URLs not to follow.
! * patterns are automatically anchored at 'prefix' in the start,
! * and # is used as pattern terminator.
*
* @access public
* @param object Log
***************
*** 197,203 ****
// reject links by pattern
if (!empty($this->_options['reject'])) {
foreach ($this->_options['reject'] as $pattern) {
! if (preg_match($pattern, $link)) {
continue 2;
}
}
--- 199,205 ----
// reject links by pattern
if (!empty($this->_options['reject'])) {
foreach ($this->_options['reject'] as $pattern) {
! if (preg_match('#^' . $this->_options['prefix'] . '/' . $pattern . '#', $link)) {
continue 2;
}
}
***************
*** 374,380 ****
'outputDir' => $args->getValue('output'),
'prefix' => 'http://wwwmaster.postgresql.org',
'index' => 'index.html.en',
! 'reject' => array_merge(array('/files/', '/layout/', '/redir\?/', '/download\/mirrors-ftp\?file/'), $reject)
));
$spider->crawl('http://wwwmaster.postgresql.org/index.html.en');
?>
--- 376,382 ----
'outputDir' => $args->getValue('output'),
'prefix' => 'http://wwwmaster.postgresql.org',
'index' => 'index.html.en',
! 'reject' => array_merge(array('files/', 'layout/', 'redir\?', 'download/mirrors-ftp\?file'), $reject)
));
$spider->crawl('http://wwwmaster.postgresql.org/index.html.en');
?>