]> git.ipfire.org Git - pakfire.git/commitdiff
configure: Add PAKFIRE_TMP_DIR
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 30 Sep 2021 14:57:30 +0000 (14:57 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 30 Sep 2021 14:57:30 +0000 (14:57 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
configure.ac
src/libpakfire/keystore.c
src/libpakfire/packager.c
src/libpakfire/pakfire.c
src/libpakfire/repo.c
src/libpakfire/request.c

index 080f0a6203a770eed0ebe575a4cd1b8ecb01e0f2..0ec3ae5f3365d7f5aae2834a53991d6d404256f2 100644 (file)
@@ -254,11 +254,13 @@ AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir"])
 AC_DEFINE_UNQUOTED([PAKFIRE_CONFIG_DIR], ["${sysconfdir}/${PACKAGE_NAME}"],
        [The path where Pakfire stores configuration files])
 AC_DEFINE_UNQUOTED([PAKFIRE_CACHE_DIR], ["/var/cache/${PACKAGE_NAME}"],
-       [The path where Pakfire stores temporary data])
+       [The path where Pakfire caches downloaded data])
 AC_DEFINE_UNQUOTED([PAKFIRE_PRIVATE_DIR], ["/var/lib/${PACKAGE_NAME}"],
        [The path where Pakfire stores its private data])
 AC_DEFINE_UNQUOTED([PAKFIRE_SCRIPTS_DIR], ["${PREFIX}/lib/${PACKAGE_NAME}"],
        [The path where Pakfire stores its scripts])
+AC_DEFINE_UNQUOTED([PAKFIRE_TMP_DIR], ["/var/tmp/${PACKAGE_NAME}"],
+       [The path where Pakfire stores temporary data])
 
 AC_CONFIG_FILES([
        Makefile
index 6e5b8bb2ce3bc70d8d07390d3f489207e5390715..04620705b780bc7c03b1db0d240af7662e13ce95 100644 (file)
@@ -104,7 +104,7 @@ ERROR:
 }
 
 int pakfire_keystore_init(struct pakfire* pakfire, gpgme_ctx_t* ctx) {
-       char path[PATH_MAX] = PAKFIRE_CACHE_DIR "/tmp/pakfire-keystore.XXXXXX";
+       char path[PATH_MAX] = PAKFIRE_TMP_DIR "/pakfire-keystore.XXXXXX";
        char* tmp = NULL;
 
        // Initialise GPGME
index 15148967c81fd51f42613df016b8df716dd7073f..bdce258a199d2e360abc9cc53f30fe4db164b82c 100644 (file)
@@ -65,7 +65,7 @@ struct pakfire_packager {
 
 static int pakfire_packager_create_mtree(struct pakfire* pakfire, struct archive** mtree,
                FILE** f, const char** fields) {
-       char path[] = PAKFIRE_PRIVATE_DIR "/tmp/.pakfire-mtree.XXXXXX";
+       char path[] = PAKFIRE_TMP_DIR "/.pakfire-mtree.XXXXXX";
        int r;
 
        // Create an mtree
@@ -133,7 +133,7 @@ ERROR:
 }
 
 static int pakfire_packager_create_payload(struct pakfire_packager* p) {
-       char path[] = PAKFIRE_PRIVATE_DIR "/tmp/.pakfire-payload.XXXXXX";
+       char path[] = PAKFIRE_TMP_DIR "/.pakfire-payload.XXXXXX";
 
        // Do not compress source packages
        const int compress = !pakfire_package_is_source(p->pkg);
index 5b21cf5720cabffa9cad7ae20d87dc454f8379b8..8bde301e118a508972480141e47ba0360ec3c03e 100644 (file)
@@ -819,7 +819,7 @@ ERROR:
 PAKFIRE_EXPORT int pakfire_create(struct pakfire** pakfire, const char* path,
                const char* arch, const char* conf, int flags, pakfire_log_function_t log,
                void* data) {
-       char tempdir[PATH_MAX] = PAKFIRE_PRIVATE_DIR "/tmp/XXXXXX";
+       char tempdir[PATH_MAX] = PAKFIRE_TMP_DIR "/XXXXXX";
        int r = 1;
 
        // Default to the native architecture
index dedd6bacd8aef78902b792a1ca6f6b610ed0a981..542c66bd943a1e53ad9d499fd06fd53797137b26 100644 (file)
@@ -125,7 +125,7 @@ static int pakfire_repo_import_key(struct pakfire_repo* repo, const char* url) {
        const char* name = pakfire_repo_get_name(repo);
        DEBUG(repo->pakfire, "Importing key for repository %s from %s...\n", name, url);
 
-       char path[PATH_MAX] = PAKFIRE_CACHE_DIR "/tmp/XXXXXX";
+       char path[PATH_MAX] = PAKFIRE_TMP_DIR "/XXXXXX";
        struct pakfire_key** keys = NULL;
 
        // Allocate a temporary file name
index 59f233815e01b32a381cd652b19fc3230b3e68fc..ab54a191f2b8d984368ea227d6868602ccc7054f 100644 (file)
@@ -490,7 +490,7 @@ static int pakfire_request_cleanup_file(
 static int pakfire_request_add_url(struct pakfire_request* request, int action,
                const char* url, int extra_flags) {
        struct pakfire_downloader* downloader;
-       char path[PATH_MAX] = PAKFIRE_CACHE_DIR "/tmp/XXXXXX";
+       char path[PATH_MAX] = PAKFIRE_TMP_DIR "/XXXXXX";
 
        // Allocate a temporary file name
        FILE* f = pakfire_mktemp(path);