index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Andrew Gregory <andrew.gregory.8@gmail.com> | 2014-02-07 13:04:58 -0500 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2014-03-03 11:25:54 +1000 |
commit | 9bfd6ff2756f0f2f164d28886cfe991010e9ae41 (patch) | |
tree | 76c17f29bff03f1435a3c4cc889b5d11fc73823a /lib/libalpm | |
parent | bd3d1a17c2ec4297f05d092f0b93d025f811aa8a (diff) |
-rw-r--r-- | lib/libalpm/add.c | 2 | ||||
-rw-r--r-- | lib/libalpm/remove.c | 2 |
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index b0f97d89..45e16847 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -57,6 +57,8 @@ int SYMEXPORT alpm_add_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg) /* Sanity checks */ CHECK_HANDLE(handle, return -1); ASSERT(pkg != NULL, RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1)); + ASSERT(pkg->origin != ALPM_PKG_FROM_LOCALDB, + RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1)); ASSERT(handle == pkg->handle, RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1)); trans = handle->trans; ASSERT(trans != NULL, RET_ERR(handle, ALPM_ERR_TRANS_NULL, -1)); diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index dce55784..132b30c6 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -63,6 +63,8 @@ int SYMEXPORT alpm_remove_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg) /* Sanity checks */ CHECK_HANDLE(handle, return -1); ASSERT(pkg != NULL, RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1)); + ASSERT(pkg->origin == ALPM_PKG_FROM_LOCALDB, + RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1)); ASSERT(handle == pkg->handle, RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1)); trans = handle->trans; ASSERT(trans != NULL, RET_ERR(handle, ALPM_ERR_TRANS_NULL, -1)); |