[packages/rpm/dirdeps: 24/24] check parent directory dependencies also during package removal
draenog
draenog at pld-linux.org
Wed Nov 6 18:11:03 CET 2013
commit 17b6b6928b6686862470aef755431d59df47d920
Author: Kacper Kornet <draenog at pld-linux.org>
Date: Fri Aug 30 18:36:45 2013 +0100
check parent directory dependencies also during package removal
rpm-dirdeps-erasures.patch | 49 ++++++++++++++++++++++++++++++++++++++++++++++
rpm.spec | 2 ++
2 files changed, 51 insertions(+)
---
diff --git a/rpm.spec b/rpm.spec
index b968f84..bcd39a0 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -167,6 +167,7 @@ Patch77: %{name}-lua-expat.patch
Patch78: %{name}-double_check_unpackaged_subdirs.patch
Patch79: %{name}-rpmspec.patch
Patch80: %{name}-revert-gpg-argv-parsing.patch
+Patch81: %{name}-dirdeps-erasures.patch
# Patches imported from Mandriva
@@ -917,6 +918,7 @@ Dokumentacja API RPM-a oraz przewodniki w formacie HTML generowane ze
%patch78 -p1
%patch79 -p1
%patch80 -p1
+%patch81 -p1
%patch1000 -p1
%patch1001 -p1
diff --git a/rpm-dirdeps-erasures.patch b/rpm-dirdeps-erasures.patch
new file mode 100644
index 0000000..f39ca87
--- /dev/null
+++ b/rpm-dirdeps-erasures.patch
@@ -0,0 +1,49 @@
+commit 47f436a57cbf1312782f7204ed72b6bdba2d154d
+Author: Kacper Kornet <draenog at pld-linux.org>
+Date: Thu Aug 29 21:53:22 2013 +0100
+
+ Check for dir dependencies also during erasure
+
+diff --git a/lib/depends.c b/lib/depends.c
+index 20bd53a..1a07fdc 100644
+--- a/lib/depends.c
++++ b/lib/depends.c
+@@ -1860,6 +1860,21 @@ static int checkDependentPackages(rpmts ts, const char * depName)
+ return rc;
+ }
+
++static int checkDependentDirs(rpmts ts, const char * depName, nsType depNS)
++ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
++ /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/
++{
++ int rc = 0;
++
++ /* XXX rpmdb can be closed here, avoid error msg. */
++ if (rpmtsGetRdb(ts) != NULL) {
++ rpmmi mi;
++ mi = rpmtsInitIterator(ts, RPMTAG_DIRNAMES, depName, 0);
++ rc = checkPackageSet(ts, depName, depNS, mi, 0);
++ }
++ return rc;
++}
++
+ /**
+ * Check to-be-added dependencies against installed conflicts.
+ * @param ts transaction set
+@@ -1932,6 +1932,7 @@ int _rpmtsCheck(rpmts ts)
+ int terminate = 2; /* XXX terminate if rc >= terminate */
+ int rc = 0;
+ int ourrc = 0;
++ int dirname_deps = rpmExpandNumeric("%{?_check_dirname_deps}%{?!_check_dirname_deps:1}");
+
+ if (_rpmts_debug)
+ fprintf(stderr, "--> %s(%p) tsFlags 0x%x\n", __FUNCTION__, ts, rpmtsFlags(ts));
+@@ -2021,6 +2036,8 @@ fprintf(stderr, "--> %s(%p) tsFlags 0x%x\n", __FUNCTION__, ts, rpmtsFlags(ts));
+ /* Erasing: check filename against requiredby matches. */
+ if (checkDependentPackages(ts, depName, RPMNS_TYPE_UNKNOWN))
+ rc = 1;
++ if (dirname_deps && checkDependentDirs(ts, depName, RPMNS_TYPE_UNKNOWN))
++ rc = 1;
+ }
+ if (rc && (ourrc = rc) >= terminate)
+ break;
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/rpm.git/commitdiff/17b6b6928b6686862470aef755431d59df47d920
More information about the pld-cvs-commit
mailing list