summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--STYLE64
-rwxr-xr-xmkrelease68
2 files changed, 132 insertions, 0 deletions
diff --git a/STYLE b/STYLE
new file mode 100644
index 0000000..e99d955
--- /dev/null
+++ b/STYLE
@@ -0,0 +1,64 @@
+This is the rc-scripts style manual. It governs the coding style
+of rc-scripts. Everything here might as well have been spoken by
+God. If you find any issues, please talk to base-system@gentoo.org
+or #gentoo-base on irc.freenode.net.
+
+#############
+# VARIABLES #
+#############
+- User Variables -
+ Variables must always be enclosed by {}
+ e.g. ${foo} ${bar}
+- Internal Bash Variables -
+ Do not use {} with internal variables unless appropriate
+ e.g. case $1 in
+ e.g. foo=$IFS
+ e.g. echo "blah${1}123"
+- Assigning with Quotes -
+ When assigning to a variable from another variable or
+ a subshell, you do not need quotes, bash handles it
+ e.g. foo=${bar}
+ e.g. foo=$(uname -a)
+
+#########
+# TESTS #
+#########
+- Brackets -
+ Always use the [[ ... ]] form instead of [ ... ]
+- Equality -
+ Always use == form instead of = when testing equality. Makes
+ for saner looking code (we all love C, don't lie).
+- Quoting -
+ When dealing with strings, do not quote the LHS variable.
+ The [[ ... ]] handles spaces properly in variables. You
+ should always quote strings though.
+ e.g. [[ ${foo} = "bar" ]]
+ e.g. [[ "foo" != "bar" ]]
+ The RHS variable needs to be quoted to prevent against accidental
+ pattern matching (unless you want to match, of course).
+ e.g. [[ ${foo} = "${bar}" ]]
+ If foo=a-b and bar=a-* and ${bar} was not quoted, you would
+ get a match!
+
+###############
+# CODE BLOCKS #
+###############
+- Structure -
+ Use the more compact form
+ e.g. if ... ; then
+ e.g. while ... ; do
+ Do not use the older form
+ e.g. if ...
+ then
+- Functions -
+ Use the more compact form
+ e.g. foo() {
+ Do not lead with 'function '
+ e.g. function foo() {
+
+############
+# COMMENTS #
+############
+- General -
+ Try to include a comment block before sections
+ of code to explain what you're attempting
diff --git a/mkrelease b/mkrelease
new file mode 100755
index 0000000..5db4a27
--- /dev/null
+++ b/mkrelease
@@ -0,0 +1,68 @@
+#!/bin/bash
+
+proj="baselayout-vserver"
+svnroot="http://dev.croup.de/repos/${proj}"
+ver=1.13.0
+
+usage() {
+ echo "Usage: mkrelease"
+}
+
+die() {
+ echo $1
+ exit ${2:-1}
+}
+
+if [[ $1 != "-f" ]] ; then
+ echo "Performing sanity checks (run with -f to skip) ..."
+
+ # Check that we're updated
+ svnfiles="$( svn status 2>&1 | egrep -v '^(U|P)' )"
+ if [[ -n ${svnfiles} ]] ; then
+ echo "Refusing to package tarball until svn is in sync:"
+ echo "$svnfiles"
+ exit 1
+ fi
+fi
+
+echo "Creating release tag... "
+
+echo svn copy ${svnroot}/trunk ${svnroot}/tags/release-${ver} \
+ -m "Tagging the ${ver} release of the ${proj} project" &>/dev/null || die "svn copy failed"
+
+
+echo "Make dist tarball..."
+
+dest=dist/${proj}-${ver}
+
+mkdir -p ${dest} &>/dev/null
+
+for x in bin etc init.d sbin src rc-lists man ; do
+ cp -ax $x ${dest}/
+done
+
+# do not yet package src/core stuff
+#rm -rf ${dest}/src/core
+
+# copy net-scripts and remove older stuff
+install -d -m0755 ${dest}/lib/rcscripts
+cp -ax net-scripts/init.d ${dest}
+cp -ax net-scripts/net.modules.d ${dest}/lib/rcscripts
+cp -ax net-scripts/conf.d ${dest}/etc
+ln -sfn net.lo ${dest}/init.d/net.eth0
+
+cp ChangeLog ${dest}
+
+pushd dist/ &>/dev/null || die "pushd failed"
+
+rm -rf $( find -iname .svn )
+
+tar cjf ${proj}-${ver}.tar.bz2 ${proj}-${ver} || die "tar failed"
+
+for i in *.tar*; do
+ md5sum $i > $i.md5
+done
+
+echo "Tarball ist at `pwd`"
+
+popd &>/dev/null || die "popd failed"