xbps: merge two patches from git master.

This commit is contained in:
Juan RP 2013-02-07 21:48:20 +01:00
parent c7f155b513
commit ee04a4e1c2
3 changed files with 120 additions and 1 deletions

View file

@ -0,0 +1,47 @@
From 178a6b58ae0a06e9d424f7879bafb4e8a26879e4 Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@gmail.com>
Date: Thu, 7 Feb 2013 17:49:28 +0100
Subject: [PATCH 09/10] Remove another transaction obj from pkgdb and make
xbps-pkgdb catch it.
---
bin/xbps-pkgdb/check_pkg_unneeded.c | 5 ++++-
include/xbps_api.h.in | 2 +-
lib/package_register.c | 1 +
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/bin/xbps-pkgdb/check_pkg_unneeded.c b/bin/xbps-pkgdb/check_pkg_unneeded.c
index 8354b52..1379f4a 100644
--- bin/xbps-pkgdb/check_pkg_unneeded.c
+++ bin/xbps-pkgdb/check_pkg_unneeded.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2012 Juan Romero Pardines.
+ * Copyright (c) 2013 Juan Romero Pardines.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -56,5 +56,8 @@ check_pkg_unneeded(struct xbps_handle *xhp, const char *pkgname, void *arg)
if (prop_dictionary_get(pkgd, "transaction"))
prop_dictionary_remove(pkgd, "transaction");
+ if (prop_dictionary_get(pkgd, "skip-obsoletes"))
+ prop_dictionary_remove(pkgd, "skip-obsoletes");
+
return 0;
}
diff --git a/lib/package_register.c b/lib/package_register.c
index d78d0be..3ab6dd9 100644
--- lib/package_register.c
+++ lib/package_register.c
@@ -161,6 +161,7 @@ xbps_register_pkg(struct xbps_handle *xhp, prop_dictionary_t pkgrd, bool flush)
*/
prop_dictionary_remove(pkgd, "remove-and-update");
prop_dictionary_remove(pkgd, "transaction");
+ prop_dictionary_remove(pkgd, "skip-obsoletes");
if (!xbps_pkgdb_replace_pkg(xhp, pkgd, pkgname, flush)) {
xbps_dbg_printf(xhp,
--
1.8.1.1

View file

@ -0,0 +1,72 @@
From 2b5d3bb8f4676afe9dee4eef13858c3c5088716c Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@gmail.com>
Date: Thu, 7 Feb 2013 18:50:55 +0100
Subject: [PATCH 10/10] libxbps: when resolving deps, ignore all of them that
depend on the origin pkg.
---
NEWS | 3 +++
include/xbps_api.h.in | 2 +-
lib/rindex_pkgdeps.c | 18 +++++++++++++++++-
lib/transaction_sortdeps.c | 7 ++++++-
4 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/lib/rindex_pkgdeps.c b/lib/rindex_pkgdeps.c
index f69749c..efa19c4 100644
--- lib/rindex_pkgdeps.c
+++ lib/rindex_pkgdeps.c
@@ -158,7 +158,7 @@ find_repo_deps(struct xbps_handle *xhp,
prop_array_t curpkgrdeps;
pkg_state_t state;
size_t x;
- const char *reqpkg, *pkgver_q, *reason = NULL;
+ const char *reqpkg, *reqpkgname, *pkgver_q, *reason = NULL;
char *pkgname;
int rv = 0;
@@ -317,6 +317,22 @@ find_repo_deps(struct xbps_handle *xhp,
}
prop_dictionary_get_cstring_nocopy(curpkgd,
"pkgver", &pkgver_q);
+ prop_dictionary_get_cstring_nocopy(curpkgd,
+ "pkgname", &reqpkgname);
+ /*
+ * Check dependency validity.
+ */
+ pkgname = xbps_pkg_name(curpkg);
+ assert(pkgname);
+ if (strcmp(pkgname, reqpkgname) == 0) {
+ xbps_dbg_printf_append(xhp, "[ignoring wrong dependency "
+ "%s (depends on itself)]\n",
+ reqpkg);
+ free(pkgname);
+ continue;
+ }
+ free(pkgname);
+
/*
* Check if package has matched conflicts.
*/
diff --git a/lib/transaction_sortdeps.c b/lib/transaction_sortdeps.c
index dd346fb..c3aa4bb 100644
--- lib/transaction_sortdeps.c
+++ lib/transaction_sortdeps.c
@@ -205,9 +205,14 @@ again:
rv = EINVAL;
break;
}
+ if ((xbps_match_virtual_pkg_in_dict(curpkgd, str, true)) ||
+ (xbps_match_virtual_pkg_in_dict(curpkgd, str, false))) {
+ xbps_dbg_printf_append(xhp, "ignore wrong "
+ "dependency %s (depends on itself)\n", str);
+ continue;
+ }
prop_dictionary_get_cstring_nocopy(curpkgd,
"transaction", &tract);
-
lpd = pkgdep_alloc(curpkgd, str);
if (pdn == NULL) {
--
1.8.1.1

View file

@ -1,7 +1,7 @@
# Template file for 'xbps'
pkgname=xbps
version=0.20
revision=8
revision=9
build_style=configure
configure_args="--prefix=/ --exec-prefix=/usr --sbindir=/usr/sbin
--enable-static --enable-debug"