summaryrefslogtreecommitdiff
path: root/lib/libalpm
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2007-01-03 08:05:13 +0000
committerAaron Griffin <aaron@archlinux.org>2007-01-03 08:05:13 +0000
commit043a49701f5f11429199428a4cc1a084b5f297a9 (patch)
tree262f6805d7cd8299c729cb4e4362ef45bcd327d1 /lib/libalpm
parent50030f778a59394c5aab2ee484e0123f88581fcc (diff)
* bug fix FS#6100 - fix --print-uris output
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/add.c4
-rw-r--r--lib/libalpm/alpm.c5
-rw-r--r--lib/libalpm/sync.c3
3 files changed, 10 insertions, 2 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index 778bb888..344f04d3 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -124,6 +124,10 @@ int _alpm_add_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name)
_alpm_log(PM_LOG_FLOW2, _("loading target '%s'"), name);
+ /* TODO FS#5120 we need a better way to check if a package is a valid package,
+ * and read the metadata instead of relying on the filename for package name
+ * and version
+ */
if(stat(name, &buf)) {
pm_errno = PM_ERR_NOT_A_FILE;
goto error;
diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c
index a7fb0a99..a5ee8c40 100644
--- a/lib/libalpm/alpm.c
+++ b/lib/libalpm/alpm.c
@@ -717,7 +717,10 @@ int alpm_trans_commit(pmlist_t **data)
ASSERT(handle->trans->state == STATE_PREPARED, RET_ERR(PM_ERR_TRANS_NOT_PREPARED, -1));
/* Check for database R/W permission */
- ASSERT(handle->access == PM_ACCESS_RW, RET_ERR(PM_ERR_BADPERMS, -1));
+ if(!(handle->trans->flags & PM_TRANS_FLAG_PRINTURIS)) {
+ /* The print-uris operation is a bit odd. So we explicitly check for it */
+ ASSERT(handle->access == PM_ACCESS_RW, RET_ERR(PM_ERR_BADPERMS, -1));
+ }
return(_alpm_trans_commit(handle->trans, data));
}
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 956ebf47..0234861f 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -489,7 +489,8 @@ int _alpm_sync_prepare(pmtrans_t *trans, pmdb_t *db_local, pmlist_t *dbs_sync, p
FREELISTPTR(trail);
}
- if(!(trans->flags & PM_TRANS_FLAG_NOCONFLICTS)) {
+ /* We don't care about conflicts if we're just printing uris */
+ if(!(trans->flags & (PM_TRANS_FLAG_NOCONFLICTS | PM_TRANS_FLAG_PRINTURIS))) {
/* check for inter-conflicts and whatnot */
EVENT(trans, PM_TRANS_EVT_INTERCONFLICTS_START, NULL, NULL);