summaryrefslogtreecommitdiffstats
path: root/db-functions
diff options
context:
space:
mode:
authorAaron Griffin <aaronmgriffin@gmail.com>2008-11-22 03:31:13 +0100
committerAaron Griffin <aaronmgriffin@gmail.com>2008-11-22 03:31:13 +0100
commita7a268356fac69c94d99315553f4d61fa2744261 (patch)
treee6f52255a077983c8f82c69b90a2d5219f888a5f /db-functions
parent3606df775189459eef24fdec2bad5cab6ccc7ec6 (diff)
downloaddbscripts-a7a268356fac69c94d99315553f4d61fa2744261.tar.gz
dbscripts-a7a268356fac69c94d99315553f4d61fa2744261.tar.xz
Add umask setting/restoring helper functions
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
Diffstat (limited to 'db-functions')
-rw-r--r--db-functions10
1 files changed, 10 insertions, 0 deletions
diff --git a/db-functions b/db-functions
index 11ab422..8c8c667 100644
--- a/db-functions
+++ b/db-functions
@@ -19,6 +19,16 @@ source_makepkg () {
fi
}
+UMASK=""
+set_umask () {
+ UMASK="$(umask)"
+ umask 002
+}
+
+restore_umask () {
+ umask $UMASK
+}
+
repo_lock () { #repo_lock repo-name arch
LOCKFILE="$TMPDIR/.repolock.$1.$2"
if [ -f "$LOCKFILE" ]; then