summaryrefslogtreecommitdiff
path: root/summary.sh
diff options
context:
space:
mode:
authorNick White <git@njw.me.uk>2010-10-24 13:39:20 +0100
committerNick White <git@njw.me.uk>2010-10-24 13:39:20 +0100
commitb0659cf2523776df0bba023e2a54f1d8d3afda4e (patch)
treea3531488c7b9ee2bf635a91bc33c914a3ed6c8ee /summary.sh
parentddd0a6e1afddd2d9395a48e03d62ee97ed3bd73a (diff)
Fix doap and improve summary output
Diffstat (limited to 'summary.sh')
-rw-r--r--summary.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/summary.sh b/summary.sh
index 0298d4d..c274443 100644
--- a/summary.sh
+++ b/summary.sh
@@ -6,7 +6,7 @@ rdf="$1"
q="PREFIX doap: <http://usefulinc.com/ns/doap#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
-SELECT ?home ?repo ?license ?maintainer ?maintainerhome ?lang
+SELECT ?home ?repo ?license ?maintainer ?maintainerhome ?lang ?repotype
WHERE {
?p a doap:Project;
doap:homepage ?home;
@@ -14,7 +14,8 @@ WHERE {
doap:license ?license;
doap:programming-language ?lang;
doap:maintainer ?m.
-?r doap:location ?repo.
+?r a ?repotype;
+ doap:location ?repo.
?m foaf:name ?maintainer;
foaf:homepage ?maintainerhome.
}"
@@ -30,10 +31,12 @@ roqet -q -r csv -e "$q" -D /dev/stdin < $rdf | sed '/^Result/d' \
test "$licenseuri" = "http://www.gnu.org/licenses/gpl.html" && license="GPL"
test "$licenseuri" = "http://www.gnu.org/licenses/agpl.html" && license="AGPL"
test "$licenseuri" = "http://creativecommons.org/licenses/MIT/" && license="MIT"
+ repotype=`echo $r | awk -F , '{print $8}'| sed -e 's/uri(\(.*\))/\1/'`
+ test "$repotype" = "http://usefulinc.com/ns/doap#GitRepository" && repocmd="git clone"
cat <<- _EOF_
- Project homepage: [$home]($home)
-- Code repository: git clone $repo
+- Code repository: $repocmd $repo
- Maintainer: [$maint]($mainthome)
- Language: $lang
- License: [$license]($licenseuri)