summaryrefslogtreecommitdiffstats
path: root/scripts/pacman-optimize
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2006-12-28 18:19:25 +0000
committerAaron Griffin <aaron@archlinux.org>2006-12-28 18:19:25 +0000
commit5e2d757c3487d64b6e08358e8c07b5b033555d3c (patch)
tree41e24c119875e04930051f56b3355871221970e9 /scripts/pacman-optimize
parentd59585c24f1a78dd66dd27bae9845729e60df24b (diff)
downloadpacman-5e2d757c3487d64b6e08358e8c07b5b033555d3c.tar.xz
* Removed autoconf TODO fixed in last commit
* Dan McGee <dpmcgee@gmail.com> pacman-optimize checking fixes
Diffstat (limited to 'scripts/pacman-optimize')
-rwxr-xr-xscripts/pacman-optimize11
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/pacman-optimize b/scripts/pacman-optimize
index 4cf1819a..5b3c3b07 100755
--- a/scripts/pacman-optimize
+++ b/scripts/pacman-optimize
@@ -20,7 +20,7 @@
# USA.
#
-myver='2.9.8'
+myver='3.0.0'
usage() {
echo "pacman-optimize $myver"
@@ -59,10 +59,6 @@ if [ "$1" != "" ]; then
dbroot=$1
fi
-if [ "`id -u`" != 0 ]; then
- die "You must be root to optimize the database"
-fi
-
# make sure pacman isn't running
if [ -f /tmp/pacman.lck ]; then
die "Pacman lockfile was found. Cannot run while pacman is running."
@@ -72,6 +68,11 @@ if [ ! -d $dbroot ]; then
die "$dbroot does not exist or is not a directory"
fi
+#if [ "$EUID" != 0 ]; then
+if [ ! -w "$dbroot" ]; then
+ die "You must have correct permissions to optimize the database"
+fi
+
# don't let pacman run while we do this
touch /tmp/pacman.lck