aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Erdmann <dywi@mailerd.de>2012-05-24 20:31:06 +0200
committerAndre Erdmann <dywi@mailerd.de>2012-05-24 20:31:06 +0200
commit01646a6054480eef611aef1fddb762556709f925 (patch)
tree4aa5f4e54d0886478184165ba2e3eb116535d1d4
parentgitignore (diff)
downloadR_overlay-01646a6054480eef611aef1fddb762556709f925.tar.gz
R_overlay-01646a6054480eef611aef1fddb762556709f925.tar.bz2
R_overlay-01646a6054480eef611aef1fddb762556709f925.zip
temporary files (for testing etc.)
-rw-r--r--Makefile17
-rw-r--r--examples/DESCRIPTION/NbClust.desc21
-rw-r--r--examples/DESCRIPTION/SPARQL.desc19
-rw-r--r--examples/DESCRIPTION/Taxonstand.desc15
-rw-r--r--examples/packages/NbClust.desc21
-rw-r--r--examples/packages/SPARQL.desc19
-rw-r--r--examples/packages/Taxonstand.desc15
-rwxr-xr-xexamples/packages/get.sh54
-rwxr-xr-xnop.py5
-rw-r--r--roverlay/tmpconst.py71
-rwxr-xr-xrun_descreader.py14
11 files changed, 271 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..bc4dc2e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,17 @@
+# runs tests
+EXAMPLES = ./examples
+
+PY_DESC_TESTER = ./run_descreader.py
+PY_NOP = ./nop.py
+
+.PHONY: default test test-desc test-nop
+
+default: test
+
+test-desc: $(PY_DESC_TESER) $(EXAMPLES)/DESCRIPTION
+ $(PY_DESC_TESTER) $(EXAMPLES)/DESCRIPTION/*.desc
+
+test-nop: $(PY_NOP)
+ @$(PY_NOP)
+
+test: test-nop test-desc
diff --git a/examples/DESCRIPTION/NbClust.desc b/examples/DESCRIPTION/NbClust.desc
new file mode 100644
index 0000000..817adfd
--- /dev/null
+++ b/examples/DESCRIPTION/NbClust.desc
@@ -0,0 +1,21 @@
+Package: NbClust
+Type: Package
+Title: An examination of indices for determining the number of clusters
+ : NbClust Package
+Version: 1.0
+Date: 2012-05-01
+Author: Malika Charrad <malika.charrad.1@ulaval.ca> and Nadia Ghazzali
+ <nadia.ghazzali@mat.ulaval.ca> and Veronique Boiteau
+ <veronique.boiteau.1@ulaval.ca> and Azam Niknafs
+ <azam.niknafs.1@ulaval.ca>
+Maintainer: : Nadia Ghazzali <nadia.ghazzali@mat.ulaval.ca>
+Description: This package provides most of the popular indices for
+ cluster validation ready to use for the outputs produced by
+ functions coming from the same package. It also proposes to
+ user the best clustering scheme from the different results
+ obtained by varying all combinations of number of clusters,
+ distance measures, and clustering methods.
+License: GPL-2
+Packaged: 2012-05-23 14:26:58 UTC; CRSNG-INAL-3
+Repository: CRAN
+Date/Publication: 2012-05-23 16:21:05
diff --git a/examples/DESCRIPTION/SPARQL.desc b/examples/DESCRIPTION/SPARQL.desc
new file mode 100644
index 0000000..555866d
--- /dev/null
+++ b/examples/DESCRIPTION/SPARQL.desc
@@ -0,0 +1,19 @@
+Package: SPARQL
+Type: Package
+Title: SPARQL client
+Version: 1.9
+Date: 2012-05-22
+Author: Willem Robert van Hage <W.R.van.Hage@vu.nl> and Tomi Kauppinen
+ <tomi.kauppinen@uni-muenster.de>, with contributions from
+ Christopher Davis <C.B.Davis@tudelft.nl> and Jesper Hoeksema
+ <J.E.Hoeksema@vu.nl>
+Maintainer: Willem Robert van Hage <W.R.van.Hage@vu.nl> and Tomi
+ Kauppinen <tomi.kauppinen@uni-muenster.de>
+Description: Use SPARQL to pose SELECT or UPDATE queries to an
+ end-point.
+License: GPL-3
+Depends: XML, RCurl
+LazyLoad: yes
+Packaged: 2012-05-22 09:39:27 UTC; wrvhage
+Repository: CRAN
+Date/Publication: 2012-05-22 13:05:32
diff --git a/examples/DESCRIPTION/Taxonstand.desc b/examples/DESCRIPTION/Taxonstand.desc
new file mode 100644
index 0000000..94355f7
--- /dev/null
+++ b/examples/DESCRIPTION/Taxonstand.desc
@@ -0,0 +1,15 @@
+Package: Taxonstand
+Type: Package
+Title: Taxonomic standardization of plant species names
+Version: 1.0
+Date: 2012-03-21
+Author: Luis Cayuela
+Maintainer: Luis Cayuela <luis.cayuela@urjc.es>
+Description: Automated standardization of taxonomic names and removal
+ of orthograhpic errors in plant species names using the The
+ Plant List (TPL) website (www.theplantlist.org)
+License: GPL (>= 2)
+LazyLoad: yes
+Packaged: 2012-05-21 08:14:50 UTC; luis
+Repository: CRAN
+Date/Publication: 2012-05-21 08:36:09
diff --git a/examples/packages/NbClust.desc b/examples/packages/NbClust.desc
new file mode 100644
index 0000000..817adfd
--- /dev/null
+++ b/examples/packages/NbClust.desc
@@ -0,0 +1,21 @@
+Package: NbClust
+Type: Package
+Title: An examination of indices for determining the number of clusters
+ : NbClust Package
+Version: 1.0
+Date: 2012-05-01
+Author: Malika Charrad <malika.charrad.1@ulaval.ca> and Nadia Ghazzali
+ <nadia.ghazzali@mat.ulaval.ca> and Veronique Boiteau
+ <veronique.boiteau.1@ulaval.ca> and Azam Niknafs
+ <azam.niknafs.1@ulaval.ca>
+Maintainer: : Nadia Ghazzali <nadia.ghazzali@mat.ulaval.ca>
+Description: This package provides most of the popular indices for
+ cluster validation ready to use for the outputs produced by
+ functions coming from the same package. It also proposes to
+ user the best clustering scheme from the different results
+ obtained by varying all combinations of number of clusters,
+ distance measures, and clustering methods.
+License: GPL-2
+Packaged: 2012-05-23 14:26:58 UTC; CRSNG-INAL-3
+Repository: CRAN
+Date/Publication: 2012-05-23 16:21:05
diff --git a/examples/packages/SPARQL.desc b/examples/packages/SPARQL.desc
new file mode 100644
index 0000000..555866d
--- /dev/null
+++ b/examples/packages/SPARQL.desc
@@ -0,0 +1,19 @@
+Package: SPARQL
+Type: Package
+Title: SPARQL client
+Version: 1.9
+Date: 2012-05-22
+Author: Willem Robert van Hage <W.R.van.Hage@vu.nl> and Tomi Kauppinen
+ <tomi.kauppinen@uni-muenster.de>, with contributions from
+ Christopher Davis <C.B.Davis@tudelft.nl> and Jesper Hoeksema
+ <J.E.Hoeksema@vu.nl>
+Maintainer: Willem Robert van Hage <W.R.van.Hage@vu.nl> and Tomi
+ Kauppinen <tomi.kauppinen@uni-muenster.de>
+Description: Use SPARQL to pose SELECT or UPDATE queries to an
+ end-point.
+License: GPL-3
+Depends: XML, RCurl
+LazyLoad: yes
+Packaged: 2012-05-22 09:39:27 UTC; wrvhage
+Repository: CRAN
+Date/Publication: 2012-05-22 13:05:32
diff --git a/examples/packages/Taxonstand.desc b/examples/packages/Taxonstand.desc
new file mode 100644
index 0000000..94355f7
--- /dev/null
+++ b/examples/packages/Taxonstand.desc
@@ -0,0 +1,15 @@
+Package: Taxonstand
+Type: Package
+Title: Taxonomic standardization of plant species names
+Version: 1.0
+Date: 2012-03-21
+Author: Luis Cayuela
+Maintainer: Luis Cayuela <luis.cayuela@urjc.es>
+Description: Automated standardization of taxonomic names and removal
+ of orthograhpic errors in plant species names using the The
+ Plant List (TPL) website (www.theplantlist.org)
+License: GPL (>= 2)
+LazyLoad: yes
+Packaged: 2012-05-21 08:14:50 UTC; luis
+Repository: CRAN
+Date/Publication: 2012-05-21 08:36:09
diff --git a/examples/packages/get.sh b/examples/packages/get.sh
new file mode 100755
index 0000000..a274cda
--- /dev/null
+++ b/examples/packages/get.sh
@@ -0,0 +1,54 @@
+#!/bin/bash
+# temporary script
+# extracts data (=files) out of a R src package
+#
+
+## this is a multicall script whose only functionality is get(file, *info) - don't rename
+
+readonly _ARGV="$*"
+_SELF="${0##*/}"
+_SELF="${_SELF%.*sh}"
+readonly _SELF
+set --
+set -u
+
+# get (file, *info)
+# extracts *info out of file (or all gzip-tarballs in `pwd`)
+#
+get() {
+ local file="${1:-}" x fname name
+ shift ||:
+
+ [[ "$file" ]] || return ${undone:-101}
+
+ if [[ "$file" == "all" ]]; then
+ for x in *.tar.gz *.tgz; do
+ if [[ -r "$x" ]]; then
+ get "$x" $* || return $?
+ fi
+ done
+ return 0
+ fi
+
+ fname="${file##*/}"
+ fname="${fname%%.*}"
+ name="${fname%%_*}"
+ for x in $*; do
+ case "${x}" in
+ desc) tar xvzf "$file" "${name}/DESCRIPTION" && \
+ mv -f -v -- "${name}/DESCRIPTION" "${name}.desc" &&
+ rmdir "${name}" && chmod a=r "${name}.desc" || return $?
+ ;;
+ *) return ${undef:-56} ;;
+ esac
+ done
+ return 0
+}
+
+__error__() {
+ local -i _ret=$?
+ 1>&2 echo "error when calling method '${1:-$_SELF}'."
+ return $_ret
+}
+
+${_SELF} $_ARGV || __error__ "${_SELF}"
diff --git a/nop.py b/nop.py
new file mode 100755
index 0000000..8c963b5
--- /dev/null
+++ b/nop.py
@@ -0,0 +1,5 @@
+#!/usr/bin/env python3
+# Copyright 2006-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+import roverlay
diff --git a/roverlay/tmpconst.py b/roverlay/tmpconst.py
new file mode 100644
index 0000000..8a44d22
--- /dev/null
+++ b/roverlay/tmpconst.py
@@ -0,0 +1,71 @@
+# R overlay -- constants (temporary file)
+# Copyright 2006-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+DESCRIPTION_FIELD_SEPARATOR = ':'
+
+DESCRIPTION_COMMENT_CHAR = '#'
+
+DESCRIPTION_LIST_SPLIT_REGEX = '\s*[,;]{1}\s*'
+
+DESCRIPTION_VALID_OS_TYPES = [ "unix" ]
+
+
+# note for 2012-05-25: make this struct more organized, assign real values
+"""The map of used fields in the DESCRIPTION file
+
+ stores the real field name as well as field flags and aliases
+ that can be case-sensitive (withcase) or not (nocase)
+
+ access to these values is
+ * for aliases
+ DESCRIPTION_FIELD_MAP [<field name>] [case sensitive? withcase : nocase] [<index>]
+
+ * for flags
+ DESCRIPTION_FIELD_MAP [<field name>] [flags] [<index>]
+
+ notable flags:
+ * isList : indicates that this field has several values that are
+ separated by commata/semicolons =:<DESCRIPTION_LIST_SPLIT_REGEX>
+ this disables isWhitespaceList
+
+ * isWhitespaceList : indicates that this field has several values separated
+ by whitespace
+
+ * joinValues : indicates that the values of this field should be concatenated
+ after reading them (with a ' ' as separator)
+ (this implies that the read values are one string)
+
+ * mandatory : cannot proceed if a file does not contain this field (implies ignoring default values)
+
+"""
+
+DESCRIPTION_FIELD_MAP = {
+ 'Description' : {
+ 'flags' : [ 'joinValues' ],
+ },
+ 'Title' : '',
+ 'Package' : '',
+ 'License' : '',
+ 'Suggests' : {
+ 'nocase' : [ 'Suggests', 'Suggest',
+ '%Suggests', 'Suggets', 'Recommends' ]
+ },
+ 'Depends' : {
+ 'nocase' : [ 'Depends', 'Dependencies', 'Dependes',
+ '%Depends', 'Depents', 'Require', 'Requires' ],
+ 'flags' : [ 'isList', 'mandatory' ],
+ },
+ 'Imports' : {
+ 'nocase' : [ 'Imports', 'Import' ]
+ },
+ 'LinkingTo' : {
+ 'nocase' : [ 'LinkingTo', 'LinkingdTo' ]
+ },
+ 'SystemRequirements' : {
+ 'nocase' : [ 'SystemRequirements', 'SystemRequirement' ]
+ },
+ 'OS_Type' : {
+ 'nocase' : [ 'OS_TYPE' ]
+ }
+}
diff --git a/run_descreader.py b/run_descreader.py
new file mode 100755
index 0000000..b876f7b
--- /dev/null
+++ b/run_descreader.py
@@ -0,0 +1,14 @@
+#!/usr/bin/env python3
+# Copyright 2006-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+import sys
+
+import roverlay.fileio
+
+reader = roverlay.fileio.DescriptionReader()
+
+for descfile in sys.argv[1:]:
+ reader.readfile ( descfile )
+
+