mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-22 15:58:50 -05:00
Prefix alpm_pkgreason_t members with ALPM
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
cf1401a04d
commit
eb39a9482b
@ -98,7 +98,7 @@ int SYMEXPORT alpm_add_pkg(alpm_handle_t *handle, alpm_pkg_t *pkg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* add the package to the transaction */
|
/* add the package to the transaction */
|
||||||
pkg->reason = PM_PKG_REASON_EXPLICIT;
|
pkg->reason = ALPM_PKG_REASON_EXPLICIT;
|
||||||
_alpm_log(handle, PM_LOG_DEBUG, "adding package %s-%s to the transaction add list\n",
|
_alpm_log(handle, PM_LOG_DEBUG, "adding package %s-%s to the transaction add list\n",
|
||||||
pkgname, pkgver);
|
pkgname, pkgver);
|
||||||
trans->add = alpm_list_add(trans->add, pkg);
|
trans->add = alpm_list_add(trans->add, pkg);
|
||||||
@ -499,9 +499,9 @@ static int commit_single_pkg(alpm_handle_t *handle, alpm_pkg_t *newpkg,
|
|||||||
|
|
||||||
/* 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 & PM_TRANS_FLAG_ALLDEPS) {
|
||||||
newpkg->reason = PM_PKG_REASON_DEPEND;
|
newpkg->reason = ALPM_PKG_REASON_DEPEND;
|
||||||
} else if(trans->flags & PM_TRANS_FLAG_ALLEXPLICIT) {
|
} else if(trans->flags & PM_TRANS_FLAG_ALLEXPLICIT) {
|
||||||
newpkg->reason = PM_PKG_REASON_EXPLICIT;
|
newpkg->reason = ALPM_PKG_REASON_EXPLICIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(oldpkg) {
|
if(oldpkg) {
|
||||||
|
@ -55,9 +55,9 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
typedef enum _alpm_pkgreason_t {
|
typedef enum _alpm_pkgreason_t {
|
||||||
/** Explicitly requested by the user. */
|
/** Explicitly requested by the user. */
|
||||||
PM_PKG_REASON_EXPLICIT = 0,
|
ALPM_PKG_REASON_EXPLICIT = 0,
|
||||||
/** Installed as a dependency for another package. */
|
/** Installed as a dependency for another package. */
|
||||||
PM_PKG_REASON_DEPEND = 1
|
ALPM_PKG_REASON_DEPEND = 1
|
||||||
} alpm_pkgreason_t;
|
} alpm_pkgreason_t;
|
||||||
|
|
||||||
/** Types of version constraints in dependency specs. */
|
/** Types of version constraints in dependency specs. */
|
||||||
@ -746,7 +746,7 @@ typedef enum _alpm_transflag_t {
|
|||||||
/** 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),
|
PM_TRANS_FLAG_DBONLY = (1 << 6),
|
||||||
/* (1 << 7) flag can go here */
|
/* (1 << 7) flag can go here */
|
||||||
/** Use PM_PKG_REASON_DEPEND when installing packages. */
|
/** Use ALPM_PKG_REASON_DEPEND when installing packages. */
|
||||||
PM_TRANS_FLAG_ALLDEPS = (1 << 8),
|
PM_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),
|
PM_TRANS_FLAG_DOWNLOADONLY = (1 << 9),
|
||||||
@ -757,7 +757,7 @@ typedef enum _alpm_transflag_t {
|
|||||||
/* (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),
|
PM_TRANS_FLAG_NEEDED = (1 << 13),
|
||||||
/** Use PM_PKG_REASON_EXPLICIT when installing packages. */
|
/** Use ALPM_PKG_REASON_EXPLICIT when installing packages. */
|
||||||
PM_TRANS_FLAG_ALLEXPLICIT = (1 << 14),
|
PM_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),
|
PM_TRANS_FLAG_UNNEEDED = (1 << 15),
|
||||||
|
@ -483,7 +483,7 @@ static int can_remove_package(alpm_db_t *db, alpm_pkg_t *pkg, alpm_list_t *targe
|
|||||||
|
|
||||||
if(!include_explicit) {
|
if(!include_explicit) {
|
||||||
/* see if it was explicitly installed */
|
/* see if it was explicitly installed */
|
||||||
if(alpm_pkg_get_reason(pkg) == PM_PKG_REASON_EXPLICIT) {
|
if(alpm_pkg_get_reason(pkg) == ALPM_PKG_REASON_EXPLICIT) {
|
||||||
_alpm_log(db->handle, PM_LOG_DEBUG, "excluding %s -- explicitly installed\n",
|
_alpm_log(db->handle, PM_LOG_DEBUG, "excluding %s -- explicitly installed\n",
|
||||||
alpm_pkg_get_name(pkg));
|
alpm_pkg_get_name(pkg));
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -182,8 +182,8 @@ int SYMEXPORT alpm_sync_sysupgrade(alpm_handle_t *handle, int enable_downgrade)
|
|||||||
lpkg->name, tpkg->name);
|
lpkg->name, tpkg->name);
|
||||||
tpkg->removes = alpm_list_add(tpkg->removes, lpkg);
|
tpkg->removes = alpm_list_add(tpkg->removes, lpkg);
|
||||||
/* check the to-be-replaced package's reason field */
|
/* check the to-be-replaced package's reason field */
|
||||||
if(alpm_pkg_get_reason(lpkg) == PM_PKG_REASON_EXPLICIT) {
|
if(alpm_pkg_get_reason(lpkg) == ALPM_PKG_REASON_EXPLICIT) {
|
||||||
tpkg->reason = PM_PKG_REASON_EXPLICIT;
|
tpkg->reason = ALPM_PKG_REASON_EXPLICIT;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* add spkg to the target list */
|
/* add spkg to the target list */
|
||||||
@ -378,7 +378,7 @@ int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data)
|
|||||||
for(i = resolved; i; i = i->next) {
|
for(i = resolved; i; i = i->next) {
|
||||||
alpm_pkg_t *pkg = i->data;
|
alpm_pkg_t *pkg = i->data;
|
||||||
if(!_alpm_pkg_find(trans->add, pkg->name)) {
|
if(!_alpm_pkg_find(trans->add, pkg->name)) {
|
||||||
pkg->reason = PM_PKG_REASON_DEPEND;
|
pkg->reason = ALPM_PKG_REASON_DEPEND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,9 +50,9 @@ int pacman_database(alpm_list_t *targets)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(config->flags & PM_TRANS_FLAG_ALLDEPS) { /* --asdeps */
|
if(config->flags & PM_TRANS_FLAG_ALLDEPS) { /* --asdeps */
|
||||||
reason = PM_PKG_REASON_DEPEND;
|
reason = ALPM_PKG_REASON_DEPEND;
|
||||||
} else if(config->flags & PM_TRANS_FLAG_ALLEXPLICIT) { /* --asexplicit */
|
} else if(config->flags & PM_TRANS_FLAG_ALLEXPLICIT) { /* --asexplicit */
|
||||||
reason = PM_PKG_REASON_EXPLICIT;
|
reason = ALPM_PKG_REASON_EXPLICIT;
|
||||||
} else {
|
} else {
|
||||||
pm_printf(PM_LOG_ERROR, _("no install reason specified (use -h for help)\n"));
|
pm_printf(PM_LOG_ERROR, _("no install reason specified (use -h for help)\n"));
|
||||||
return 1;
|
return 1;
|
||||||
@ -71,7 +71,7 @@ int pacman_database(alpm_list_t *targets)
|
|||||||
pkgname, alpm_strerror(alpm_errno(config->handle)));
|
pkgname, alpm_strerror(alpm_errno(config->handle)));
|
||||||
retval = 1;
|
retval = 1;
|
||||||
} else {
|
} else {
|
||||||
if(reason == PM_PKG_REASON_DEPEND) {
|
if(reason == ALPM_PKG_REASON_DEPEND) {
|
||||||
printf(_("%s: install reason has been set to 'installed as dependency'\n"), pkgname);
|
printf(_("%s: install reason has been set to 'installed as dependency'\n"), pkgname);
|
||||||
} else {
|
} else {
|
||||||
printf(_("%s: install reason has been set to 'explicitly installed'\n"), pkgname);
|
printf(_("%s: install reason has been set to 'explicitly installed'\n"), pkgname);
|
||||||
|
@ -70,10 +70,10 @@ void dump_pkg_full(alpm_pkg_t *pkg, enum pkg_from from, int extra)
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch((long)alpm_pkg_get_reason(pkg)) {
|
switch((long)alpm_pkg_get_reason(pkg)) {
|
||||||
case PM_PKG_REASON_EXPLICIT:
|
case ALPM_PKG_REASON_EXPLICIT:
|
||||||
reason = _("Explicitly installed");
|
reason = _("Explicitly installed");
|
||||||
break;
|
break;
|
||||||
case PM_PKG_REASON_DEPEND:
|
case ALPM_PKG_REASON_DEPEND:
|
||||||
reason = _("Installed as a dependency for another package");
|
reason = _("Installed as a dependency for another package");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -370,12 +370,12 @@ static int filter(alpm_pkg_t *pkg)
|
|||||||
{
|
{
|
||||||
/* check if this package was explicitly installed */
|
/* check if this package was explicitly installed */
|
||||||
if(config->op_q_explicit &&
|
if(config->op_q_explicit &&
|
||||||
alpm_pkg_get_reason(pkg) != PM_PKG_REASON_EXPLICIT) {
|
alpm_pkg_get_reason(pkg) != ALPM_PKG_REASON_EXPLICIT) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/* check if this package was installed as a dependency */
|
/* check if this package was installed as a dependency */
|
||||||
if(config->op_q_deps &&
|
if(config->op_q_deps &&
|
||||||
alpm_pkg_get_reason(pkg) != PM_PKG_REASON_DEPEND) {
|
alpm_pkg_get_reason(pkg) != ALPM_PKG_REASON_DEPEND) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/* check if this pkg isn't in a sync DB */
|
/* check if this pkg isn't in a sync DB */
|
||||||
|
Loading…
Reference in New Issue
Block a user