Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2011-07-02 02:01:39 +1000
committerAllan McRae <allan@archlinux.org>2011-07-02 02:01:39 +1000
commit39262acab6b956bbc4491d3b90e967a09828e732 (patch)
tree4ee755d8b2d28f16be40cca77f80e6e2f0a5fbfe /lib
parentca43fdd92f06a6997c53e45bfed6fb27f3044de5 (diff)
Prefix alpm_transflag_t members with ALPM
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/add.c18
-rw-r--r--lib/libalpm/alpm.h34
-rw-r--r--lib/libalpm/deps.c2
-rw-r--r--lib/libalpm/remove.c26
-rw-r--r--lib/libalpm/sync.c10
-rw-r--r--lib/libalpm/trans.c6
6 files changed, 48 insertions, 48 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index df636fbd..71aca940 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -81,12 +81,12 @@ int SYMEXPORT alpm_add_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg)
int cmp = _alpm_pkg_compare_versions(pkg, local);
if(cmp == 0) {
- if(trans->flags & PM_TRANS_FLAG_NEEDED) {
+ if(trans->flags & ALPM_TRANS_FLAG_NEEDED) {
/* with the NEEDED flag, packages up to date are not reinstalled */
_alpm_log(handle, ALPM_LOG_WARNING, _("%s-%s is up to date -- skipping\n"),
localpkgname, localpkgver);
return 0;
- } else if(!(trans->flags & PM_TRANS_FLAG_DOWNLOADONLY)) {
+ } else if(!(trans->flags & ALPM_TRANS_FLAG_DOWNLOADONLY)) {
_alpm_log(handle, ALPM_LOG_WARNING, _("%s-%s is up to date -- reinstalling\n"),
localpkgname, localpkgver);
}
@@ -415,7 +415,7 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive,
_alpm_log(handle, ALPM_LOG_DEBUG, "extracting %s\n", filename);
}
- if(handle->trans->flags & PM_TRANS_FLAG_FORCE) {
+ if(handle->trans->flags & ALPM_TRANS_FLAG_FORCE) {
/* if FORCE was used, unlink() each file (whether it's there
* or not) before extracting. This prevents the old "Text file busy"
* error that crops up if forcing a glibc or pacman upgrade. */
@@ -479,7 +479,7 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
newpkg->reason = alpm_pkg_get_reason(oldpkg);
/* pre_upgrade scriptlet */
- if(alpm_pkg_has_scriptlet(newpkg) && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) {
+ if(alpm_pkg_has_scriptlet(newpkg) && !(trans->flags & ALPM_TRANS_FLAG_NOSCRIPTLET)) {
_alpm_runscriptlet(handle, newpkg->origin_data.file,
"pre_upgrade", newpkg->version, oldpkg->version);
}
@@ -491,16 +491,16 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
newpkg->name, newpkg->version);
/* pre_install scriptlet */
- if(alpm_pkg_has_scriptlet(newpkg) && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) {
+ if(alpm_pkg_has_scriptlet(newpkg) && !(trans->flags & ALPM_TRANS_FLAG_NOSCRIPTLET)) {
_alpm_runscriptlet(handle, newpkg->origin_data.file,
"pre_install", newpkg->version, NULL);
}
}
/* we override any pre-set reason if we have alldeps or allexplicit set */
- if(trans->flags & PM_TRANS_FLAG_ALLDEPS) {
+ if(trans->flags & ALPM_TRANS_FLAG_ALLDEPS) {
newpkg->reason = ALPM_PKG_REASON_DEPEND;
- } else if(trans->flags & PM_TRANS_FLAG_ALLEXPLICIT) {
+ } else if(trans->flags & ALPM_TRANS_FLAG_ALLEXPLICIT) {
newpkg->reason = ALPM_PKG_REASON_EXPLICIT;
}
@@ -523,7 +523,7 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
goto cleanup;
}
- if(!(trans->flags & PM_TRANS_FLAG_DBONLY)) {
+ if(!(trans->flags & ALPM_TRANS_FLAG_DBONLY)) {
struct archive *archive;
struct archive_entry *entry;
char cwd[PATH_MAX] = "";
@@ -658,7 +658,7 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
/* run the post-install script if it exists */
if(alpm_pkg_has_scriptlet(newpkg)
- && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) {
+ && !(trans->flags & ALPM_TRANS_FLAG_NOSCRIPTLET)) {
if(is_upgrade) {
_alpm_runscriptlet(handle, scriptlet, "post_upgrade",
alpm_pkg_get_version(newpkg),
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index f7e355d2..488871a7 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -732,39 +732,39 @@ alpm_pkg_t *alpm_sync_newversion(alpm_pkg_t *pkg, alpm_list_t *dbs_sync);
/** Transaction flags */
typedef enum _alpm_transflag_t {
/** Ignore dependency checks. */
- PM_TRANS_FLAG_NODEPS = 1,
+ ALPM_TRANS_FLAG_NODEPS = 1,
/** Ignore file conflicts and overwrite files. */
- PM_TRANS_FLAG_FORCE = (1 << 1),
+ ALPM_TRANS_FLAG_FORCE = (1 << 1),
/** Delete files even if they are tagged as backup. */
- PM_TRANS_FLAG_NOSAVE = (1 << 2),
+ ALPM_TRANS_FLAG_NOSAVE = (1 << 2),
/** Ignore version numbers when checking dependencies. */
- PM_TRANS_FLAG_NODEPVERSION = (1 << 3),
+ ALPM_TRANS_FLAG_NODEPVERSION = (1 << 3),
/** Remove also any packages depending on a package being removed. */
- PM_TRANS_FLAG_CASCADE = (1 << 4),
+ ALPM_TRANS_FLAG_CASCADE = (1 << 4),
/** Remove packages and their unneeded deps (not explicitly installed). */
- PM_TRANS_FLAG_RECURSE = (1 << 5),
+ ALPM_TRANS_FLAG_RECURSE = (1 << 5),
/** Modify database but do not commit changes to the filesystem. */
- PM_TRANS_FLAG_DBONLY = (1 << 6),
+ ALPM_TRANS_FLAG_DBONLY = (1 << 6),
/* (1 << 7) flag can go here */
/** Use ALPM_PKG_REASON_DEPEND when installing packages. */
- PM_TRANS_FLAG_ALLDEPS = (1 << 8),
+ ALPM_TRANS_FLAG_ALLDEPS = (1 << 8),
/** Only download packages and do not actually install. */
- PM_TRANS_FLAG_DOWNLOADONLY = (1 << 9),
+ ALPM_TRANS_FLAG_DOWNLOADONLY = (1 << 9),
/** Do not execute install scriptlets after installing. */
- PM_TRANS_FLAG_NOSCRIPTLET = (1 << 10),
+ ALPM_TRANS_FLAG_NOSCRIPTLET = (1 << 10),
/** Ignore dependency conflicts. */
- PM_TRANS_FLAG_NOCONFLICTS = (1 << 11),
+ ALPM_TRANS_FLAG_NOCONFLICTS = (1 << 11),
/* (1 << 12) flag can go here */
/** Do not install a package if it is already installed and up to date. */
- PM_TRANS_FLAG_NEEDED = (1 << 13),
+ ALPM_TRANS_FLAG_NEEDED = (1 << 13),
/** Use ALPM_PKG_REASON_EXPLICIT when installing packages. */
- PM_TRANS_FLAG_ALLEXPLICIT = (1 << 14),
+ ALPM_TRANS_FLAG_ALLEXPLICIT = (1 << 14),
/** Do not remove a package if it is needed by another one. */
- PM_TRANS_FLAG_UNNEEDED = (1 << 15),
- /** Remove also explicitly installed unneeded deps (use with PM_TRANS_FLAG_RECURSE). */
- PM_TRANS_FLAG_RECURSEALL = (1 << 16),
+ ALPM_TRANS_FLAG_UNNEEDED = (1 << 15),
+ /** Remove also explicitly installed unneeded deps (use with ALPM_TRANS_FLAG_RECURSE). */
+ ALPM_TRANS_FLAG_RECURSEALL = (1 << 16),
/** Do not lock the database during the operation. */
- PM_TRANS_FLAG_NOLOCK = (1 << 17)
+ ALPM_TRANS_FLAG_NOLOCK = (1 << 17)
} alpm_transflag_t;
/** Transaction events.
diff --git a/lib/libalpm/deps.c b/lib/libalpm/deps.c
index 874787f5..066f5703 100644
--- a/lib/libalpm/deps.c
+++ b/lib/libalpm/deps.c
@@ -205,7 +205,7 @@ alpm_list_t *_alpm_sortbydeps(alpm_handle_t *handle,
static int no_dep_version(alpm_handle_t *handle)
{
int flags = alpm_trans_get_flags(handle);
- return flags != -1 && (flags & PM_TRANS_FLAG_NODEPVERSION);
+ return flags != -1 && (flags & ALPM_TRANS_FLAG_NODEPVERSION);
}
static alpm_depend_t *filtered_depend(alpm_depend_t *dep, int nodepversion)
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c
index 4c0d4791..ed9f2767 100644
--- a/lib/libalpm/remove.c
+++ b/lib/libalpm/remove.c
@@ -140,22 +140,22 @@ int _alpm_remove_prepare(alpm_handle_t *handle, alpm_list_t **data)
alpm_trans_t *trans = handle->trans;
alpm_db_t *db = handle->db_local;
- if((trans->flags & PM_TRANS_FLAG_RECURSE) && !(trans->flags & PM_TRANS_FLAG_CASCADE)) {
+ if((trans->flags & ALPM_TRANS_FLAG_RECURSE) && !(trans->flags & ALPM_TRANS_FLAG_CASCADE)) {
_alpm_log(handle, ALPM_LOG_DEBUG, "finding removable dependencies\n");
_alpm_recursedeps(db, trans->remove,
- trans->flags & PM_TRANS_FLAG_RECURSEALL);
+ trans->flags & ALPM_TRANS_FLAG_RECURSEALL);
}
- if(!(trans->flags & PM_TRANS_FLAG_NODEPS)) {
+ if(!(trans->flags & ALPM_TRANS_FLAG_NODEPS)) {
EVENT(trans, PM_TRANS_EVT_CHECKDEPS_START, NULL, NULL);
_alpm_log(handle, ALPM_LOG_DEBUG, "looking for unsatisfied dependencies\n");
lp = alpm_checkdeps(handle, _alpm_db_get_pkgcache(db), trans->remove, NULL, 1);
if(lp != NULL) {
- if(trans->flags & PM_TRANS_FLAG_CASCADE) {
+ if(trans->flags & ALPM_TRANS_FLAG_CASCADE) {
remove_prepare_cascade(handle, lp);
- } else if(trans->flags & PM_TRANS_FLAG_UNNEEDED) {
+ } else if(trans->flags & ALPM_TRANS_FLAG_UNNEEDED) {
/* Remove needed packages (which would break dependencies)
* from target list */
remove_prepare_keep_needed(handle, lp);
@@ -179,12 +179,12 @@ int _alpm_remove_prepare(alpm_handle_t *handle, alpm_list_t **data)
trans->remove = lp;
/* -Rcs == -Rc then -Rs */
- if((trans->flags & PM_TRANS_FLAG_CASCADE) && (trans->flags & PM_TRANS_FLAG_RECURSE)) {
+ if((trans->flags & ALPM_TRANS_FLAG_CASCADE) && (trans->flags & ALPM_TRANS_FLAG_RECURSE)) {
_alpm_log(handle, ALPM_LOG_DEBUG, "finding removable dependencies\n");
- _alpm_recursedeps(db, trans->remove, trans->flags & PM_TRANS_FLAG_RECURSEALL);
+ _alpm_recursedeps(db, trans->remove, trans->flags & ALPM_TRANS_FLAG_RECURSEALL);
}
- if(!(trans->flags & PM_TRANS_FLAG_NODEPS)) {
+ if(!(trans->flags & ALPM_TRANS_FLAG_NODEPS)) {
EVENT(trans, PM_TRANS_EVT_CHECKDEPS_DONE, NULL, NULL);
}
@@ -294,7 +294,7 @@ int _alpm_upgraderemove_package(alpm_handle_t *handle,
_alpm_log(handle, ALPM_LOG_DEBUG, "removing old package first (%s-%s)\n",
oldpkg->name, oldpkg->version);
- if(handle->trans->flags & PM_TRANS_FLAG_DBONLY) {
+ if(handle->trans->flags & ALPM_TRANS_FLAG_DBONLY) {
goto db;
}
@@ -383,12 +383,12 @@ int _alpm_remove_packages(alpm_handle_t *handle)
pkgname, alpm_pkg_get_version(info));
/* run the pre-remove scriptlet if it exists */
- if(alpm_pkg_has_scriptlet(info) && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) {
+ if(alpm_pkg_has_scriptlet(info) && !(trans->flags & ALPM_TRANS_FLAG_NOSCRIPTLET)) {
_alpm_runscriptlet(handle, scriptlet, "pre_remove",
alpm_pkg_get_version(info), NULL);
}
- if(!(trans->flags & PM_TRANS_FLAG_DBONLY)) {
+ if(!(trans->flags & ALPM_TRANS_FLAG_DBONLY)) {
alpm_list_t *files = alpm_pkg_get_files(info);
alpm_list_t *newfiles;
size_t filenum = 0;
@@ -412,7 +412,7 @@ int _alpm_remove_packages(alpm_handle_t *handle)
newfiles = alpm_list_reverse(files);
for(lp = newfiles; lp; lp = alpm_list_next(lp)) {
int percent;
- unlink_file(handle, info, lp->data, NULL, trans->flags & PM_TRANS_FLAG_NOSAVE);
+ unlink_file(handle, info, lp->data, NULL, trans->flags & ALPM_TRANS_FLAG_NOSAVE);
/* update progress bar after each file */
percent = (position * 100) / filenum;
@@ -428,7 +428,7 @@ int _alpm_remove_packages(alpm_handle_t *handle)
pkg_count, (pkg_count - targcount + 1));
/* run the post-remove script if it exists */
- if(alpm_pkg_has_scriptlet(info) && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) {
+ if(alpm_pkg_has_scriptlet(info) && !(trans->flags & ALPM_TRANS_FLAG_NOSCRIPTLET)) {
_alpm_runscriptlet(handle, scriptlet, "post_remove",
alpm_pkg_get_version(info), NULL);
}
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index c82665fc..410cbc7d 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -315,7 +315,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
*data = NULL;
}
- if(!(trans->flags & PM_TRANS_FLAG_NODEPS)) {
+ if(!(trans->flags & ALPM_TRANS_FLAG_NODEPS)) {
alpm_list_t *resolved = NULL; /* target list after resolvedeps */
/* Build up list by repeatedly resolving each transaction package */
@@ -394,7 +394,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
EVENT(trans, PM_TRANS_EVT_RESOLVEDEPS_DONE, NULL, NULL);
}
- if(!(trans->flags & PM_TRANS_FLAG_NOCONFLICTS)) {
+ if(!(trans->flags & ALPM_TRANS_FLAG_NOCONFLICTS)) {
/* check for inter-conflicts and whatnot */
EVENT(trans, PM_TRANS_EVT_INTERCONFLICTS_START, NULL, NULL);
@@ -523,7 +523,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
}
}
- if(!(trans->flags & PM_TRANS_FLAG_NODEPS)) {
+ if(!(trans->flags & ALPM_TRANS_FLAG_NODEPS)) {
_alpm_log(handle, ALPM_LOG_DEBUG, "checking dependencies\n");
deps = alpm_checkdeps(handle, _alpm_db_get_pkgcache(handle->db_local),
trans->remove, trans->add, 1);
@@ -904,7 +904,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data)
RET_ERR(handle, PM_ERR_PKG_INVALID, -1);
}
- if(trans->flags & PM_TRANS_FLAG_DOWNLOADONLY) {
+ if(trans->flags & ALPM_TRANS_FLAG_DOWNLOADONLY) {
return 0;
}
@@ -913,7 +913,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data)
replaces = alpm_list_count(trans->remove);
/* fileconflict check */
- if(!(trans->flags & PM_TRANS_FLAG_FORCE)) {
+ if(!(trans->flags & ALPM_TRANS_FLAG_FORCE)) {
EVENT(trans, PM_TRANS_EVT_FILECONFLICTS_START, NULL, NULL);
_alpm_log(handle, ALPM_LOG_DEBUG, "looking for file conflicts\n");
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c
index d6cc3b55..01e7ccd8 100644
--- a/lib/libalpm/trans.c
+++ b/lib/libalpm/trans.c
@@ -67,7 +67,7 @@ int SYMEXPORT alpm_trans_init(alpm_handle_t *handle, alpm_transflag_t flags,
}
/* lock db */
- if(!(flags & PM_TRANS_FLAG_NOLOCK)) {
+ if(!(flags & ALPM_TRANS_FLAG_NOLOCK)) {
if(_alpm_handle_lock(handle)) {
RET_ERR(handle, PM_ERR_HANDLE_LOCK, -1);
}
@@ -167,7 +167,7 @@ int SYMEXPORT alpm_trans_commit(alpm_handle_t *handle, alpm_list_t **data)
ASSERT(trans != NULL, RET_ERR(handle, PM_ERR_TRANS_NULL, -1));
ASSERT(trans->state == STATE_PREPARED, RET_ERR(handle, PM_ERR_TRANS_NOT_PREPARED, -1));
- ASSERT(!(trans->flags & PM_TRANS_FLAG_NOLOCK), RET_ERR(handle, PM_ERR_TRANS_NOT_LOCKED, -1));
+ ASSERT(!(trans->flags & ALPM_TRANS_FLAG_NOLOCK), RET_ERR(handle, PM_ERR_TRANS_NOT_LOCKED, -1));
/* If there's nothing to do, return without complaining */
if(trans->add == NULL && trans->remove == NULL) {
@@ -223,7 +223,7 @@ int SYMEXPORT alpm_trans_release(alpm_handle_t *handle)
ASSERT(trans != NULL, RET_ERR(handle, PM_ERR_TRANS_NULL, -1));
ASSERT(trans->state != STATE_IDLE, RET_ERR(handle, PM_ERR_TRANS_NULL, -1));
- int nolock_flag = trans->flags & PM_TRANS_FLAG_NOLOCK;
+ int nolock_flag = trans->flags & ALPM_TRANS_FLAG_NOLOCK;
_alpm_trans_free(trans);
handle->trans = NULL;