public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/R_overlay:master commit in: files/shlib/, config/
@ 2013-09-04 13:13 André Erdmann
  0 siblings, 0 replies; only message in thread
From: André Erdmann @ 2013-09-04 13:13 UTC (permalink / raw
  To: gentoo-commits

commit:     b13760493c3cc09fa9c466eb2b0832020a59cd4f
Author:     André Erdmann <dywi <AT> mailerd <DOT> de>
AuthorDate: Wed Sep  4 13:11:06 2013 +0000
Commit:     André Erdmann <dywi <AT> mailerd <DOT> de>
CommitDate: Wed Sep  4 13:12:09 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=b1376049

config/: add hookrc file, files/shlib: itertools

* hook-related configuration
* files/shlib/itertools: provides line_iterator(), which is required to read
  ${GIT_REMOTES}

---
 config/hookrc            | 52 ++++++++++++++++++++++++++++++++++
 files/shlib/itertools.sh | 72 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 124 insertions(+)

diff --git a/config/hookrc b/config/hookrc
new file mode 100644
index 0000000..59e3c75
--- /dev/null
+++ b/config/hookrc
@@ -0,0 +1,52 @@
+# GIT_REPO_USER_NAME
+#
+#  Defaults to "roverlay".
+#
+#GIT_REPO_USER_NAME=""
+
+# GIT_REPO_USER_EMAIL
+#
+#  Defaults to "roverlay@undef.org".
+#
+#GIT_REPO_USER_EMAIL=""
+
+# GIT_COMMIT_MESSAGE
+#
+#  Defaults to "roverlay updates".
+#
+#GIT_COMMIT_MESSAGE='roverlay updates'
+
+# GIT_COMMIT_MAX_LINE_WIDTH
+#
+#  Defaults to 79.
+#
+#GIT_COMMIT_MAX_LINE_WIDTH=79
+
+# GIT_DEFAULT_REMOTE
+#
+#  URL to the remote that is used as "origin" when initializing
+#  a new git repo.
+#
+#  Defaults to <not set>.
+#
+#GIT_DEFAULT_REMOTE=""
+
+# GIT_REMOTES
+#  zero or more "<remote> [<refspec>...]" lines specifying what to push
+#  to which remote.
+#
+#  Defaults to "${GIT_DEFAULT_REMOTE:-origin} master" if commented out.
+#
+#GIT_REMOTES="
+#git://example1.org/repo.git :
+#git://example2.org/repo.git master:master"
+#
+#GIT_REMOTES=""
+
+# GIT_PUSH_ARGS
+#  additional args for "git push".
+#
+#  Defaults to <not set>.
+#
+#GIT_PUSH_ARGS="--quiet --all"
+GIT_PUSH_ARGS="--quiet"

diff --git a/files/shlib/itertools.sh b/files/shlib/itertools.sh
new file mode 100644
index 0000000..86d7697
--- /dev/null
+++ b/files/shlib/itertools.sh
@@ -0,0 +1,72 @@
+#!/bin/sh
+# -*- coding: utf-8 -*-
+# R overlay -- shell functions, list iterators
+# Copyright (C) 2013 André Erdmann <dywi@mailerd.de>
+# Distributed under the terms of the GNU General Public License;
+# either version 2 of the License, or (at your option) any later version.
+#
+#
+# --- functions provided by this file ---
+#
+# void generic_iterator (
+#    item_separator, *words,
+#    **F_ITER=echo, **ITER_SKIP_EMPTY=y, **ITER_UNPACK_ITEM=n,
+#    **F_ITER_ON_ERROR=return
+# )
+# @iterator line_iterator ( *lines )
+#
+# --- variables provided by this file ---
+#
+# @private __HAVE_ITERTOOLS_FUNCTIONS__
+#
+# --- END HEADER ---
+
+if [ -z "${__HAVE_ITERTOOLS_FUNCTIONS__-}" ]; then
+readonly __HAVE_ITERTOOLS_FUNCTIONS__=y
+
+
+# void generic_iterator (
+#    item_separator, *words,
+#    **F_ITER=echo, **ITER_SKIP_EMPTY=y, **ITER_UNPACK_ITEM=n,
+#    **F_ITER_ON_ERROR=return
+# )
+# DEFINES @iterator <item_separator> <iterator_name>
+#
+#  Iterates over a list of items separated by item_separator.
+#  All words are interpreted as "one big list".
+#
+#  Calls F_ITER ( item ) for each item and F_ITER_ON_ERROR() if F_ITER
+#  returns a non-zero value.
+#  The items will be unpacked if ITER_UNPACK_ITEM is set to 'y',
+#  otherwise the item is interpreted as one word (default 'n').
+#
+#  Empty items will be ignored if ITER_SKIP_EMPTY is set to 'y', which
+#  is the default behavior.
+#
+#  Examples: see the specific iterator function(s) below.
+#
+generic_iterator() {
+   : ${IFS_DEFAULT?}
+   local IFS="${1?}"
+   shift
+   set -- $*
+   IFS="${IFS_DEFAULT}"
+   local item
+   for item; do
+      if [ -z "${item}" ] && [ "${ITER_SKIP_EMPTY:-y}" = "y" ]; then
+         true
+      elif [ "${ITER_UNPACK_ITEM:-n}" = "y" ]; then
+         ${F_ITER:-echo} ${item}   || ${F_ITER_ON_ERROR:-return}
+      else
+         ${F_ITER:-echo} "${item}" || ${F_ITER_ON_ERROR:-return}
+      fi
+   done
+   return 0
+}
+
+# @iterator <newline> line_iterator
+line_iterator() {
+   generic_iterator "${IFS_NEWLINE?}" "$@"
+}
+
+fi # __HAVE_ITERTOOLS_FUNCTIONS__


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-09-04 13:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-04 13:13 [gentoo-commits] proj/R_overlay:master commit in: files/shlib/, config/ André Erdmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox