Add a default cachedir if one wasn't specified
Use the default cachedir (specified at compile time) if one wasn't specified on the command line or in the config file. Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
c22e381a8b
commit
d09d114e99
2 changed files with 7 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
# paths set at make time
|
# paths set at make time
|
||||||
conffile = ${sysconfdir}/pacman.conf
|
conffile = ${sysconfdir}/pacman.conf
|
||||||
dbpath = ${localstatedir}/lib/pacman/
|
dbpath = ${localstatedir}/lib/pacman/
|
||||||
|
cachedir = ${localstatedir}/cache/pacman/pkg/
|
||||||
|
|
||||||
bin_PROGRAMS = pacman pacman.static
|
bin_PROGRAMS = pacman pacman.static
|
||||||
|
|
||||||
|
@ -8,6 +9,7 @@ DEFS = -DLOCALEDIR=\"@localedir@\" \
|
||||||
-DCONFFILE=\"$(conffile)\" \
|
-DCONFFILE=\"$(conffile)\" \
|
||||||
-DROOTDIR=\"$(ROOTDIR)\" \
|
-DROOTDIR=\"$(ROOTDIR)\" \
|
||||||
-DDBPATH=\"$(dbpath)\" \
|
-DDBPATH=\"$(dbpath)\" \
|
||||||
|
-DCACHEDIR=\"$(cachedir)\" \
|
||||||
@DEFS@
|
@DEFS@
|
||||||
INCLUDES = -I$(top_srcdir)/lib/libalpm
|
INCLUDES = -I$(top_srcdir)/lib/libalpm
|
||||||
|
|
||||||
|
|
|
@ -767,6 +767,11 @@ int main(int argc, char *argv[])
|
||||||
cleanup(ret);
|
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)
|
#if defined(HAVE_GETEUID)
|
||||||
/* check if we have sufficient permission for the requested operation */
|
/* check if we have sufficient permission for the requested operation */
|
||||||
if(myuid > 0) {
|
if(myuid > 0) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue