mirror of
https://github.com/moparisthebest/pacman
synced 2024-12-22 15:58:50 -05:00
some remork for pacman_deptest()
This commit is contained in:
parent
348cb923c7
commit
6511f1949e
@ -236,11 +236,14 @@ void cleanup(int signum)
|
|||||||
|
|
||||||
int pacman_deptest(list_t *targets)
|
int pacman_deptest(list_t *targets)
|
||||||
{
|
{
|
||||||
PM_LIST *lp, *data;
|
PM_LIST *data;
|
||||||
PM_PKG *dummy;
|
|
||||||
|
if(targets == NULL) {
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
if(pmo_d_vertest) {
|
if(pmo_d_vertest) {
|
||||||
if(targets && targets->data && targets->next && targets->next->data) {
|
if(targets->data && targets->next && targets->next->data) {
|
||||||
int ret = alpm_pkg_vercmp(targets->data, targets->next->data);
|
int ret = alpm_pkg_vercmp(targets->data, targets->next->data);
|
||||||
printf("%d\n", ret);
|
printf("%d\n", ret);
|
||||||
return(ret);
|
return(ret);
|
||||||
@ -255,32 +258,20 @@ int pacman_deptest(list_t *targets)
|
|||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
dummy = NULL;
|
|
||||||
/* ORE
|
/* ORE
|
||||||
find a way to create a fake package and to add it to the transaction
|
* For ADD transaction, implement a hack to alpm_trans_addtarget() to add
|
||||||
targets
|
* a dummy target based on the pattern: "__dummy__|version|dep1|dep2|..."
|
||||||
dummy = (pm_pkginfo_t *)malloc(sizeof(pm_pkginfo_t));
|
* where "dummy" is the package name, "version" its version, and every dep?
|
||||||
if(dummy == NULL) {
|
* the content of the "depends" field.
|
||||||
ERR(NL, "error: can't allocate %d bytes\n", sizeof(pm_pkginfo_t));
|
*/
|
||||||
exit(1);
|
if(alpm_trans_addtarget("__dummy__|1.0-1|dep1|dep2|...") == -1) {
|
||||||
}
|
|
||||||
sprintf(dummy->name, "_dummy_");
|
|
||||||
sprintf(dummy->version, "1.0-1");
|
|
||||||
|
|
||||||
for(i = targets; i; i = i->next) {
|
|
||||||
if(i->data == NULL) continue;
|
|
||||||
dummy->depends = list_add(dummy->depends, strdup(i->data)));
|
|
||||||
}
|
|
||||||
|
|
||||||
trans->targets = list_add(trans->targets, strdup(dummy->name));*/
|
|
||||||
|
|
||||||
if(alpm_trans_addtarget(NULL) == -1) {
|
|
||||||
ERR(NL, "error: %s\n", alpm_strerror(pm_errno));
|
ERR(NL, "error: %s\n", alpm_strerror(pm_errno));
|
||||||
alpm_trans_release();
|
alpm_trans_release();
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(alpm_trans_prepare(&data) == -1) {
|
if(alpm_trans_prepare(&data) == -1) {
|
||||||
|
PM_LIST *lp;
|
||||||
int ret = 126;
|
int ret = 126;
|
||||||
list_t *synctargs = NULL;
|
list_t *synctargs = NULL;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user