summaryrefslogtreecommitdiff
path: root/src/pacman
diff options
context:
space:
mode:
Diffstat (limited to 'src/pacman')
-rw-r--r--src/pacman/Makefile.am2
-rw-r--r--src/pacman/pacman.c5
2 files changed, 7 insertions, 0 deletions
diff --git a/src/pacman/Makefile.am b/src/pacman/Makefile.am
index d997ecc6..939ff197 100644
--- a/src/pacman/Makefile.am
+++ b/src/pacman/Makefile.am
@@ -1,6 +1,7 @@
# paths set at make time
conffile = ${sysconfdir}/pacman.conf
dbpath = ${localstatedir}/lib/pacman/
+cachedir = ${localstatedir}/cache/pacman/pkg/
bin_PROGRAMS = pacman pacman.static
@@ -8,6 +9,7 @@ DEFS = -DLOCALEDIR=\"@localedir@\" \
-DCONFFILE=\"$(conffile)\" \
-DROOTDIR=\"$(ROOTDIR)\" \
-DDBPATH=\"$(dbpath)\" \
+ -DCACHEDIR=\"$(cachedir)\" \
@DEFS@
INCLUDES = -I$(top_srcdir)/lib/libalpm
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 538b4a58..a5eff64e 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -767,6 +767,11 @@ int main(int argc, char *argv[])
cleanup(ret);
}
+ /* add a default cachedir if one wasn't specified */
+ if(alpm_option_get_cachedirs() == NULL) {
+ alpm_option_add_cachedir(CACHEDIR);
+ }
+
#if defined(HAVE_GETEUID)
/* check if we have sufficient permission for the requested operation */
if(myuid > 0) {