summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gentoobrowse/console/packagefileimport.xml35
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="&#10;" encoding="ascii" fieldSep="|" quoteChar=""
- path="grep -n . /usr/portage/metadata/cache/*/* | sed -e &apos;s#/usr/portage/metadata/cache/##&apos; -e &apos;s#:#|#&apos; -e &apos;s#:#|#&apos;" >
- <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="&#10;" encoding="ascii" fieldSep="|" quoteChar=""
+ path="*grep -n . ^filename | sed -e &apos;s#:#|#&apos; -e &apos;s#^# ^fileid |#&apos;" >
+ <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>