Prefix alpm_transflag_t members with ALPM
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
ca43fdd92f
commit
39262acab6
10 changed files with 73 additions and 73 deletions
|
@ -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);
|
int cmp = _alpm_pkg_compare_versions(pkg, local);
|
||||||
|
|
||||||
if(cmp == 0) {
|
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 */
|
/* 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"),
|
_alpm_log(handle, ALPM_LOG_WARNING, _("%s-%s is up to date -- skipping\n"),
|
||||||
localpkgname, localpkgver);
|
localpkgname, localpkgver);
|
||||||
return 0;
|
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"),
|
_alpm_log(handle, ALPM_LOG_WARNING, _("%s-%s is up to date -- reinstalling\n"),
|
||||||
localpkgname, localpkgver);
|
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);
|
_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
|
/* if FORCE was used, unlink() each file (whether it's there
|
||||||
* or not) before extracting. This prevents the old "Text file busy"
|
* or not) before extracting. This prevents the old "Text file busy"
|
||||||
* error that crops up if forcing a glibc or pacman upgrade. */
|
* 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);
|
newpkg->reason = alpm_pkg_get_reason(oldpkg);
|
||||||
|
|
||||||
/* pre_upgrade scriptlet */
|
/* 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,
|
_alpm_runscriptlet(handle, newpkg->origin_data.file,
|
||||||
"pre_upgrade", newpkg->version, oldpkg->version);
|
"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);
|
newpkg->name, newpkg->version);
|
||||||
|
|
||||||
/* pre_install scriptlet */
|
/* 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,
|
_alpm_runscriptlet(handle, newpkg->origin_data.file,
|
||||||
"pre_install", newpkg->version, NULL);
|
"pre_install", newpkg->version, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* we override any pre-set reason if we have alldeps or allexplicit set */
|
/* 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;
|
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;
|
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;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!(trans->flags & PM_TRANS_FLAG_DBONLY)) {
|
if(!(trans->flags & ALPM_TRANS_FLAG_DBONLY)) {
|
||||||
struct archive *archive;
|
struct archive *archive;
|
||||||
struct archive_entry *entry;
|
struct archive_entry *entry;
|
||||||
char cwd[PATH_MAX] = "";
|
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 */
|
/* run the post-install script if it exists */
|
||||||
if(alpm_pkg_has_scriptlet(newpkg)
|
if(alpm_pkg_has_scriptlet(newpkg)
|
||||||
&& !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) {
|
&& !(trans->flags & ALPM_TRANS_FLAG_NOSCRIPTLET)) {
|
||||||
if(is_upgrade) {
|
if(is_upgrade) {
|
||||||
_alpm_runscriptlet(handle, scriptlet, "post_upgrade",
|
_alpm_runscriptlet(handle, scriptlet, "post_upgrade",
|
||||||
alpm_pkg_get_version(newpkg),
|
alpm_pkg_get_version(newpkg),
|
||||||
|
|
|
@ -732,39 +732,39 @@ alpm_pkg_t *alpm_sync_newversion(alpm_pkg_t *pkg, alpm_list_t *dbs_sync);
|
||||||
/** Transaction flags */
|
/** Transaction flags */
|
||||||
typedef enum _alpm_transflag_t {
|
typedef enum _alpm_transflag_t {
|
||||||
/** Ignore dependency checks. */
|
/** Ignore dependency checks. */
|
||||||
PM_TRANS_FLAG_NODEPS = 1,
|
ALPM_TRANS_FLAG_NODEPS = 1,
|
||||||
/** Ignore file conflicts and overwrite files. */
|
/** 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. */
|
/** 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. */
|
/** 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. */
|
/** 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). */
|
/** 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. */
|
/** 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 */
|
/* (1 << 7) flag can go here */
|
||||||
/** Use ALPM_PKG_REASON_DEPEND when installing packages. */
|
/** 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. */
|
/** 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. */
|
/** Do not execute install scriptlets after installing. */
|
||||||
PM_TRANS_FLAG_NOSCRIPTLET = (1 << 10),
|
ALPM_TRANS_FLAG_NOSCRIPTLET = (1 << 10),
|
||||||
/** Ignore dependency conflicts. */
|
/** Ignore dependency conflicts. */
|
||||||
PM_TRANS_FLAG_NOCONFLICTS = (1 << 11),
|
ALPM_TRANS_FLAG_NOCONFLICTS = (1 << 11),
|
||||||
/* (1 << 12) flag can go here */
|
/* (1 << 12) flag can go here */
|
||||||
/** Do not install a package if it is already installed and up to date. */
|
/** 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. */
|
/** 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. */
|
/** Do not remove a package if it is needed by another one. */
|
||||||
PM_TRANS_FLAG_UNNEEDED = (1 << 15),
|
ALPM_TRANS_FLAG_UNNEEDED = (1 << 15),
|
||||||
/** Remove also explicitly installed unneeded deps (use with PM_TRANS_FLAG_RECURSE). */
|
/** Remove also explicitly installed unneeded deps (use with ALPM_TRANS_FLAG_RECURSE). */
|
||||||
PM_TRANS_FLAG_RECURSEALL = (1 << 16),
|
ALPM_TRANS_FLAG_RECURSEALL = (1 << 16),
|
||||||
/** Do not lock the database during the operation. */
|
/** Do not lock the database during the operation. */
|
||||||
PM_TRANS_FLAG_NOLOCK = (1 << 17)
|
ALPM_TRANS_FLAG_NOLOCK = (1 << 17)
|
||||||
} alpm_transflag_t;
|
} alpm_transflag_t;
|
||||||
|
|
||||||
/** Transaction events.
|
/** Transaction events.
|
||||||
|
|
|
@ -205,7 +205,7 @@ alpm_list_t *_alpm_sortbydeps(alpm_handle_t *handle,
|
||||||
static int no_dep_version(alpm_handle_t *handle)
|
static int no_dep_version(alpm_handle_t *handle)
|
||||||
{
|
{
|
||||||
int flags = alpm_trans_get_flags(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)
|
static alpm_depend_t *filtered_depend(alpm_depend_t *dep, int nodepversion)
|
||||||
|
|
|
@ -140,22 +140,22 @@ int _alpm_remove_prepare(alpm_handle_t *handle, alpm_list_t **data)
|
||||||
alpm_trans_t *trans = handle->trans;
|
alpm_trans_t *trans = handle->trans;
|
||||||
alpm_db_t *db = handle->db_local;
|
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_log(handle, ALPM_LOG_DEBUG, "finding removable dependencies\n");
|
||||||
_alpm_recursedeps(db, trans->remove,
|
_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);
|
EVENT(trans, PM_TRANS_EVT_CHECKDEPS_START, NULL, NULL);
|
||||||
|
|
||||||
_alpm_log(handle, ALPM_LOG_DEBUG, "looking for unsatisfied dependencies\n");
|
_alpm_log(handle, ALPM_LOG_DEBUG, "looking for unsatisfied dependencies\n");
|
||||||
lp = alpm_checkdeps(handle, _alpm_db_get_pkgcache(db), trans->remove, NULL, 1);
|
lp = alpm_checkdeps(handle, _alpm_db_get_pkgcache(db), trans->remove, NULL, 1);
|
||||||
if(lp != NULL) {
|
if(lp != NULL) {
|
||||||
|
|
||||||
if(trans->flags & PM_TRANS_FLAG_CASCADE) {
|
if(trans->flags & ALPM_TRANS_FLAG_CASCADE) {
|
||||||
remove_prepare_cascade(handle, lp);
|
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)
|
/* Remove needed packages (which would break dependencies)
|
||||||
* from target list */
|
* from target list */
|
||||||
remove_prepare_keep_needed(handle, lp);
|
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;
|
trans->remove = lp;
|
||||||
|
|
||||||
/* -Rcs == -Rc then -Rs */
|
/* -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_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);
|
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",
|
_alpm_log(handle, ALPM_LOG_DEBUG, "removing old package first (%s-%s)\n",
|
||||||
oldpkg->name, oldpkg->version);
|
oldpkg->name, oldpkg->version);
|
||||||
|
|
||||||
if(handle->trans->flags & PM_TRANS_FLAG_DBONLY) {
|
if(handle->trans->flags & ALPM_TRANS_FLAG_DBONLY) {
|
||||||
goto db;
|
goto db;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -383,12 +383,12 @@ int _alpm_remove_packages(alpm_handle_t *handle)
|
||||||
pkgname, alpm_pkg_get_version(info));
|
pkgname, alpm_pkg_get_version(info));
|
||||||
|
|
||||||
/* run the pre-remove scriptlet if it exists */
|
/* 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_runscriptlet(handle, scriptlet, "pre_remove",
|
||||||
alpm_pkg_get_version(info), NULL);
|
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 *files = alpm_pkg_get_files(info);
|
||||||
alpm_list_t *newfiles;
|
alpm_list_t *newfiles;
|
||||||
size_t filenum = 0;
|
size_t filenum = 0;
|
||||||
|
@ -412,7 +412,7 @@ int _alpm_remove_packages(alpm_handle_t *handle)
|
||||||
newfiles = alpm_list_reverse(files);
|
newfiles = alpm_list_reverse(files);
|
||||||
for(lp = newfiles; lp; lp = alpm_list_next(lp)) {
|
for(lp = newfiles; lp; lp = alpm_list_next(lp)) {
|
||||||
int percent;
|
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 */
|
/* update progress bar after each file */
|
||||||
percent = (position * 100) / filenum;
|
percent = (position * 100) / filenum;
|
||||||
|
@ -428,7 +428,7 @@ int _alpm_remove_packages(alpm_handle_t *handle)
|
||||||
pkg_count, (pkg_count - targcount + 1));
|
pkg_count, (pkg_count - targcount + 1));
|
||||||
|
|
||||||
/* run the post-remove script if it exists */
|
/* 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_runscriptlet(handle, scriptlet, "post_remove",
|
||||||
alpm_pkg_get_version(info), NULL);
|
alpm_pkg_get_version(info), NULL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -315,7 +315,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
|
||||||
*data = NULL;
|
*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 */
|
alpm_list_t *resolved = NULL; /* target list after resolvedeps */
|
||||||
|
|
||||||
/* Build up list by repeatedly resolving each transaction package */
|
/* 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);
|
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 */
|
/* check for inter-conflicts and whatnot */
|
||||||
EVENT(trans, PM_TRANS_EVT_INTERCONFLICTS_START, NULL, NULL);
|
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");
|
_alpm_log(handle, ALPM_LOG_DEBUG, "checking dependencies\n");
|
||||||
deps = alpm_checkdeps(handle, _alpm_db_get_pkgcache(handle->db_local),
|
deps = alpm_checkdeps(handle, _alpm_db_get_pkgcache(handle->db_local),
|
||||||
trans->remove, trans->add, 1);
|
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);
|
RET_ERR(handle, PM_ERR_PKG_INVALID, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(trans->flags & PM_TRANS_FLAG_DOWNLOADONLY) {
|
if(trans->flags & ALPM_TRANS_FLAG_DOWNLOADONLY) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -913,7 +913,7 @@ int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data)
|
||||||
replaces = alpm_list_count(trans->remove);
|
replaces = alpm_list_count(trans->remove);
|
||||||
|
|
||||||
/* fileconflict check */
|
/* 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);
|
EVENT(trans, PM_TRANS_EVT_FILECONFLICTS_START, NULL, NULL);
|
||||||
|
|
||||||
_alpm_log(handle, ALPM_LOG_DEBUG, "looking for file conflicts\n");
|
_alpm_log(handle, ALPM_LOG_DEBUG, "looking for file conflicts\n");
|
||||||
|
|
|
@ -67,7 +67,7 @@ int SYMEXPORT alpm_trans_init(alpm_handle_t *handle, alpm_transflag_t flags,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* lock db */
|
/* lock db */
|
||||||
if(!(flags & PM_TRANS_FLAG_NOLOCK)) {
|
if(!(flags & ALPM_TRANS_FLAG_NOLOCK)) {
|
||||||
if(_alpm_handle_lock(handle)) {
|
if(_alpm_handle_lock(handle)) {
|
||||||
RET_ERR(handle, PM_ERR_HANDLE_LOCK, -1);
|
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 != 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->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 there's nothing to do, return without complaining */
|
||||||
if(trans->add == NULL && trans->remove == NULL) {
|
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 != NULL, RET_ERR(handle, PM_ERR_TRANS_NULL, -1));
|
||||||
ASSERT(trans->state != STATE_IDLE, 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);
|
_alpm_trans_free(trans);
|
||||||
handle->trans = NULL;
|
handle->trans = NULL;
|
||||||
|
|
|
@ -49,9 +49,9 @@ int pacman_database(alpm_list_t *targets)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(config->flags & PM_TRANS_FLAG_ALLDEPS) { /* --asdeps */
|
if(config->flags & ALPM_TRANS_FLAG_ALLDEPS) { /* --asdeps */
|
||||||
reason = ALPM_PKG_REASON_DEPEND;
|
reason = ALPM_PKG_REASON_DEPEND;
|
||||||
} else if(config->flags & PM_TRANS_FLAG_ALLEXPLICIT) { /* --asexplicit */
|
} else if(config->flags & ALPM_TRANS_FLAG_ALLEXPLICIT) { /* --asexplicit */
|
||||||
reason = ALPM_PKG_REASON_EXPLICIT;
|
reason = ALPM_PKG_REASON_EXPLICIT;
|
||||||
} else {
|
} else {
|
||||||
pm_printf(ALPM_LOG_ERROR, _("no install reason specified (use -h for help)\n"));
|
pm_printf(ALPM_LOG_ERROR, _("no install reason specified (use -h for help)\n"));
|
||||||
|
|
|
@ -445,8 +445,8 @@ static int parsearg_global(int opt)
|
||||||
static int parsearg_database(int opt)
|
static int parsearg_database(int opt)
|
||||||
{
|
{
|
||||||
switch(opt) {
|
switch(opt) {
|
||||||
case OP_ASDEPS: config->flags |= PM_TRANS_FLAG_ALLDEPS; break;
|
case OP_ASDEPS: config->flags |= ALPM_TRANS_FLAG_ALLDEPS; break;
|
||||||
case OP_ASEXPLICIT: config->flags |= PM_TRANS_FLAG_ALLEXPLICIT; break;
|
case OP_ASEXPLICIT: config->flags |= ALPM_TRANS_FLAG_ALLEXPLICIT; break;
|
||||||
default: return 1;
|
default: return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -479,15 +479,15 @@ static int parsearg_trans(int opt)
|
||||||
{
|
{
|
||||||
switch(opt) {
|
switch(opt) {
|
||||||
case 'd':
|
case 'd':
|
||||||
if(config->flags & PM_TRANS_FLAG_NODEPVERSION) {
|
if(config->flags & ALPM_TRANS_FLAG_NODEPVERSION) {
|
||||||
config->flags |= PM_TRANS_FLAG_NODEPS;
|
config->flags |= ALPM_TRANS_FLAG_NODEPS;
|
||||||
} else {
|
} else {
|
||||||
config->flags |= PM_TRANS_FLAG_NODEPVERSION;
|
config->flags |= ALPM_TRANS_FLAG_NODEPVERSION;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'k': config->flags |= PM_TRANS_FLAG_DBONLY; break;
|
case 'k': config->flags |= ALPM_TRANS_FLAG_DBONLY; break;
|
||||||
case OP_NOPROGRESSBAR: config->noprogressbar = 1; break;
|
case OP_NOPROGRESSBAR: config->noprogressbar = 1; break;
|
||||||
case OP_NOSCRIPTLET: config->flags |= PM_TRANS_FLAG_NOSCRIPTLET; break;
|
case OP_NOSCRIPTLET: config->flags |= ALPM_TRANS_FLAG_NOSCRIPTLET; break;
|
||||||
case 'p': config->print = 1; break;
|
case 'p': config->print = 1; break;
|
||||||
case OP_PRINTFORMAT:
|
case OP_PRINTFORMAT:
|
||||||
check_optarg();
|
check_optarg();
|
||||||
|
@ -503,16 +503,16 @@ static int parsearg_remove(int opt)
|
||||||
if(parsearg_trans(opt) == 0)
|
if(parsearg_trans(opt) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
switch(opt) {
|
switch(opt) {
|
||||||
case 'c': config->flags |= PM_TRANS_FLAG_CASCADE; break;
|
case 'c': config->flags |= ALPM_TRANS_FLAG_CASCADE; break;
|
||||||
case 'n': config->flags |= PM_TRANS_FLAG_NOSAVE; break;
|
case 'n': config->flags |= ALPM_TRANS_FLAG_NOSAVE; break;
|
||||||
case 's':
|
case 's':
|
||||||
if(config->flags & PM_TRANS_FLAG_RECURSE) {
|
if(config->flags & ALPM_TRANS_FLAG_RECURSE) {
|
||||||
config->flags |= PM_TRANS_FLAG_RECURSEALL;
|
config->flags |= ALPM_TRANS_FLAG_RECURSEALL;
|
||||||
} else {
|
} else {
|
||||||
config->flags |= PM_TRANS_FLAG_RECURSE;
|
config->flags |= ALPM_TRANS_FLAG_RECURSE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'u': config->flags |= PM_TRANS_FLAG_UNNEEDED; break;
|
case 'u': config->flags |= ALPM_TRANS_FLAG_UNNEEDED; break;
|
||||||
default: return 1;
|
default: return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -524,9 +524,9 @@ static int parsearg_upgrade(int opt)
|
||||||
if(parsearg_trans(opt) == 0)
|
if(parsearg_trans(opt) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
switch(opt) {
|
switch(opt) {
|
||||||
case 'f': config->flags |= PM_TRANS_FLAG_FORCE; break;
|
case 'f': config->flags |= ALPM_TRANS_FLAG_FORCE; break;
|
||||||
case OP_ASDEPS: config->flags |= PM_TRANS_FLAG_ALLDEPS; break;
|
case OP_ASDEPS: config->flags |= ALPM_TRANS_FLAG_ALLDEPS; break;
|
||||||
case OP_ASEXPLICIT: config->flags |= PM_TRANS_FLAG_ALLEXPLICIT; break;
|
case OP_ASEXPLICIT: config->flags |= ALPM_TRANS_FLAG_ALLEXPLICIT; break;
|
||||||
case OP_IGNORE:
|
case OP_IGNORE:
|
||||||
parsearg_util_addlist(&(config->ignorepkg));
|
parsearg_util_addlist(&(config->ignorepkg));
|
||||||
break;
|
break;
|
||||||
|
@ -543,7 +543,7 @@ static int parsearg_sync(int opt)
|
||||||
if(parsearg_upgrade(opt) == 0)
|
if(parsearg_upgrade(opt) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
switch(opt) {
|
switch(opt) {
|
||||||
case OP_NEEDED: config->flags |= PM_TRANS_FLAG_NEEDED; break;
|
case OP_NEEDED: config->flags |= ALPM_TRANS_FLAG_NEEDED; break;
|
||||||
case 'c': (config->op_s_clean)++; break;
|
case 'c': (config->op_s_clean)++; break;
|
||||||
case 'g': (config->group)++; break;
|
case 'g': (config->group)++; break;
|
||||||
case 'i': (config->op_s_info)++; break;
|
case 'i': (config->op_s_info)++; break;
|
||||||
|
@ -553,8 +553,8 @@ static int parsearg_sync(int opt)
|
||||||
case 'u': (config->op_s_upgrade)++; break;
|
case 'u': (config->op_s_upgrade)++; break;
|
||||||
case 'w':
|
case 'w':
|
||||||
config->op_s_downloadonly = 1;
|
config->op_s_downloadonly = 1;
|
||||||
config->flags |= PM_TRANS_FLAG_DOWNLOADONLY;
|
config->flags |= ALPM_TRANS_FLAG_DOWNLOADONLY;
|
||||||
config->flags |= PM_TRANS_FLAG_NOCONFLICTS;
|
config->flags |= ALPM_TRANS_FLAG_NOCONFLICTS;
|
||||||
break;
|
break;
|
||||||
case 'y': (config->op_s_sync)++; break;
|
case 'y': (config->op_s_sync)++; break;
|
||||||
default: return 1;
|
default: return 1;
|
||||||
|
@ -862,8 +862,8 @@ int main(int argc, char *argv[])
|
||||||
/* set up the print operations */
|
/* set up the print operations */
|
||||||
if(config->print && !config->op_s_clean) {
|
if(config->print && !config->op_s_clean) {
|
||||||
config->noconfirm = 1;
|
config->noconfirm = 1;
|
||||||
config->flags |= PM_TRANS_FLAG_NOCONFLICTS;
|
config->flags |= ALPM_TRANS_FLAG_NOCONFLICTS;
|
||||||
config->flags |= PM_TRANS_FLAG_NOLOCK;
|
config->flags |= ALPM_TRANS_FLAG_NOLOCK;
|
||||||
/* Display only errors */
|
/* Display only errors */
|
||||||
config->logmask &= ~ALPM_LOG_WARNING;
|
config->logmask &= ~ALPM_LOG_WARNING;
|
||||||
}
|
}
|
||||||
|
|
|
@ -950,7 +950,7 @@ int pacman_sync(alpm_list_t *targets)
|
||||||
}
|
}
|
||||||
|
|
||||||
alpm_list_t *targs = alpm_list_strdup(targets);
|
alpm_list_t *targs = alpm_list_strdup(targets);
|
||||||
if(!(config->flags & PM_TRANS_FLAG_DOWNLOADONLY) && !config->print) {
|
if(!(config->flags & ALPM_TRANS_FLAG_DOWNLOADONLY) && !config->print) {
|
||||||
/* check for newer versions of packages to be upgraded first */
|
/* check for newer versions of packages to be upgraded first */
|
||||||
alpm_list_t *packages = syncfirst();
|
alpm_list_t *packages = syncfirst();
|
||||||
if(packages) {
|
if(packages) {
|
||||||
|
|
|
@ -749,7 +749,7 @@ void display_targets(const alpm_list_t *pkgs, int install)
|
||||||
if(install) {
|
if(install) {
|
||||||
size = humanize_size(dlsize, 'M', 1, &label);
|
size = humanize_size(dlsize, 'M', 1, &label);
|
||||||
printf(_("Total Download Size: %.2f %s\n"), size, label);
|
printf(_("Total Download Size: %.2f %s\n"), size, label);
|
||||||
if(!(config->flags & PM_TRANS_FLAG_DOWNLOADONLY)) {
|
if(!(config->flags & ALPM_TRANS_FLAG_DOWNLOADONLY)) {
|
||||||
size = humanize_size(isize, 'M', 1, &label);
|
size = humanize_size(isize, 'M', 1, &label);
|
||||||
printf(_("Total Installed Size: %.2f %s\n"), size, label);
|
printf(_("Total Installed Size: %.2f %s\n"), size, label);
|
||||||
/* only show this net value if different from raw installed size */
|
/* only show this net value if different from raw installed size */
|
||||||
|
|
Loading…
Add table
Reference in a new issue