rpms/rpm/devel rpm-4.7.0-beta1-default-filestate.patch, NONE, 1.1 rpm.spec, 1.342, 1.343

Panu Matilainen pmatilai at fedoraproject.org
Fri Apr 3 07:45:55 UTC 2009


Author: pmatilai

Update of /cvs/pkgs/rpms/rpm/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv26900

Modified Files:
	rpm.spec 
Added Files:
	rpm-4.7.0-beta1-default-filestate.patch 
Log Message:
- fix recorded file state of otherwise skipped files (#492947)
- compress ChangeLog, drop old CHANGES file (#492440)


rpm-4.7.0-beta1-default-filestate.patch:

--- NEW FILE rpm-4.7.0-beta1-default-filestate.patch ---
commit 4e77d95a7856216e49453009c855cce701734b9c
Author: Panu Matilainen <pmatilai at redhat.com>
Date:   Fri Apr 3 10:28:59 2009 +0300

    Make sure installed files have state (rhbz#492947)
    - rpmfsSetState() doesn't get called for skipped files like %ghost and
      %config(noreplace), causing incorrect file state ("no state") getting
      recorded in rpmdb, leading to inapproriate removal/rename on erase, ick
    - For TR_ADDED, always default file states to RPMFILE_STATE_NORMAL, fsm
      changes it as necessary for skipped colors and such. Lazy alloc on
      rpmfsSetState() is not correct as rpmfsSetState() might not get called
      at all.
    - originally broken by commit 8d6c4b8c95b59f5a71d90c582c2e98f5c7ed7b9d

diff --git a/lib/fsm.c b/lib/fsm.c
index b892b03..752f0cc 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -663,8 +663,6 @@ static int fsmMapPath(FSM_t fsm)
 	    break;
 	case FA_COPYIN:
 	case FA_CREATE:
-	    if (rpmteType(te) == TR_ADDED)
-		rpmfsSetState(fs, i, RPMFILE_STATE_NORMAL);
 	    break;
 
 	case FA_SKIPNSTATE:
diff --git a/lib/rpmte.c b/lib/rpmte.c
index 6ff20f5..e1ef060 100644
--- a/lib/rpmte.c
+++ b/lib/rpmte.c
@@ -285,7 +285,7 @@ static void addTE(rpmts ts, rpmte p, Header h,
 	struct rpmtd_s bnames;
 	headerGet(h, RPMTAG_BASENAMES, &bnames, HEADERGET_MINMEM);
 
-	p->fs = rpmfsNew(rpmtdCount(&bnames));
+	p->fs = rpmfsNew(rpmtdCount(&bnames), p->type);
 
 	rpmtdFreeData(&bnames);
     }
@@ -896,11 +896,15 @@ rpmfs rpmteGetFileStates(rpmte te) {
     return te->fs;
 }
 
-rpmfs rpmfsNew(unsigned int fc) {
+rpmfs rpmfsNew(unsigned int fc, rpmElementType type) {
     rpmfs fs = xmalloc(sizeof(*fs));
     fs->fc = fc;
     fs->replaced = NULL;
     fs->states = NULL;
+    if (type == TR_ADDED) {
+	fs->states = xmalloc(sizeof(*fs->states) * fs->fc);
+	memset(fs->states, RPMFILE_STATE_NORMAL, fs->fc);
+    }
     fs->actions = xmalloc(fc * sizeof(*fs->actions));
     memset(fs->actions, FA_UNKNOWN, fc * sizeof(*fs->actions));
     fs->numReplaced = fs->allocatedReplaced = 0;
@@ -958,10 +962,6 @@ sharedFileInfo rpmfsNextReplaced(rpmfs fs , sharedFileInfo replaced)
 void rpmfsSetState(rpmfs fs, unsigned int ix, rpmfileState state)
 {
     assert(ix < fs->fc);
-    if (fs->states == NULL) {
-	fs->states = xmalloc(sizeof(*fs->states) * fs->fc);
-	memset(fs->states, RPMFILE_STATE_MISSING, fs->fc);
-    }
     fs->states[ix] = state;
 }
 
diff --git a/lib/rpmte_internal.h b/lib/rpmte_internal.h
index 3ce4112..60c52bd 100644
--- a/lib/rpmte_internal.h
+++ b/lib/rpmte_internal.h
@@ -81,7 +81,7 @@ int rpmteHaveTransScript(rpmte te, rpmTag tag);
 rpmfs rpmteGetFileStates(rpmte te);
 
 RPM_GNUC_INTERNAL
-rpmfs rpmfsNew(unsigned int fc);
+rpmfs rpmfsNew(unsigned int fc, rpmElementType type);
 
 RPM_GNUC_INTERNAL
 rpmfs rpmfsFree(rpmfs fs);


Index: rpm.spec
===================================================================
RCS file: /cvs/pkgs/rpms/rpm/devel/rpm.spec,v
retrieving revision 1.342
retrieving revision 1.343
diff -u -r1.342 -r1.343
--- rpm.spec	2 Apr 2009 17:41:14 -0000	1.342
+++ rpm.spec	3 Apr 2009 07:45:24 -0000	1.343
@@ -25,7 +25,7 @@
 Summary: The RPM package management system
 Name: rpm
 Version: %{rpmver}
-Release: 0.%{snapver}.8%{?dist}
+Release: 0.%{snapver}.9%{?dist}
 Group: System Environment/Base
 Url: http://www.rpm.org/
 Source0: http://rpm.org/releases/testing/%{name}-%{srcver}.tar.bz2
@@ -48,6 +48,7 @@
 Patch202: rpm-4.7.0-beta1-installangs.patch
 Patch203: rpm-4.7.0-alpha-isa.patch
 Patch204: rpm-4.7.0-rsa-v4.patch
+Patch205: rpm-4.7.0-beta1-default-filestate.patch
 
 # These are not yet upstream
 Patch300: rpm-4.7.0-extra-provides.patch
@@ -195,6 +196,7 @@
 %patch202 -p1 -b .installangs
 %patch203 -p1 -b .alpha-isa
 %patch204 -p1 -b .rsa-v4
+%patch205 -p1 -b .default-fstate
 
 %patch300 -p1 -b .extra-prov
 %patch301 -p1 -b .rpmfc-order
@@ -274,6 +276,9 @@
 # avoid dragging in tonne of perl libs for an unused script
 chmod 0644 $RPM_BUILD_ROOT/%{rpmhome}/perldeps.pl
 
+# compress our ChangeLog, it's fairly big...
+bzip2 -9 ChangeLog
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -298,7 +303,7 @@
 
 %files -f %{name}.lang
 %defattr(-,root,root,-)
-%doc CHANGES GROUPS COPYING CREDITS ChangeLog doc/manual/[a-z]*
+%doc GROUPS COPYING CREDITS ChangeLog.bz2 doc/manual/[a-z]*
 
 %{_sysconfdir}/cron.daily/rpm
 %config(noreplace,missingok)    %{_sysconfdir}/logrotate.d/rpm
@@ -404,6 +409,10 @@
 %doc doc/librpm/html/*
 
 %changelog
+* Fri Apr 03 2009 Panu Matilainen <pmatilai at redhat.com> - 4.7.0-0.beta1.9
+- fix recorded file state of otherwise skipped files (#492947)
+- compress ChangeLog, drop old CHANGES file (#492440)
+
 * Thu Apr  2 2009 Tom "spot" Callaway <tcallawa at redhat.com> - 4.7.0-0.beta1.8
 - Fix sparcv9v and sparc64v targets
 




More information about the scm-commits mailing list