On 5/26/17, Florian Balmer <[email protected]> wrote:
>
> For 10-20 repositories, the following (skeleton) shell script takes
> more than 1 second to finish:
>
> #!/bin/sh
> ...
> listfossil() {
> echo "$(basename "$1")"
> cat <<'SQL' | ./fossil sql --repository "$1"
> SELECT value FROM config
> WHERE name IN ('project-name', 'project-description')
> ORDER BY name DESC LIMIT 2;
> SQL
> }
> find . -name "*.fossil" -type f -print | sort | \
> while IFS= read -r file; do listfossil "$file"; done
>
That seems wrong.
For 75 repos, the following TCL script takes 35 milliseconds to run on
my Ubuntu system:
package require sqlite3
set cnt 0
foreach file [lsort [glob /home/drh/www/repos/*.fossil]] {
sqlite3 db $file
if {[db exists {SELECT 1 FROM sqlite_master WHERE name='config'}]} {
if {$cnt>0} {puts "***********************************************"}
puts "file: $file"
db eval {
SELECT name, value FROM config
WHERE name IN ('project-name', 'project-description')
ORDER BY name DESC LIMIT 2;
} {
puts "$name: $value"
}
incr cnt
}
db close
}
puts "\n$cnt repos\n"
--
D. Richard Hipp
[email protected]
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users