summaryrefslogtreecommitdiff
path: root/lib/libalpm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/db.c2
-rw-r--r--lib/libalpm/deps.c4
-rw-r--r--lib/libalpm/trans.c2
-rw-r--r--lib/libalpm/util.c11
-rw-r--r--lib/libalpm/util.h1
5 files changed, 14 insertions, 6 deletions
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index 54a31e95..3bddea65 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -648,7 +648,7 @@ int _alpm_prov_cmp(const void *provision, const void *needle)
char *tmpptr;
char *provname = strdup(provision);
int retval = 0;
- tmpptr = strchr(provname, ' ');
+ tmpptr = strchr(provname, '=');
if(tmpptr != NULL) { /* provision-version */
*tmpptr='\0';
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index 46cdc0c3..12da6b09 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -343,10 +343,10 @@ int SYMEXPORT alpm_depcmp(pmpkg_t *pkg, pmdepend_t *dep)
satisfy = (strcmp(pkgname, dep->name) == 0
&& dep_vercmp(pkgversion, dep->mod, dep->version));
- /* check provisions, format : "name version" */
+ /* check provisions, format : "name=version" */
for(i = alpm_pkg_get_provides(pkg); i && !satisfy; i = i->next) {
char *provname = strdup(i->data);
- char *provver = strchr(provname, ' ');
+ char *provver = strchr(provname, '=');
if(provver == NULL) { /* no provision version */
satisfy = (dep->mod == PM_DEP_MOD_ANY
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c
index 292c7160..ecc40a0f 100644
--- a/lib/libalpm/trans.c
+++ b/lib/libalpm/trans.c
@@ -487,7 +487,7 @@ int _alpm_runscriptlet(const char *root, const char *installfn,
/* creates a directory in $root/tmp/ for copying/extracting the scriptlet */
snprintf(tmpdir, PATH_MAX, "%stmp/", root);
if(stat(tmpdir, &buf)) {
- _alpm_makepath(tmpdir);
+ _alpm_makepath_mode(tmpdir, 01777);
}
snprintf(tmpdir, PATH_MAX, "%stmp/alpm_XXXXXX", root);
if(mkdtemp(tmpdir) == NULL) {
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index d09b9b14..e1413a25 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -178,9 +178,14 @@ char* strsep(char** str, const char* delims)
}
#endif
-/* does the same thing as 'mkdir -p' */
int _alpm_makepath(const char *path)
{
+ return(_alpm_makepath_mode(path, 0755));
+}
+
+/* does the same thing as 'mkdir -p' */
+int _alpm_makepath_mode(const char *path, mode_t mode)
+{
char *orig, *str, *ptr;
char full[PATH_MAX] = "";
mode_t oldmask;
@@ -196,7 +201,7 @@ int _alpm_makepath(const char *path)
strcat(full, "/");
strcat(full, ptr);
if(stat(full, &buf)) {
- if(mkdir(full, 0755)) {
+ if(mkdir(full, mode)) {
FREE(orig);
umask(oldmask);
_alpm_log(PM_LOG_ERROR, _("failed to make path '%s' : %s\n"),
@@ -399,6 +404,8 @@ int _alpm_unpack(const char *archive, const char *prefix, const char *fn)
if(S_ISREG(st->st_mode)) {
archive_entry_set_mode(entry, 0644);
+ } else if(S_ISDIR(st->st_mode)) {
+ archive_entry_set_mode(entry, 0755);
}
if (fn && strcmp(fn, entryname)) {
diff --git a/lib/libalpm/util.h b/lib/libalpm/util.h
index 8db26350..4a06e3b0 100644
--- a/lib/libalpm/util.h
+++ b/lib/libalpm/util.h
@@ -51,6 +51,7 @@
#define ASSERT(cond, action) do { if(!(cond)) { action; } } while(0)
int _alpm_makepath(const char *path);
+int _alpm_makepath_mode(const char *path, mode_t mode);
int _alpm_copyfile(const char *src, const char *dest);
char *_alpm_strtrim(char *str);
char *_alpm_strreplace(const char *str, const char *needle, const char *replace);