rpms/deltarpm/devel deltarpm-3.4-no-skip-doc.patch, NONE, 1.1 deltarpm-3.4-prelink-bugfix.patch, NONE, 1.1 deltarpm.spec, 1.7, 1.8
Jonathan Dieter (jdieter)
fedora-extras-commits at redhat.com
Wed Jul 11 14:46:44 UTC 2007
Author: jdieter
Update of /cvs/extras/rpms/deltarpm/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv1313
Modified Files:
deltarpm.spec
Added Files:
deltarpm-3.4-no-skip-doc.patch
deltarpm-3.4-prelink-bugfix.patch
Log Message:
Fix prelink bug and skip %doc bug
deltarpm-3.4-no-skip-doc.patch:
--- NEW FILE deltarpm-3.4-no-skip-doc.patch ---
diff -ur deltarpm-3.4b/makedeltarpm.c deltarpm-3.4a/makedeltarpm.c
--- deltarpm-3.4b/makedeltarpm.c 2007-03-06 15:35:55.000000000 +0200
+++ deltarpm-3.4a/makedeltarpm.c 2007-04-04 21:13:04.000000000 +0300
@@ -887,6 +887,13 @@
fprintf(vfp, "skipping %s: bad file flags\n", np);
skipped_fileflags++;
}
+ else if ((fileflags[i] & FILE_DOC) != 0)
+ {
+ if (verbose > 1)
+ fprintf(vfp, "USING DOC %s\n", np);
+ lsize = size;
+ skip = 0;
+ }
else if ((fileverify[i] & (VERIFY_MD5|VERIFY_FILESIZE)) != (VERIFY_MD5|VERIFY_FILESIZE))
{
if (verbose > 1)
diff -ur deltarpm-3.4b/rpmhead.h deltarpm-3.4a/rpmhead.h
--- deltarpm-3.4b/rpmhead.h 2007-03-06 15:35:55.000000000 +0200
+++ deltarpm-3.4a/rpmhead.h 2007-04-04 21:12:05.000000000 +0300
@@ -35,6 +35,7 @@
#define SIGTAG_SHA1 269
#define FILE_CONFIG (1 << 0)
+#define FILE_DOC (1 << 1)
#define FILE_MISSINGOK (1 << 3)
#define FILE_GHOST (1 << 6)
#define FILE_UNPATCHED (1 << 10)
deltarpm-3.4-prelink-bugfix.patch:
--- NEW FILE deltarpm-3.4-prelink-bugfix.patch ---
diff -ur deltarpm-3.4-b/applydeltarpm.c deltarpm-3.4/applydeltarpm.c
--- deltarpm-3.4-b/applydeltarpm.c 2007-06-11 13:31:36.000000000 +0300
+++ deltarpm-3.4/applydeltarpm.c 2007-06-11 13:40:29.000000000 +0300
@@ -394,10 +394,7 @@
{
if (fd != -1)
{
- if (isp)
- prelinked_close(fd);
- else
- close(fd);
+ close(fd);
fd = -1;
}
sd++;
@@ -486,10 +483,7 @@
{
if (fd)
{
- if (isp)
- prelinked_close(fd);
- else
- close(fd);
+ close(fd);
fd = -1;
}
l2 = l > sd->datalen - o ? sd->datalen - o : l;
@@ -996,7 +990,7 @@
rpmMD5Update(&ctx, buf, l);
size -= l;
}
- prelinked_close(fd);
+ close(fd);
rpmMD5Final(md5, &ctx);
if (memcmp(md5, hmd5, 16))
{
Only in deltarpm-3.4-b: applydeltarpm.c.orig
diff -ur deltarpm-3.4-b/prelink.c deltarpm-3.4/prelink.c
--- deltarpm-3.4-b/prelink.c 2005-06-06 15:41:07.000000000 +0300
+++ deltarpm-3.4/prelink.c 2007-06-11 13:38:30.000000000 +0300
@@ -125,6 +125,7 @@
int status;
int p[2];
struct stat stb;
+ char template[21];
if (stat("/usr/sbin/prelink", &stb))
{
@@ -132,49 +133,33 @@
fprintf(stderr, "prelink not installed, cannot undo prelinking");
exit(1);
}
- if (prelink_pid != (pid_t)-1)
+ strcpy(template, "/tmp/deltarpm.XXXXXX");
+ if ((fd = mkstemp(template)) == -1)
{
- waitpid(prelink_pid, &status, WNOHANG);
- prelink_pid = (pid_t)-1;
- }
- if (pipe(p))
- {
- perror("pipe");
+ perror("mkstemp");
exit(1);
}
+ close(fd); /* prelink renames another tmpfile over our file */
pid = fork();
if (pid == (pid_t)(-1))
{
perror("fork");
exit(1);
}
- if (pid)
+ if (!pid)
{
- prelink_pid = pid;
- close(p[1]);
- return p[0];
+ execl("/usr/sbin/prelink", "prelink", "-o", template, "-u", name, (char *)0);
+ perror("/usr/sbin/prelink");
+ _exit(1);
}
- close(p[0]);
- if (p[1] != 1)
+ while (waitpid(pid, &status, 0) == (pid_t)-1)
+ ;
+ if ((fd = open(template, O_RDONLY)) == -1)
{
- dup2(p[1], 1);
- close(p[1]);
+ perror(template);
+ exit(1);
}
- execl("/usr/sbin/prelink", "prelink", "-y", name, (char *)0);
- perror("/usr/sbin/prelink");
- _exit(1);
+ unlink(template);
+ return fd;
}
-void
-prelinked_close(int fd)
-{
- int status;
-
- close(fd);
- if (prelink_pid != (pid_t)-1)
- {
- kill(prelink_pid, SIGPIPE);
- if (waitpid(prelink_pid, &status, 0) == prelink_pid)
- prelink_pid = (pid_t)-1;
- }
-}
diff -ur deltarpm-3.4-b/prelink.h deltarpm-3.4/prelink.h
--- deltarpm-3.4-b/prelink.h 2005-06-02 20:01:07.000000000 +0300
+++ deltarpm-3.4/prelink.h 2007-06-11 13:38:42.000000000 +0300
@@ -1,3 +1,2 @@
extern int is_prelinked(int fd, unsigned char *buf, int l);
extern int prelinked_open(char *name);
-extern void prelinked_close(int fd);
Index: deltarpm.spec
===================================================================
RCS file: /cvs/extras/rpms/deltarpm/devel/deltarpm.spec,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- deltarpm.spec 5 Jun 2007 17:40:47 -0000 1.7
+++ deltarpm.spec 11 Jul 2007 14:46:11 -0000 1.8
@@ -1,7 +1,7 @@
Summary: Create deltas between rpms
Name: deltarpm
Version: 3.4
-Release: 3%{?dist}
+Release: 4%{?dist}
License: BSD
Group: System Environment/Base
URL: http://www.novell.com/products/linuxpackages/professional/deltarpm.html
@@ -13,6 +13,8 @@
Patch0: deltarpm-3.4-multilib-workaround.patch
Patch1: deltarpm-3.4-multilib-include-colored.patch
+Patch2: deltarpm-3.4-prelink-bugfix.patch
+Patch3: deltarpm-3.4-no-skip-doc.patch
%description
A deltarpm contains the difference between an old
@@ -25,6 +27,8 @@
%setup -q
%patch0 -p0 -b .multilib
%patch1 -p1 -b .multicolor
+%patch2 -p1 -b .prelink
+%patch3 -p1 -b .nodoc
%build
%{__make} %{?_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" \
@@ -51,6 +55,12 @@
%{_bindir}/rpmdumpheader
%changelog
+* Wed Jul 11 2007 Jonathan Dieter <jdieter at gmail.com> - 3.4-4
+- Fix prelink bug
+- Ignore verify bits on %doc files as they were set incorrectly in older
+ versions of rpm. Without this patch, deltarpm will not delta doc files
+ in rpm created before April-May 2007
+
* Tue Jun 5 2007 Jeremy Katz <katzj at redhat.com> - 3.4-3
- include colored binaries from non-multilib-dirs so that deltas can work
on multilib platforms
More information about the scm-commits
mailing list