|
Lubos Kardos |
4b03dd |
From b598ce37d76bde5b8a6029008531aba6d2fbf594 Mon Sep 17 00:00:00 2001
|
|
Lubos Kardos |
4b03dd |
From: Lubos Kardos <lkardos@redhat.com>
|
|
Lubos Kardos |
4b03dd |
Date: Thu, 12 Mar 2015 15:34:39 +0100
|
|
Lubos Kardos |
4b03dd |
Subject: [PATCH] Skip directory if contains subdirectory that contains only
|
|
Lubos Kardos |
4b03dd |
skipped files.
|
|
Lubos Kardos |
4b03dd |
|
|
Lubos Kardos |
4b03dd |
Previously directory was skipped from installation if it contained only
|
|
Lubos Kardos |
4b03dd |
skipped files. But it wasn't skipped if it contained some subdirectory.
|
|
Lubos Kardos |
4b03dd |
Now if subdirectory contains also only skipped files then subdirectory
|
|
Lubos Kardos |
4b03dd |
and also parent directory are skipped. It is achieved by solving
|
|
Lubos Kardos |
4b03dd |
subdirectories at first and then solving parent directories.
|
|
Lubos Kardos |
4b03dd |
(rhbz#1192625)
|
|
Lubos Kardos |
4b03dd |
---
|
|
Lubos Kardos |
4b03dd |
lib/transaction.c | 8 +++++++-
|
|
Lubos Kardos |
4b03dd |
1 file changed, 7 insertions(+), 1 deletion(-)
|
|
Lubos Kardos |
4b03dd |
|
|
Lubos Kardos |
4b03dd |
diff --git a/lib/transaction.c b/lib/transaction.c
|
|
Lubos Kardos |
4b03dd |
index 0f39732..af1deb8 100644
|
|
Lubos Kardos |
4b03dd |
--- a/lib/transaction.c
|
|
Lubos Kardos |
4b03dd |
+++ b/lib/transaction.c
|
|
Lubos Kardos |
4b03dd |
@@ -851,7 +851,8 @@ static void skipInstallFiles(const rpmts ts, rpmfiles files, rpmfs fs)
|
|
Lubos Kardos |
4b03dd |
}
|
|
Lubos Kardos |
4b03dd |
|
|
Lubos Kardos |
4b03dd |
/* Skip (now empty) directories that had skipped files. */
|
|
Lubos Kardos |
4b03dd |
- for (j = 0; j < dc; j++) {
|
|
Lubos Kardos |
4b03dd |
+ /* Iterate over dirs in reversed order to solve subdirs at first */
|
|
Lubos Kardos |
4b03dd |
+ for (j = dc; j >= 0; j--) {
|
|
Lubos Kardos |
4b03dd |
const char * dn, * bn;
|
|
Lubos Kardos |
4b03dd |
size_t dnlen, bnlen;
|
|
Lubos Kardos |
4b03dd |
|
|
Lubos Kardos |
4b03dd |
@@ -892,6 +893,11 @@ static void skipInstallFiles(const rpmts ts, rpmfiles files, rpmfs fs)
|
|
Lubos Kardos |
4b03dd |
continue;
|
|
Lubos Kardos |
4b03dd |
rpmlog(RPMLOG_DEBUG, "excluding directory %s\n", dn);
|
|
Lubos Kardos |
4b03dd |
rpmfsSetAction(fs, i, FA_SKIPNSTATE);
|
|
Lubos Kardos |
4b03dd |
+ ix = rpmfiDX(fi);
|
|
Lubos Kardos |
4b03dd |
+ /* Decrease count of files for parent directory */
|
|
Lubos Kardos |
4b03dd |
+ drc[ix]--;
|
|
Lubos Kardos |
4b03dd |
+ /* Mark directory because something was removed from them */
|
|
Lubos Kardos |
4b03dd |
+ dff[ix] = 1;
|
|
Lubos Kardos |
4b03dd |
break;
|
|
Lubos Kardos |
4b03dd |
}
|
|
Lubos Kardos |
4b03dd |
}
|
|
Lubos Kardos |
4b03dd |
--
|
|
Lubos Kardos |
4b03dd |
1.9.3
|
|
Lubos Kardos |
4b03dd |
|
|
Lubos Kardos |
e972e4 |
From ee72c41d8b9994e4b1086c116927e8541a6ba592 Mon Sep 17 00:00:00 2001
|
|
Lubos Kardos |
e972e4 |
From: Lubos Kardos <lkardos@redhat.com>
|
|
Lubos Kardos |
e972e4 |
Date: Mon, 30 Mar 2015 09:31:15 +0200
|
|
Lubos Kardos |
e972e4 |
Subject: [PATCH] Fix off-by-one error (rhbz:#1206750)
|
|
Lubos Kardos |
e972e4 |
|
|
Lubos Kardos |
e972e4 |
- Caused by commit b598ce37d76bde5b8a6029008531aba6d2fbf594
|
|
Lubos Kardos |
e972e4 |
---
|
|
Lubos Kardos |
e972e4 |
lib/transaction.c | 2 +-
|
|
Lubos Kardos |
e972e4 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
Lubos Kardos |
e972e4 |
|
|
Lubos Kardos |
e972e4 |
diff --git a/lib/transaction.c b/lib/transaction.c
|
|
Lubos Kardos |
e972e4 |
index af1deb8..f9ffd10 100644
|
|
Lubos Kardos |
e972e4 |
--- a/lib/transaction.c
|
|
Lubos Kardos |
e972e4 |
+++ b/lib/transaction.c
|
|
Lubos Kardos |
e972e4 |
@@ -852,7 +852,7 @@ static void skipInstallFiles(const rpmts ts, rpmfiles files, rpmfs fs)
|
|
Lubos Kardos |
e972e4 |
|
|
Lubos Kardos |
e972e4 |
/* Skip (now empty) directories that had skipped files. */
|
|
Lubos Kardos |
e972e4 |
/* Iterate over dirs in reversed order to solve subdirs at first */
|
|
Lubos Kardos |
e972e4 |
- for (j = dc; j >= 0; j--) {
|
|
Lubos Kardos |
e972e4 |
+ for (j = dc - 1; j >= 0; j--) {
|
|
Lubos Kardos |
e972e4 |
const char * dn, * bn;
|
|
Lubos Kardos |
e972e4 |
size_t dnlen, bnlen;
|
|
Lubos Kardos |
e972e4 |
|
|
Lubos Kardos |
e972e4 |
--
|
|
Lubos Kardos |
e972e4 |
1.9.3
|
|
Lubos Kardos |
e972e4 |
|