summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2015-04-07 16:52:08 +0000
committerintrigeri <intrigeri@boum.org>2015-04-07 16:52:08 +0000
commitc009fca0e3cda94a521bbbf786bbeb020ba06c2e (patch)
tree8e3110bf4635992c8e74717efbeb6a48e3a11779
parent435a266849bd50098f63598af371de1461ff7453 (diff)
Move tails-diff-suites functions to its functions.sh library.feature/8654-encode-apt-suite-in-git
-rw-r--r--files/reprepro/functions.sh28
-rwxr-xr-xfiles/reprepro/tails-diff-suites32
2 files changed, 28 insertions, 32 deletions
diff --git a/files/reprepro/functions.sh b/files/reprepro/functions.sh
index fe6a138..3ec9e87 100644
--- a/files/reprepro/functions.sh
+++ b/files/reprepro/functions.sh
@@ -8,3 +8,31 @@ ref_name_to_suite() {
echo "$ref" | sed -e 's,[^a-z0-9.-],-,ig' | tr '[A-Z]' '[a-z]'
}
+
+assert_is_branch_name() {
+ local branch="$1"
+
+ if ! echo "$branch" | grep -q -E "$BRANCH_RE" ; then
+ error "Invalid branch name: '$branch'"
+ fi
+}
+
+assert_is_apt_suite() {
+ local suite="$1"
+
+ if ! echo "$suite" | grep -q -E "$APT_SUITE_RE" ; then
+ error "Invalid APT suite name: '$suite'"
+ fi
+}
+
+assert_is_list_of_apt_suites() {
+ for suite in "$@" ; do
+ assert_is_apt_suite "$suite"
+ done
+}
+
+is_tag() {
+ local rev="$1"
+
+ echo "$rev" | grep -q -E "$TAG_RE"
+}
diff --git a/files/reprepro/tails-diff-suites b/files/reprepro/tails-diff-suites
index 055d3fd..ed0bbfa 100755
--- a/files/reprepro/tails-diff-suites
+++ b/files/reprepro/tails-diff-suites
@@ -29,38 +29,6 @@ TAG_RE='^[0-9][0-9.]*(?:-(?:alpha|beta|rc)\d*)?$'
. /usr/local/share/tails-reprepro/functions.sh
-# -------------------- XXX: move to functions.sh ---------------------
-
-assert_is_branch_name() {
- local branch="$1"
-
- if ! echo "$branch" | grep -q -E "$BRANCH_RE" ; then
- error "Invalid branch name: '$branch'"
- fi
-}
-
-assert_is_apt_suite() {
- local suite="$1"
-
- if ! echo "$suite" | grep -q -E "$APT_SUITE_RE" ; then
- error "Invalid APT suite name: '$suite'"
- fi
-}
-
-assert_is_list_of_apt_suites() {
- for suite in "$@" ; do
- assert_is_apt_suite "$suite"
- done
-}
-
-is_tag() {
- local rev="$1"
-
- echo "$rev" | grep -q -E "$TAG_RE"
-}
-
-# -------------------- XXX -------------------------------------------
-
packages_in_suite() {
local suite="$1"
[ -n "$suite" ] || return 1