diff options
| author | randomdan <randomdan@localhost> | 2010-08-12 19:31:46 +0000 | 
|---|---|---|
| committer | randomdan <randomdan@localhost> | 2010-08-12 19:31:46 +0000 | 
| commit | fba7ace35dcb4117c5760662bb7918a37f063cb4 (patch) | |
| tree | 6d7c08bad96d3b8e8abce4ceb339e967514ea9a4 | |
| parent | Use real path, not test path (diff) | |
| download | gentoobrowse-fba7ace35dcb4117c5760662bb7918a37f063cb4.tar.bz2 gentoobrowse-fba7ace35dcb4117c5760662bb7918a37f063cb4.tar.xz gentoobrowse-fba7ace35dcb4117c5760662bb7918a37f063cb4.zip | |
Bind merge populators recursively to leafs
Make path in file based rows a variable
Fix variable cache invalidation on parent row change
Use new features to only load new files
| -rw-r--r-- | gentoobrowse/console/packagefileimport.xml | 35 | 
1 files changed, 25 insertions, 10 deletions
| diff --git a/gentoobrowse/console/packagefileimport.xml b/gentoobrowse/console/packagefileimport.xml index 5ad2b95..45a41a8 100644 --- a/gentoobrowse/console/packagefileimport.xml +++ b/gentoobrowse/console/packagefileimport.xml @@ -17,17 +17,32 @@  		</columns>  	</project2:sqlmerge> -	<project2:sqlmerge name="loadCacheContent" datasource="postgres" targettable="filecache"> -		<project2:prociterate name="readFileContent" newline="
" encoding="ascii" fieldSep="|" quoteChar="" -				path="grep -n . /usr/portage/metadata/cache/*/* | sed -e 's#/usr/portage/metadata/cache/##' -e 's#:#|#' -e 's#:#|#'" > -			<columns> -				<column>fileid</column> -				<column>line</column> -				<column>content</column> -			</columns> -		</project2:prociterate> +	<project2:sqlmerge name="loadCacheContent" datasource="postgres" targettable="filecache" +			updatewhere="*a.fileid IN (SELECT o.fileid FROM files o WHERE o.cachedat IS NULL OR o.cachedat != o.moddate)"> +		<project2:sqliterate name="outDatadFiles" datasource="postgres"> +			<sql> +				SELECT fileid, '/usr/portage/metadata/cache/' || filename AS filename +				FROM files +				WHERE cachedat IS NULL OR cachedat != moddate +				ORDER BY fileid +			</sql> +			<project2:prociterate name="readFileContent" newline="
" encoding="ascii" fieldSep="|" quoteChar="" +					path="*grep -n . ^filename | sed -e 's#:#|#' -e 's#^# ^fileid |#'" > +				<columns> +					<column>fileid</column> +					<column>line</column> +					<column>content</column> +				</columns> +			</project2:prociterate> +			<project2:sqltask name="setCachedTime" datasource="postgres"> +				<sql>UPDATE files SET cachedat = moddate WHERE fileid = ?</sql> +				<parameters> +					<param bind="0" value="^fileid" /> +				</parameters> +			</project2:sqltask> +		</project2:sqliterate>  		<columns> -			<column key="true" maptable="files" mapcolumn="filename">fileid</column> +			<column key="true">fileid</column>  			<column key="true">line</column>  			<column>content</column>  		</columns> | 
