]> git.donarmstrong.com Git - cran2deb.git/blobdiff - tags/pre-dual/R/util.R
reprepro version before the massacre
[cran2deb.git] / tags / pre-dual / R / util.R
diff --git a/tags/pre-dual/R/util.R b/tags/pre-dual/R/util.R
new file mode 100644 (file)
index 0000000..e10951e
--- /dev/null
@@ -0,0 +1,25 @@
+iterate <- function(xs,z,fun) {
+    y <- z
+    for (x in xs)
+        y <- fun(y,x)
+    return(y)
+}
+
+chomp <- function(x) {
+    # remove leading and trailing spaces
+    return(sub('^[[:space:]]+','',sub('[[:space:]]+$','',x)))
+}
+
+host_arch <- function() {
+    # return the host system architecture
+    system('dpkg-architecture -qDEB_HOST_ARCH',intern=T)
+}
+
+err <- function(...) {
+    error(...)
+    exit()
+}
+
+exit <- function() {
+    q(save='no')
+}