aboutsummaryrefslogtreecommitdiff
path: root/trunk/lib
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/lib')
-rw-r--r--trunk/lib/common.sh73
1 files changed, 73 insertions, 0 deletions
diff --git a/trunk/lib/common.sh b/trunk/lib/common.sh
index a7fa50c..22ac924 100644
--- a/trunk/lib/common.sh
+++ b/trunk/lib/common.sh
@@ -925,6 +925,30 @@ function check_svn_repo {
}
+function check_and_create_svn_repo {
+
+ # check and create svn repository
+ # usage: check_and_create_svn_repo <repository>
+
+ local repository repository_type repository_path
+
+ repository_type="`echo $repository | cut -d : -f 1`"
+ repository_path="`echo $repository | cut -d : -f 2`"
+
+ if [ "$repository_type" == "file" ] && [ ! -d "$repository_path" ]; then
+ echo "Creating subversion repository $repository..."
+ mkdir -p `dirname $repository_path`
+ svnadmin create $repository_path --fs-type fsfs
+ if [ "$?" != "0" ]; then
+ EXIT_CODE="1"
+ return $EXIT_CODE
+ else
+ return 0
+ fi
+ fi
+
+}
+
# -----------------------------------------------
# update jail functions
# -----------------------------------------------
@@ -1634,6 +1658,55 @@ function absolute_folder {
}
+function list_builds {
+
+ # list all available builds
+ # usage: list_builds <folder> <file_type>
+
+ local folder="$1" file_type="$2"
+ local i j k
+
+ if [ ! -d "$folder" ] || [ -z "$file_type" ]; then
+ return
+ fi
+
+ cd $folder
+ echo "Sarava $file_type list"
+ # level 1
+ for i in *; do
+ if [ -d $i ]; then
+ echo -e " $i: "
+ (
+ cd $i
+ # level 2
+ for j in *; do
+ if [ -d $j ]; then
+ eecho $commun " $j"
+ (
+ cd $j
+ BUILD="`ls *.$file_type 2>/dev/null`"
+ if [ "$BUILD" != "" ]; then
+ # level 3
+ for k in $BUILD; do
+ eecho $messag " $k"
+ done
+ else
+ BUILD=""
+ fi
+ for k in *; do
+ if [ -d $k ]; then
+ eecho $messag " $k.$file_type"
+ fi
+ done
+ )
+ fi
+ done
+ )
+ fi
+ done
+
+}
+
function check_installed {
# checks if a package is installed