Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emmapeel
puppet-tails
Commits
c009fca0
Commit
c009fca0
authored
Apr 07, 2015
by
intrigeri
Browse files
Move tails-diff-suites functions to its functions.sh library.
parent
435a2668
Changes
2
Hide whitespace changes
Inline
Side-by-side
files/reprepro/functions.sh
View file @
c009fca0
...
...
@@ -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
"
}
files/reprepro/tails-diff-suites
View file @
c009fca0
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment