Hello community,

here is the log from the commit of package deltarpm for openSUSE:Factory 
checked in at 2013-06-13 16:24:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/deltarpm (Old)
 and      /work/SRC/openSUSE:Factory/.deltarpm.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "deltarpm"

Changes:
--------
--- /work/SRC/openSUSE:Factory/deltarpm/deltarpm.changes        2012-01-27 
15:17:14.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.deltarpm.new/deltarpm.changes   2013-06-13 
16:24:52.000000000 +0200
@@ -1,0 +2,7 @@
+Mon Jun 10 15:45:18 CEST 2013 - [email protected]
+
+- update to deltarpm-3.6
+  * fixes failing applydeltarpm with gzip -9 compression
+  * adds a couple of manpages
+
+-------------------------------------------------------------------

Old:
----
  deltarpm-3.5.git.tar.bz2

New:
----
  deltarpm-3.6.tar.bz2
  deltarpm-zlibcppflags.diff

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ deltarpm.spec ++++++
--- /var/tmp/diff_new_pack.pk3zGt/_old  2013-06-13 16:24:53.000000000 +0200
+++ /var/tmp/diff_new_pack.pk3zGt/_new  2013-06-13 16:24:53.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package deltarpm
 #
-# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -15,16 +15,19 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
+
 Name:           deltarpm
-Version:        3.5.git
+Version:        3.6
 Release:        0
 Summary:        Tools to Create and Apply deltarpms
 License:        BSD-3-Clause
 Group:          System/Packages
 Url:            ftp://ftp.suse.com/pub/projects/deltarpm
-Source:         deltarpm-3.5.git.tar.bz2
+Source:         deltarpm-3.6.tar.bz2
 # PATCH-MISSING-TAG -- See 
http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
 Patch0:         patch.sles8
+# PATCH-MISSING-TAG -- See 
http://wiki.opensuse.org/openSUSE:Packaging_Patches_guidelines
+Patch1:         deltarpm-zlibcppflags.diff
 BuildRequires:  libbz2-devel
 BuildRequires:  python-devel
 BuildRequires:  rpm-devel
@@ -56,6 +59,7 @@
 %if 0%{?suse_version} < 900
 %patch0
 %endif
+%patch1
 
 %build
 make CC="gcc" CFLAGS="%{optflags}" rpmdumpheader="/usr/lib/rpm/rpmdumpheader" 
%{?_smp_mflags}
@@ -63,7 +67,7 @@
 
 %install
 mkdir -p %{buildroot}%{_prefix}/lib/rpm
-make DESTDIR=%{buildroot} prefix="%{_prefix}" libdir="%{_libdir}" 
mandir="%{_mandir}" rpmdumpheader="/usr/lib/rpm/rpmdumpheader" install
+make DESTDIR=%{buildroot} prefix="%{_prefix}" libdir="%{_libdir}" 
mandir="%{_mandir}" rpmdumpheader="/usr/lib/rpm/rpmdumpheader" PYTHONS="python" 
install
 rm -rf 
%{buildroot}%{_libdir}/python/site-packages/{_deltarpmmodule.so,deltarpm.py} # 
Remove wrongly installed Python module
 mv %{buildroot}%{python_sitearch}/_deltarpm{module,}.so # Fix binary Python 
module name
 

++++++ deltarpm-3.5.git.tar.bz2 -> deltarpm-3.6.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/deltarpm-3.5.git/.gitignore 
new/deltarpm-3.6/.gitignore
--- old/deltarpm-3.5.git/.gitignore     1970-01-01 01:00:00.000000000 +0100
+++ new/deltarpm-3.6/.gitignore 2013-06-07 17:02:18.000000000 +0200
@@ -0,0 +1,9 @@
+*.o
+*.a
+applydeltaiso
+applydeltarpm
+combinedeltarpm
+fragiso
+makedeltaiso
+makedeltarpm
+rpmdumpheader
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/deltarpm-3.5.git/Makefile new/deltarpm-3.6/Makefile
--- old/deltarpm-3.5.git/Makefile       2010-10-15 17:05:43.000000000 +0200
+++ new/deltarpm-3.6/Makefile   2013-06-07 17:02:18.000000000 +0200
@@ -4,41 +4,49 @@
 mandir=$(prefix)/man
 rpmdumpheader=$(bindir)/rpmdumpheader
 zlibdir=zlib-1.2.2.f-rsyncable
+zlibbundled=$(zlibdir)/libz.a
+zlibldflags=$(zlibbundled)
+zlibcppflags=-I$(zlibdir)
+pylibprefix=/
 CFLAGS = -fPIC -O2 -Wall -g
-CPPFLAGS = -fPIC -DDELTARPM_64BIT -DBSDIFF_NO_SUF 
-DRPMDUMPHEADER=\"$(rpmdumpheader)\" -I$(zlibdir)
-LDLIBS = -lbz2 $(zlibdir)/libz.a -llzma
+CPPFLAGS = -fPIC -DDELTARPM_64BIT -DBSDIFF_NO_SUF 
-DRPMDUMPHEADER=\"$(rpmdumpheader)\" $(zlibcppflags)
+LDLIBS = -lbz2 $(zlibldflags) -llzma
 LDFLAGS =
-PYTHONVERS = $(shell ls /usr/include/python*/Python.h | sed 
"s|/usr/include/||g"| sed "s|/Python.h||g")
+PYTHONS = python python3
 
 all: makedeltarpm applydeltarpm rpmdumpheader makedeltaiso applydeltaiso 
combinedeltarpm fragiso
 
 python: _deltarpmmodule.so
 
-makedeltarpm: makedeltarpm.o writedeltarpm.o md5.o util.o rpml.o rpmhead.o 
cpio.o delta.o cfile.o $(zlibdir)/libz.a
+makedeltarpm: makedeltarpm.o writedeltarpm.o md5.o util.o rpml.o rpmhead.o 
cpio.o delta.o cfile.o $(zlibbundled)
 
-applydeltarpm: applydeltarpm.o readdeltarpm.o md5.o sha256.o util.o rpmhead.o 
cpio.o cfile.o prelink.o $(zlibdir)/libz.a
+applydeltarpm: applydeltarpm.o readdeltarpm.o md5.o sha256.o util.o rpmhead.o 
cpio.o cfile.o prelink.o $(zlibbundled)
 
-combinedeltarpm: combinedeltarpm.o md5.o util.o rpmhead.o cfile.o 
readdeltarpm.o writedeltarpm.o $(zlibdir)/libz.a
+combinedeltarpm: combinedeltarpm.o md5.o util.o rpmhead.o cfile.o 
readdeltarpm.o writedeltarpm.o $(zlibbundled)
 
 rpmdumpheader: rpmdumpheader.o
        $(CC) $(LDFLAGS) $^ -lrpm -lrpmio -o $@
 
-makedeltaiso: makedeltaiso.o delta.o rpmoffs.o rpmhead.o util.o md5.o cfile.o 
$(zlibdir)/libz.a
+makedeltaiso: makedeltaiso.o delta.o rpmoffs.o rpmhead.o util.o md5.o cfile.o 
$(zlibbundled)
 
-applydeltaiso: applydeltaiso.o util.o md5.o cfile.o $(zlibdir)/libz.a
+applydeltaiso: applydeltaiso.o util.o md5.o cfile.o $(zlibbundled)
 
-fragiso: fragiso.o util.o md5.o rpmhead.o cfile.o $(zlibdir)/libz.a
+fragiso: fragiso.o util.o md5.o rpmhead.o cfile.o $(zlibbundled)
 
-_deltarpmmodule.so: readdeltarpm.o rpmhead.o util.o md5.o cfile.o 
$(zlibdir)/libz.a
-       for ver in $(PYTHONVERS) ; do \
-               if [ ! -f "$$ver/$@" ]; then \
-                       mkdir -p $$ver ;\
-                       $(CC) $(CFLAGS) -I/usr/include/$$ver -I$(zlibdir) -fPIC 
-c -o $$ver/deltarpmmodule.o deltarpmmodule.c ;\
-                       $(CC) -o $$ver/$@ $$ver/deltarpmmodule.o $^ -shared 
-Wl,-soname,_deltarpmmodule.so $(zlibdir)/libz.a -llzma -lbz2; \
+_deltarpmmodule.so: readdeltarpm.o rpmhead.o util.o md5.o cfile.o 
$(zlibbundled)
+       for PY in $(PYTHONS) ; do \
+               if [ -x /usr/bin/$$PY-config ] && [ -x /usr/bin/$$PY ]; then \
+                       PYVER=`$$PY -c 'from distutils import sysconfig ; 
print(sysconfig.get_python_version())'`; \
+                       PYCFLAGS=`$$PY-config --cflags`; \
+                       if [ ! -f "python$$PYVER/$@" ]; then \
+                               mkdir -p python$$PYVER ;\
+                               $(CC) $(CFLAGS) $$PYCFLAGS $(zlibcppflag) -fPIC 
-c -o python$$PYVER/deltarpmmodule.o deltarpmmodule.c ;\
+                               $(CC) $(LDFLAGS) -o python$$PYVER/$@ 
python$$PYVER/deltarpmmodule.o $^ -shared -Wl,-soname,_deltarpmmodule.so 
$(LDLIBS); \
+                       fi; \
                fi; \
        done
 
-$(zlibdir)/libz.a:
+$(zlibbundled):
        cd $(zlibdir) ; make CFLAGS="-fPIC $(CFLAGS)" libz.a
 
 clean:
@@ -62,12 +70,17 @@
        install -m 644 combinedeltarpm.8 $(DESTDIR)$(mandir)/man8
        install -m 644 makedeltaiso.8 $(DESTDIR)$(mandir)/man8
        install -m 644 applydeltaiso.8 $(DESTDIR)$(mandir)/man8
+       install -m 644 fragiso.8 $(DESTDIR)$(mandir)/man8
        install -m 644 drpmsync.8 $(DESTDIR)$(mandir)/man8
-       for ver in $(PYTHONVERS) ; do \
-               if [ -e $$ver/_deltarpmmodule.so ]; then \
-                       mkdir -p $(DESTDIR)$(libdir)/$$ver/site-packages ; \
-                       install -m 755 $$ver/_deltarpmmodule.so 
$(DESTDIR)$(libdir)/$$ver/site-packages ;\
-                       install -m 644 deltarpm.py 
$(DESTDIR)$(libdir)/$$ver/site-packages ;\
+       for PY in $(PYTHONS) ; do \
+               if [ -x /usr/bin/$$PY ]; then \
+                        PYLIB=`$$PY -c 'from distutils import sysconfig ; 
print(sysconfig.get_python_lib(1))'` ; \
+                       PYVER=`$$PY -c 'from distutils import sysconfig ; 
print(sysconfig.get_python_version())'` ; \
+                       if [ -e python$$PYVER/_deltarpmmodule.so ]; then \
+                               mkdir -p $(DESTDIR)$(pylibprefix)$$PYLIB ; \
+                               install -m 755 python$$PYVER/_deltarpmmodule.so 
$(DESTDIR)$(pylibprefix)$$PYLIB ; \
+                               install -m 644 deltarpm.py 
$(DESTDIR)$(pylibprefix)$$PYLIB ; \
+                       fi; \
                fi; \
        done
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/deltarpm-3.5.git/NEWS new/deltarpm-3.6/NEWS
--- old/deltarpm-3.5.git/NEWS   2010-10-15 17:05:43.000000000 +0200
+++ new/deltarpm-3.6/NEWS       2013-06-07 17:02:18.000000000 +0200
@@ -1,7 +1,14 @@
 
+ What's new in deltarpm-3.6
+----------------------------
+- support for xz payloads
+- new -m option for makedeltarpm to limit the amount of needed memory
+- python module to inspect delta rpms (done by RedHat)
+
  What's new in deltarpm-3.5
 ----------------------------
 - support for sha256 file digests
+- support for lzma payloads
 
  What's new in deltarpm-3.4
 ----------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/deltarpm-3.5.git/applydeltaiso.8 
new/deltarpm-3.6/applydeltaiso.8
--- old/deltarpm-3.5.git/applydeltaiso.8        2010-10-15 17:05:43.000000000 
+0200
+++ new/deltarpm-3.6/applydeltaiso.8    2013-06-07 17:02:18.000000000 +0200
@@ -1,7 +1,7 @@
 .\" man page for applydeltaiso
 .\" Copyright (c) 2005 Michael Schroeder <[email protected]>
 .\" See LICENSE.BSD for license
-.TH APPLYDELTAISO 2 "Jul 2009"
+.TH APPLYDELTAISO 8 "Jul 2009"
 .SH NAME
 applydeltaiso \- reconstruct an iso from the old iso and the deltaiso
 
@@ -17,6 +17,10 @@
 to re-create
 .IR newiso .
 
+When specifying
+.IR oldiso ,
+you can specify a device (such as /dev/dvd).
+
 .SH SEE ALSO
 .BR makedeltaiso (8)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/deltarpm-3.5.git/applydeltaiso.c 
new/deltarpm-3.6/applydeltaiso.c
--- old/deltarpm-3.5.git/applydeltaiso.c        2010-10-15 17:05:43.000000000 
+0200
+++ new/deltarpm-3.6/applydeltaiso.c    2013-06-07 17:02:18.000000000 +0200
@@ -7,6 +7,7 @@
 
 #define _LARGEFILE64_SOURCE
 
+#include <errno.h>
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -22,12 +23,26 @@
 
 #define BLKSIZE 8192
 
+static void perror_fread(FILE *const fp, char const *const msg)
+{
+  if (ferror(fp))
+    {
+      if (!errno)
+        errno = EIO;
+      perror(msg);
+    }
+  else
+    {
+      fprintf(stderr, "%s: unexpected end-of-file\n", msg);
+    }
+}
+
 unsigned int get4(FILE *fp)
 {
   unsigned char dd[4];
   if (fread(dd, 4, 1, fp) != 1)
     {
-      perror("fread");
+      perror_fread(fp, "fread");
       exit(1);
     }
   return dd[0] << 24 | dd[1] << 16 | dd[2] << 8 | dd[3];
@@ -57,7 +72,7 @@
        {
          if (fread(dp, nmp[i], 1, fpold) != 1)
            {
-             perror("fread");
+             perror_fread(fpold, "fread");
              exit(1);
            }
          dp += nmp[i];
@@ -221,7 +236,7 @@
   int i;
 
   /* oldl = cget4(cf); already done in called */
-  newl = cget4(cf);
+  newl = cget4(cf);  (void)newl;
   inn = cget4(cf);
   outn = cget4(cf);
   in = xmalloc2(inn, 2 * sizeof(unsigned int));
@@ -367,7 +382,7 @@
   struct cfile *cf;
   int i;
   unsigned char *outdata;
-  unsigned int outlen, oldl;
+  uint64_t outlen, outspc;
 
   if (argc != 4)
     {
@@ -404,11 +419,40 @@
   nmp[i] = 0;
 
   outlen = 0;
+  outspc = 0;
   for (i = 0; i < nmpn * 2 + 1; i += 2)
-    outlen += nmp[i];
-  printf("reading %d bytes from old iso...", outlen);
+    {
+      outlen += nmp[i];
+      outspc += nmp[i+1];
+    }
+
+  {
+    unsigned const oldl = cget4(cf);
+    if (oldl != (unsigned)outlen)  /* 4GB wrap */
+      {
+        fprintf(stderr, "diff outlen mismatch: whole=%u pieces=%llu\n",
+          oldl, (unsigned long long)outlen);
+        exit(1);
+      }
+  }
+  { /* Incomplete check that 'old' could have been an input for 'delta'.
+     * Alas: delta did not record isomd5 of old.
+     */
+    off_t const thumb = ftello(fpold);  /* current position */
+    int const rv1 = fseeko(fpold, (off_t)0, SEEK_END);
+    off_t const last = ftello(fpold);  /* .st_size */
+    int const rv2 = fseeko(fpold, thumb, SEEK_SET);  /* restore position */
+    if (rv1 != 0 || rv2 != 0 || last < (outlen + outspc))
+      {
+        fprintf(stderr, "%s: too short: %llu vs %llu\n",
+          argv[1], (unsigned long long)last,
+                   (unsigned long long)(outlen + outspc));
+        exit(1);
+      }
+  }
+  printf("reading %llu bytes from old iso...", (unsigned long long)outlen);
   fflush(stdout);
-  outdata = xmalloc(outlen);
+  outdata = xmalloc((unsigned)outlen);
   filloutdata(fpold, outdata, nmp, nmpn);
   printf("done\n");
 
@@ -423,13 +467,7 @@
       fprintf(stderr, "cfile open iso failed\n");
       exit(1);
     }
-  oldl = cget4(cf);
-  if (oldl != outlen)
-    {
-      fprintf(stderr, "diff outlen mismatch: %d %d\n", oldl, outlen);
-      exit(1);
-    }
-  applydelta(fpold, cfnew, cf, outdata, outlen, nmp, nmpn);
+  applydelta(fpold, cfnew, cf, outdata, (unsigned)outlen, nmp, nmpn);
   if (cfnew->close(cfnew) == -1)
     {
       fprintf(stderr, "cfile close iso failed\n");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/deltarpm-3.5.git/cfile.c new/deltarpm-3.6/cfile.c
--- old/deltarpm-3.5.git/cfile.c        2010-10-15 17:05:43.000000000 +0200
+++ new/deltarpm-3.6/cfile.c    2013-06-07 17:02:18.000000000 +0200
@@ -631,7 +631,7 @@
   f->buf[2] = Z_DEFLATED;
   f->buf[3] = 0;
   f->buf[4] = f->buf[5] = f->buf[6] = f->buf[7] = 0;
-  f->buf[8] = 0;
+  f->buf[8] = f->level == 9 ? 2 : f->level < 2 ? 4 : 0;
   f->buf[9] = 3;       /* OS_UNIX */
   if (cfile_writebuf(f, f->buf, 10) != 10)
     {
@@ -888,8 +888,6 @@
 }
 
 
-#ifdef Z_RSYNCABLE
-
 int
 cfile_detect_rsync(struct cfile *f)
 {
@@ -919,10 +917,22 @@
     }
   for (i = 0; i < 2; i++)
     {
+#ifndef Z_RSYNCABLE
+      /* Rsync friendly zlib not available, don't set up a compressor for it
+       * */
+      if (i)
+       {
+         break;
+       }
+#endif
       cstrm[i].zalloc = 0;
       cstrm[i].zfree = 0;
       cstrm[i].opaque = 0;
+#ifdef Z_RSYNCABLE
       if (deflateInit2(&cstrm[i], Z_BEST_COMPRESSION, Z_DEFLATED, -MAX_WBITS, 
8, Z_DEFAULT_STRATEGY | (i == 1 ? Z_RSYNCABLE : 0)) != Z_OK)
+#else
+      if (deflateInit2(&cstrm[i], Z_BEST_COMPRESSION, Z_DEFLATED, -MAX_WBITS, 
8, Z_DEFAULT_STRATEGY) != Z_OK)
+#endif
        {
          if (i)
            deflateEnd(&cstrm[0]);
@@ -964,6 +974,23 @@
                {
                  for (i = 0; i < 2 && !done; i++)
                    {
+#ifndef Z_RSYNCABLE
+                     /* No rsync friendly zlib so we can only test against
+                      * COMP_GZ.  This is suboptimal as it's only when we
+                      * run into an error that we can cut to the end.  So
+                      * we're forced to uncompress and recompress the whole
+                      * output.  Need to determine if we can determine that
+                      * we used the other algorithm is being used after
+                      * decompressing a certain amount of blocks.  Perhaps
+                      * after RSYNC_WIN or MAX_DIST blocks have been
+                      * decompressed we can know whether COMP_GZ_RSYNC was
+                      * used?
+                      */
+                     if (i)
+                       {
+                           break;
+                       }
+#endif
                      cstrm[i].avail_in = sizeof(dbuf) - dstrm.avail_out;
                      cstrm[i].next_in = dbuf;
                      while (cstrm[i].avail_in)
@@ -971,14 +998,23 @@
                          cstrm[i].avail_out = sizeof(cbuf);
                          cstrm[i].next_out = cbuf;
                          ret = deflate(&cstrm[i], dret == Z_STREAM_END ? 
Z_FINISH : Z_NO_FLUSH);
+                         /* Any errors in compressing, set to the other
+                          * compression algorithm
+                          */
                          if (ret != Z_OK && ret != Z_STREAM_END)
                            {
                              comp = i ? CFILE_COMP_GZ: CFILE_COMP_GZ_RSYNC;
                              done = 1;
                              break;
                            }
+                         /* if compression yielded something
+                          */
                          if (cstrm[i].avail_out != sizeof(cbuf))
                            {
+                             /* If the newly compressed block is not equal to
+                              * the original compressed payload, set to the
+                              * opposite compression algorithm
+                              */
                              if (memcmp(b + p[i], cbuf, sizeof(cbuf) - 
cstrm[i].avail_out))
                                {
                                  comp = i ? CFILE_COMP_GZ: CFILE_COMP_GZ_RSYNC;
@@ -987,6 +1023,14 @@
                                }
                              p[i] += sizeof(cbuf) - cstrm[i].avail_out;
                            }
+                         /* If the input stream is not empty but the
+                          * compressor says that the stream is empty we have
+                          * an error.  Set to the opposite compression
+                          * algorithm.
+                          *
+                          * Note -- This code looks wrong:
+                          * Should be Z_STREAM_END, not BZ_STREAM_END
+                          */
                          if (cstrm[i].avail_in && ret == BZ_STREAM_END)
                            {
                              comp = i ? CFILE_COMP_GZ: CFILE_COMP_GZ_RSYNC;
@@ -1011,7 +1055,9 @@
       b = b2;
     }
   deflateEnd(&cstrm[0]);
+#ifdef Z_RSYNCABLE
   deflateEnd(&cstrm[1]);
+#endif
   inflateEnd(&dstrm);
   f->bufN = -1;
   f->strm.gz.avail_in = 0;
@@ -1053,16 +1099,6 @@
   return comp == -1 ? -1 : 0;
 }
 
-#else
-
-int
-cfile_detect_rsync(struct cfile *f)
-{
-  return -1;
-}
-
-#endif
-
 /*****************************************************************
  *  our open function
  */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/deltarpm-3.5.git/combinedeltarpm.8 
new/deltarpm-3.6/combinedeltarpm.8
--- old/deltarpm-3.5.git/combinedeltarpm.8      2010-10-15 17:05:43.000000000 
+0200
+++ new/deltarpm-3.6/combinedeltarpm.8  2013-06-07 17:02:18.000000000 +0200
@@ -20,7 +20,7 @@
 .SH DESCRIPTION
 combinedeltarpm creates a new deltarpm from multiple old ones.
 Applying the rsulting deltarpm has the same effect as applying
-each of the old ones in the specifed order. Use the
+each of the old ones in the specified order. Use the
 .B -v
 option to make combinedeltarpm more verbose about its work.
 .PP
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/deltarpm-3.5.git/deltarpmmodule.c 
new/deltarpm-3.6/deltarpmmodule.c
--- old/deltarpm-3.5.git/deltarpmmodule.c       2010-10-15 17:05:43.000000000 
+0200
+++ new/deltarpm-3.6/deltarpmmodule.c   2013-06-07 17:02:18.000000000 +0200
@@ -13,6 +13,10 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 
+#if PY_MAJOR_VERSION >= 3
+#define PyString_FromString PyBytes_FromString
+#endif
+
 PyObject *createDict(struct deltarpm d)
 {
   PyObject *dict;
@@ -106,9 +110,30 @@
   { NULL }
 };
 
+#if PY_MAJOR_VERSION >= 3
+static struct PyModuleDef moduledef = {
+    PyModuleDef_HEAD_INIT,
+    "_deltarpm",       /* m_name */
+    NULL,              /* m_doc */
+    0,                 /* m_size */
+    deltarpmMethods,   /* m_methods */
+    NULL,              /* m_reload */
+    NULL,              /* m_traverse */
+    NULL,              /* m_clear */
+    NULL               /* m_free */
+};
+    
+PyObject * PyInit__deltarpm(void);
+
+PyObject * PyInit__deltarpm(void)
+{
+    return PyModule_Create(&moduledef);
+}
+#else
 void init_deltarpm(void)
 {
   PyObject *m;
   
   m = Py_InitModule("_deltarpm", deltarpmMethods);
 }
+#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/deltarpm-3.5.git/drpmsync.8 
new/deltarpm-3.6/drpmsync.8
--- old/deltarpm-3.5.git/drpmsync.8     2010-10-15 17:05:43.000000000 +0200
+++ new/deltarpm-3.6/drpmsync.8 2013-06-07 17:02:18.000000000 +0200
@@ -179,7 +179,7 @@
 .BR true|false
 .PP
 If this setting is true the server does not combine deltarpms.
-This increases to amount of data that has to be transfered but
+This increases to amount of data that has to be transferred but
 reduces the processor load on the server.
 .sp
 .ne 3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/deltarpm-3.5.git/fragiso.8 new/deltarpm-3.6/fragiso.8
--- old/deltarpm-3.5.git/fragiso.8      2010-10-15 17:05:43.000000000 +0200
+++ new/deltarpm-3.6/fragiso.8  2013-06-07 17:02:18.000000000 +0200
@@ -25,9 +25,9 @@
 is a list describing all of the rpms on the iso and a data chunk
 containing everything but the rpms. It is used by
 .B drpmsync
-when an iso needs to be transfered. The idea is that often the rpms
+when an iso needs to be transferred. The idea is that often the rpms
 on the iso are already available on the destination host, so it saves
-bandwith to first transfer the fragmented iso, copy the locally
+bandwidth to first transfer the fragmented iso, copy the locally
 available rpms, transfer the unavailable rpms and reassemble the
 iso file.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/deltarpm-3.5.git/makedeltaiso.8 
new/deltarpm-3.6/makedeltaiso.8
--- old/deltarpm-3.5.git/makedeltaiso.8 2010-10-15 17:05:43.000000000 +0200
+++ new/deltarpm-3.6/makedeltaiso.8     2013-06-07 17:02:18.000000000 +0200
@@ -14,6 +14,11 @@
 .SH DESCRIPTION
 makedeltaiso creates a deltaiso from two isos.
 
+Do not specify a device (such as /dev/dvd) for either
+.I oldiso
+or
+.IR newiso .
+
 .SH SEE ALSO
 .BR applydeltaiso (8)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/deltarpm-3.5.git/makedeltaiso.c 
new/deltarpm-3.6/makedeltaiso.c
--- old/deltarpm-3.5.git/makedeltaiso.c 2010-10-15 17:05:43.000000000 +0200
+++ new/deltarpm-3.6/makedeltaiso.c     2013-06-07 17:02:18.000000000 +0200
@@ -280,6 +280,37 @@
 
 void diffit(struct cfile *fpout, FILE *fpold, FILE *fpnew, unsigned char *old, 
unsigned int oldl, unsigned char *new, int newl, struct rpmpay *newpays, int 
newpayn, struct rpmpay *oldpays, int oldpayn, MD5_CTX *ctx);
 
+unsigned int payrawread(FILE *fp, off64_t off, unsigned int len, unsigned char 
**pp)
+{
+  int l, r;
+  struct cfile *cfile;
+
+  if (fseeko64(fp, off, SEEK_SET) != 0)
+    {
+      perror("fseeko");
+      exit(1);
+    }
+  cfile = cfile_open(CFILE_OPEN_RD, CFILE_IO_FILE, fp, CFILE_COMP_UN, len, 0, 
0);
+  if (!cfile)
+    {
+      fprintf(stderr, "cfile open failed\n");
+      exit(1);
+    }
+  l = cfile_copy(cfile, cfile_open(CFILE_OPEN_WR, CFILE_IO_ALLOC, pp, 
CFILE_COMP_UN, CFILE_LEN_UNLIMITED, 0, 0), CFILE_COPY_CLOSE_OUT);
+  if (l == -1)
+    {
+      fprintf(stderr, "cfile_copy failed\n");
+      exit(1);
+    }
+  r = cfile->close(cfile);
+  if (r)
+    {
+      fprintf(stderr, "cfile not used up (%d bytes left)\n", r);
+      exit(1);
+    }
+  return l;
+}
+
 unsigned int payread(FILE *fp, off64_t off, unsigned int len, unsigned char 
**pp, MD5_CTX *ctx, unsigned char *namebuf)
 {
   int l, r;
@@ -320,7 +351,7 @@
 processrpm(struct cfile *fpout, FILE *fpold, FILE *fpnew, struct rpmpay *pay, 
struct rpmpay *oldpays, int oldpayn, MD5_CTX *ctx)
 {
   struct rpmpay *oldpay;
-  int i, n;
+  int i, n, payrawcmp;
   unsigned int l, newl, oldl;
   unsigned char *new, *old;
   unsigned char namebuf[258];
@@ -381,16 +412,35 @@
          fprintf(stderr, "internal error, length mismatch %d %d\n", oldpay->l, 
oldpays[i].l);
          exit(1);
        }
+      /* compare the raw payloads */
+      newl = payrawread(fpnew, pay->o, pay->l, &new);
+      oldl = payrawread(fpold, oldpay->o, oldpay->l, &old);
+      if (newl == oldl && pay->l == oldpay->l)
+       {
+         payrawcmp = memcmp(new, old, newl);
+       }
+      else
+       {
+         payrawcmp = 1;
+       }
+      free(old);
+      old = 0;
+      oldl = 0;
+      free(new);
+      new = 0;
+      newl = 0;
+       
       /* payread will fix namebuf[0] */
       newl = payread(fpnew, pay->o, pay->l, &new, ctx, namebuf);
-      oldl = payread(fpold, oldpay->o, oldpay->l, &old, 0, 0);
-      if (newl == oldl && pay->l == oldpay->l && !memcmp(new, old, newl))
+
+      if (!payrawcmp)
        {
          printf("%s: unchanged...", namebuf + 2);
          namebuf[0] = 254;
        }
       else
        {
+         oldl = payread(fpold, oldpay->o, oldpay->l, &old, 0, 0);
          int comp = cfile_setlevel(namebuf[0], pay->level);
          printf("%s (%s): creating delta...", namebuf + 2, 
cfile_comp2str(comp));
          namebuf[0] = CFILE_COMPALGO(comp) | (CFILE_COMPLEVEL(comp) << 4);     
/* argh! */
@@ -402,9 +452,7 @@
          exit(1);
        }
       bzput4(fpout, n);                /* offset id */
-      if (namebuf[0] == 254)
-        free(old);
-      else
+      if (namebuf[0] != 254)
         diffit(fpout, 0, 0, old, oldl, new, newl, 0, 0, 0, 0, 0);
       old = 0;
       oldl = 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/deltarpm-3.5.git/makedeltarpm.c 
new/deltarpm-3.6/makedeltarpm.c
--- old/deltarpm-3.5.git/makedeltarpm.c 2010-10-15 17:05:43.000000000 +0200
+++ new/deltarpm-3.6/makedeltarpm.c     2013-06-07 17:02:18.000000000 +0200
@@ -864,6 +864,9 @@
   /* open old rpm */
   /* (if alone == 1,  oldrpm == newrpm) */
   rpmname = argv[argc - 3 + alone];
+  if (verbose >= 2)
+    fprintf(vfp, "Old: %s\n", argv[argc - 3 + alone]);
+
   if (!strcmp(rpmname, "-"))
     fd = 0;
   else if ((fd = open(rpmname, O_RDONLY)) < 0)
@@ -1021,8 +1024,12 @@
     }
   else
     {
+      if (verbose >= 2)
+       fprintf(vfp, "New: %s\n", argv[argc - 2]);
+
       if (verbose)
        fprintf(vfp, "reading new rpm...\n");
+ 
       rpmname = argv[argc - 2];
       if (!strcmp(rpmname, "-"))
        nfd = 0;
@@ -1159,12 +1166,17 @@
          cpiopos += sizeof(cph);
          if (memcmp(cph.magic, "070701", 6))
            {
-             fprintf(stderr, "bad cpio archive\n");
+             fprintf(stderr, "bad cpio archive in old deltarpm\n");
+               if (verbose >= 2)
+                 {
+                   fprintf(stderr, "cph.magic: %02x%02x %02x%02x %02x%02x\n", 
cph.magic[0], cph.magic[1], cph.magic[2], cph.magic[3], cph.magic[4], 
cph.magic[5]);
+                   fprintf(stderr, "Expected: 3037 3037 3031\n");
+                 }
              exit(1);
            }
          size = cpion(cph.filesize);
          nsize = cpion(cph.namesize);
-         nlink = cpion(cph.nlink);
+         nlink = cpion(cph.nlink); (void)nlink;
          nsize += (4 - ((nsize + 2) & 3)) & 3;
          if (nsize > namebufl)
            {

++++++ deltarpm-zlibcppflags.diff ++++++
--- ./Makefile.orig     2013-06-10 14:08:00.000000000 +0000
+++ ./Makefile  2013-06-10 14:08:11.000000000 +0000
@@ -40,7 +40,7 @@ _deltarpmmodule.so: readdeltarpm.o rpmhe
                        PYCFLAGS=`$$PY-config --cflags`; \
                        if [ ! -f "python$$PYVER/$@" ]; then \
                                mkdir -p python$$PYVER ;\
-                               $(CC) $(CFLAGS) $$PYCFLAGS $(zlibcppflag) -fPIC 
-c -o python$$PYVER/deltarpmmodule.o deltarpmmodule.c ;\
+                               $(CC) $(CFLAGS) $$PYCFLAGS $(zlibcppflags) 
-fPIC -c -o python$$PYVER/deltarpmmodule.o deltarpmmodule.c ;\
                                $(CC) $(LDFLAGS) -o python$$PYVER/$@ 
python$$PYVER/deltarpmmodule.o $^ -shared -Wl,-soname,_deltarpmmodule.so 
$(LDLIBS); \
                        fi; \
                fi; \
-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to