summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2004-07-05 15:24:17 +0000
committerjbj <devnull@localhost>2004-07-05 15:24:17 +0000
commit07444608bcf20037636a4811a47b87d66c05d942 (patch)
tree481c7a6feb82493d00bd8f04abb2f86e35770990 /lib
parentbc600c50e38ad8b3ab4385c2c5bbb8073024fbd7 (diff)
downloadlibrpm-tizen-07444608bcf20037636a4811a47b87d66c05d942.tar.gz
librpm-tizen-07444608bcf20037636a4811a47b87d66c05d942.tar.bz2
librpm-tizen-07444608bcf20037636a4811a47b87d66c05d942.zip
- bump rpm and popt versions to insure "newer".
- change default behavior to resolve file conflicts as LIFO. - add --fileconflicts to recover rpm traditional behavior. - prefer elf64 over elf32 files, everywhere and always (#126853). CVS patchset: 7354 CVS date: 2004/07/05 15:24:17
Diffstat (limited to 'lib')
-rw-r--r--lib/poptI.c21
-rw-r--r--lib/transaction.c23
2 files changed, 32 insertions, 12 deletions
diff --git a/lib/poptI.c b/lib/poptI.c
index 0346372d1..73f687057 100644
--- a/lib/poptI.c
+++ b/lib/poptI.c
@@ -14,7 +14,21 @@ extern time_t get_date(const char * p, void * now); /* XXX expedient lies */
/*@=redecl@*/
/*@unchecked@*/
-struct rpmInstallArguments_s rpmIArgs;
+struct rpmInstallArguments_s rpmIArgs = {
+ 0, /* transFlags */
+ /* probFilter */
+ (RPMPROB_FILTER_REPLACEOLDFILES | RPMPROB_FILTER_REPLACENEWFILES),
+ 0, /* installInterfaceFlags */
+ 0, /* eraseInterfaceFlags */
+ 0, /* qva_flags */
+ 0, /* rbtid */
+ 0, /* numRelocations */
+ 0, /* noDeps */
+ 0, /* incldocs */
+ NULL, /* relocations */
+ NULL, /* prefix */
+ NULL /* rootdir */
+};
#define POPT_RELOCATE -1021
#define POPT_EXCLUDEPATH -1022
@@ -191,6 +205,9 @@ struct poptOption rpmInstallPoptTable[] = {
N_("skip files with leading component <path> "),
N_("<path>") },
+ { "fileconflicts", '\0', POPT_BIT_CLR, &rpmIArgs.probFilter,
+ (RPMPROB_FILTER_REPLACEOLDFILES | RPMPROB_FILTER_REPLACENEWFILES),
+ N_("detect file conflicts between packages"), NULL},
{ "force", '\0', 0, NULL, RPMCLI_POPT_FORCE,
N_("short hand for --replacepkgs --replacefiles"), NULL},
@@ -297,7 +314,7 @@ struct poptOption rpmInstallPoptTable[] = {
N_("save erased package files by repackaging"), NULL},
{ "replacefiles", '\0', POPT_BIT_SET, &rpmIArgs.probFilter,
(RPMPROB_FILTER_REPLACEOLDFILES | RPMPROB_FILTER_REPLACENEWFILES),
- N_("install even if the package replaces installed files"), NULL},
+ N_("ignore file conflicts between packages"), NULL},
{ "replacepkgs", '\0', POPT_BIT_SET,
&rpmIArgs.probFilter, RPMPROB_FILTER_REPLACEPKG,
N_("reinstall if the package is already present"), NULL},
diff --git a/lib/transaction.c b/lib/transaction.c
index 836e67473..d29a2e5f3 100644
--- a/lib/transaction.c
+++ b/lib/transaction.c
@@ -188,22 +188,23 @@ static int handleInstInstalledFiles(const rpmts ts,
continue;
if (rpmfiCompare(otherFi, fi)) {
+ int rConflicts;
+ rConflicts = reportConflicts;
/* Resolve file conflicts to prefer Elf64 (if not forced). */
- if (tscolor != 0 && FColor != 0 && FColor != oFColor
- && reportConflicts)
+ if (tscolor != 0 && FColor != 0 && FColor != oFColor)
{
if (oFColor & 0x2) {
fi->actions[fileNum] = FA_SKIP;
- reportConflicts = 0;
+ rConflicts = 0;
} else
if (FColor & 0x2) {
fi->actions[fileNum] = FA_CREATE;
- reportConflicts = 0;
+ rConflicts = 0;
}
}
- if (reportConflicts) {
+ if (rConflicts) {
rpmpsAppend(ps, RPMPROB_FILE_CONFLICT,
rpmteNEVR(p), rpmteKey(p),
rpmfiDN(fi), rpmfiBN(fi),
@@ -559,33 +560,35 @@ static void handleOverlappedFiles(const rpmts ts,
assert(otherFi != NULL);
/* Mark added overlapped non-identical files as a conflict. */
if (rpmfiCompare(otherFi, fi)) {
+ int rConflicts;
+ rConflicts = reportConflicts;
/* Resolve file conflicts to prefer Elf64 (if not forced) ... */
- if (tscolor != 0 && reportConflicts) {
+ if (tscolor != 0) {
if (FColor & 0x2) {
/* ... last Elf64 file is installed ... */
if (!XFA_SKIPPING(fi->actions[i]))
otherFi->actions[otherFileNum] = FA_SKIP;
fi->actions[i] = FA_CREATE;
- reportConflicts = 0;
+ rConflicts = 0;
} else
if (oFColor & 0x2) {
/* ... first Elf64 file is installed ... */
if (XFA_SKIPPING(fi->actions[i]))
otherFi->actions[otherFileNum] = FA_CREATE;
fi->actions[i] = FA_SKIP;
- reportConflicts = 0;
+ rConflicts = 0;
} else
if (FColor == 0 && oFColor == 0) {
/* ... otherwise, do both, last in wins. */
otherFi->actions[otherFileNum] = FA_CREATE;
fi->actions[i] = FA_CREATE;
- reportConflicts = 0;
+ rConflicts = 0;
}
done = 1;
}
- if (reportConflicts) {
+ if (rConflicts) {
rpmpsAppend(ps, RPMPROB_NEW_FILE_CONFLICT,
rpmteNEVR(p), rpmteKey(p),
fn, NULL,