aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Woodward2018-06-27 19:29:41 -0400
committerJason Woodward2018-06-27 19:29:41 -0400
commit691382010180f312d1918469bfaa10264ef9861a (patch)
tree8043ae67845a7e250f9aeeabb87c313ffc8dd57e /src
parent198f5aa791e4d9bcc7dea88c587beea4f05767e9 (diff)
downloadslapt-get-691382010180f312d1918469bfaa10264ef9861a.tar.gz
support package data in /var/lib/pkgtools (fix path)
Diffstat (limited to 'src')
-rw-r--r--src/package.c6
-rw-r--r--src/package.h2
2 files changed, 3 insertions, 5 deletions
diff --git a/src/package.c b/src/package.c
index d871a6a..dbf74bf 100644
--- a/src/package.c
+++ b/src/package.c
@@ -3483,10 +3483,6 @@ char *slapt_gen_package_log_dir_name(void)
if (getenv(SLAPT_ROOT_ENV_NAME) && strlen(getenv(SLAPT_ROOT_ENV_NAME)) < SLAPT_ROOT_ENV_LEN) {
root_env_entry = getenv(SLAPT_ROOT_ENV_NAME);
}
- pkg_log_dirname = slapt_calloc(
- strlen(SLAPT_PKG_LOG_DIR) +
- (root_env_entry ? strlen(root_env_entry) : 0) + 1,
- sizeof *pkg_log_dirname);
if (stat(SLAPT_PKG_LOG_DIR, &stat_buf) == 0) {
path = SLAPT_PKG_LOG_DIR;
@@ -3494,6 +3490,8 @@ char *slapt_gen_package_log_dir_name(void)
path = SLAPT_OLD_PKG_LOG_DIR;
}
+ pkg_log_dirname = slapt_calloc(strlen(path) + (root_env_entry ? strlen(root_env_entry) : 0) + 1, sizeof *pkg_log_dirname);
+
*pkg_log_dirname = '\0';
if (root_env_entry) {
strncpy(pkg_log_dirname, root_env_entry, strlen(root_env_entry));
diff --git a/src/package.h b/src/package.h
index d7b9af5..c93cfc7 100644
--- a/src/package.h
+++ b/src/package.h
@@ -28,7 +28,7 @@
#define SLAPT_PKG_LOG_SIZEC_PATTERN "^COMPRESSED PACKAGE SIZE:[ ]{1,}([0-9\\.]{1,})[ ]{0,}([MK])$"
#define SLAPT_PKG_LOG_SIZEU_PATTERN "^UNCOMPRESSED PACKAGE SIZE:[ ]{1,}([0-9\\.]{1,})[ ]{0,}([MK])$"
#define SLAPT_OLD_PKG_LOG_DIR "/var/log/packages"
-#define SLAPT_PKG_LOG_DIR "/var/lib/pkgtools"
+#define SLAPT_PKG_LOG_DIR "/var/lib/pkgtools/packages"
#define SLAPT_ROOT_ENV_NAME "ROOT"
#define SLAPT_ROOT_ENV_LEN 255
#define SLAPT_PKG_LOG_PATTERN "^(.*{1,})\\-(.*[\\-].*[\\-].*)"