aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2009-10-09 19:44:47 +0000
committerrhatto <rhatto@04377dda-e619-0410-9926-eae83683ac58>2009-10-09 19:44:47 +0000
commiteb3fb21b03ae731a246965a59e6916638772a4cd (patch)
treef26a9d8f58b48d7b14aa4db07214a1fa042c2cc0
parentc68e0857f9aa1a18871b8b23ce6406a21236f466 (diff)
downloadsimplepkg-eb3fb21b03ae731a246965a59e6916638772a4cd.tar.gz
simplepkg-eb3fb21b03ae731a246965a59e6916638772a4cd.tar.bz2
Adding config variables TMP_USER and TMP_GROUP
git-svn-id: svn+slack://slack.fluxo.info/var/svn/simplepkg@821 04377dda-e619-0410-9926-eae83683ac58
-rw-r--r--trunk/conf/simplepkg.conf8
-rw-r--r--trunk/lib/common.sh2
-rw-r--r--trunk/src/createpkg18
3 files changed, 27 insertions, 1 deletions
diff --git a/trunk/conf/simplepkg.conf b/trunk/conf/simplepkg.conf
index 26c6657..2ffb59b 100644
--- a/trunk/conf/simplepkg.conf
+++ b/trunk/conf/simplepkg.conf
@@ -21,6 +21,14 @@
# Temporary folder
TMP="/tmp/simplepkg"
+# Temporary folder user: use it if you want to bind simplepkg's
+# temporary folder to a given user
+# TMP_USER=""
+
+# Temporary folder group: use it if you want to bind simplepkg's
+# temporary folder to a given group
+# TMP_GROUP=""
+
#---------------------------------------------------------------------
# MKBUILD AND CREATEPKG SECTION
#---------------------------------------------------------------------
diff --git a/trunk/lib/common.sh b/trunk/lib/common.sh
index de3f375..dbb01eb 100644
--- a/trunk/lib/common.sh
+++ b/trunk/lib/common.sh
@@ -281,6 +281,8 @@ function eval_config {
DEFAULT_VERSION="`eval_parameter DEFAULT_VERSION $(default_version)`"
TMP="`eval_parameter TMP /tmp`"
+ TMP_USER="`eval_parameter TMP_USER`"
+ TMP_GROUP="`eval_parameter TMP_GROUP`"
STORAGE="`eval_parameter STORAGE /var/simplaret/packages`"
JAIL_ROOT="`eval_parameter JAIL_ROOT /vservers`"
PATCHES_DIR="`eval_parameter PATCHES_DIR /var/simplaret/patches`"
diff --git a/trunk/src/createpkg b/trunk/src/createpkg
index ebebf66..10daf0b 100644
--- a/trunk/src/createpkg
+++ b/trunk/src/createpkg
@@ -248,7 +248,10 @@ function load_parameters {
CREATEPKG_ARCH="`eval_parameter CREATEPKG_ARCH $(default_arch)`"
CREATEPKG_CLEANUP="`eval_parameter CREATEPKG_CLEANUP yes`"
CREATEPKG_AUTHOR="`eval_parameter CREATEPKG_AUTHOR`"
+
TMP="`eval_parameter TMP /tmp`"
+ TMP_USER="`eval_parameter TMP_USER`"
+ TMP_GROUP="`eval_parameter TMP_GROUP`"
SIGN_PACKAGES="`eval_boolean_parameter SIGN_PACKAGES $off`"
SIGN_PACKAGES_USER="`eval_parameter SIGN_PACKAGES_USER`"
@@ -905,7 +908,20 @@ function build_queue {
echo -e "$unable_to_install"
fi
- # Exit if last build package exit status
+ # Fix possible $TMP removal
+ mkdir -p $TMP
+
+ # Fix $TMP user
+ if [ ! -z "$TMP_USER" ]; then
+ chown $TMP_USER $TMP
+ fi
+
+ # Fix $TMP group
+ if [ ! -z "$TMP_GROUP" ]; then
+ chgrp $TMP_GROUP $TMP
+ fi
+
+ # Exit with last build package exit status
exit $last_status
}