Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 147987 Details for
Bug 128622
bi-arch packages cause unnecessary .rpmnew and .rpmsave files
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Proposed patch
rpm-4.4.2-less-conflicts.patch (text/plain), 3.21 KB, created by
Tomas Mraz
on 2007-02-13 14:50:25 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Tomas Mraz
Created:
2007-02-13 14:50:25 UTC
Size:
3.21 KB
patch
obsolete
>--- rpm-4.4.2/lib/rpmfi.h.less-conflicts 2005-02-10 09:30:28.000000000 +0100 >+++ rpm-4.4.2/lib/rpmfi.h 2007-02-13 14:52:26.000000000 +0100 >@@ -620,6 +620,14 @@ > /*@modifies nfi, fileSystem, internalState @*/; > > /** >+ * Return whether file is conflicting config >+ * @param fi file info >+ * @return 1 if config file and file on disk conflicts >+ */ >+int rpmfiConfigConflict(const rpmfi fi) >+ /*@*/; >+ >+/** > * Return formatted string representation of package disposition. > * @param fi file info set > * @return formatted string >--- rpm-4.4.2/lib/transaction.c.less-conflicts 2007-02-13 14:52:25.000000000 +0100 >+++ rpm-4.4.2/lib/transaction.c 2007-02-13 14:52:26.000000000 +0100 >@@ -543,7 +543,7 @@ > /*@-boundswrite@*/ > switch (rpmteType(p)) { > case TR_ADDED: >- { struct stat sb; >+ { > int reportConflicts = > !(rpmtsFilterFlags(ts) & RPMPROB_FILTER_REPLACENEWFILES); > int done = 0; >@@ -552,7 +552,7 @@ > /* XXX is this test still necessary? */ > if (fi->actions[i] != FA_UNKNOWN) > /*@switchbreak@*/ break; >- if ((FFlags & RPMFILE_CONFIG) && !lstat(fn, &sb)) { >+ if (rpmfiConfigConflict(fi)) { > /* Here is a non-overlapped pre-existing config file. */ > fi->actions[i] = (FFlags & RPMFILE_NOREPLACE) > ? FA_ALTNAME : FA_BACKUP; >@@ -609,7 +609,7 @@ > /* Try to get the disk accounting correct even if a conflict. */ > fixupSize = rpmfiFSize(otherFi); > >- if ((FFlags & RPMFILE_CONFIG) && !lstat(fn, &sb)) { >+ if (rpmfiConfigConflict(fi)) { > /* Here is an overlapped pre-existing config file. */ > fi->actions[i] = (FFlags & RPMFILE_NOREPLACE) > ? FA_ALTNAME : FA_SKIP; >--- rpm-4.4.2/lib/rpmfi.c.less-conflicts 2007-02-13 14:52:26.000000000 +0100 >+++ rpm-4.4.2/lib/rpmfi.c 2007-02-13 15:18:31.000000000 +0100 >@@ -22,6 +22,7 @@ > #include "rpmte.h" > #include "rpmts.h" > >+#include "legacy.h" /* XXX domd5 */ > #include "misc.h" /* XXX stripTrailingChar */ > #include "rpmmacro.h" /* XXX rpmCleanPath */ > >@@ -631,6 +632,51 @@ > } > /*@=boundsread@*/ > >+/*@-boundsread@*/ >+int rpmfiConfigConflict(const rpmfi fi) >+{ >+ const char * fn = rpmfiFN(fi); >+ int flags = rpmfiFFlags(fi); >+ char buffer[1024]; >+ fileTypes newWhat, diskWhat; >+ struct stat sb; >+ >+ if (!(flags & RPMFILE_CONFIG) || lstat(fn, &sb)) { >+ return 0; >+ } >+ >+ diskWhat = whatis((int_16)sb.st_mode); >+ newWhat = whatis(rpmfiFMode(fi)); >+ >+ if (newWhat != LINK && newWhat != REG) >+ return 1; >+ >+ if (diskWhat != newWhat) >+ return 1; >+ >+ memset(buffer, 0, sizeof(buffer)); >+ if (newWhat == REG) { >+ const unsigned char * nmd5; >+ /* XXX avoid md5 on sparse /var/log/lastlog file. */ >+ if (strcmp(fn, "/var/log/lastlog") && >+ domd5(fn, (unsigned char *)buffer, 0, NULL)) >+ return 0; /* assume file has been removed */ >+ nmd5 = rpmfiMD5(fi); >+ if (nmd5 && !memcmp(nmd5, buffer, 16)) >+ return 0; /* unmodified config file */ >+ } else /* newWhat == LINK */ { >+ const char * nFLink; >+ if (readlink(fn, buffer, sizeof(buffer) - 1) == -1) >+ return 0; /* assume file has been removed */ >+ nFLink = rpmfiFLink(fi); >+ if (nFLink && !strcmp(nFLink, buffer)) >+ return 0; /* unmodified config file */ >+ } >+ >+ return 1; >+} >+/*@=boundsread@*/ >+ > /*@observer@*/ > const char *const rpmfiTypeString(rpmfi fi) > {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 128622
:
119969
| 147987