update to 3.6.2
This commit is contained in:
parent
9a0f600c19
commit
9d164f1a74
@ -1,98 +0,0 @@
|
||||
From 9e0e8bf226112195c93fa2493086353bd46bd001 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Schroeder <mls@suse.de>
|
||||
Date: Wed, 17 Dec 2014 18:07:11 +0100
|
||||
Subject: [PATCH 2/4] do not finish applydeltarpm jobs when in the middle of a
|
||||
request
|
||||
|
||||
If applydeltarpm failed we start another request, this does not
|
||||
mix well if re're in the middle of receiving another request...
|
||||
---
|
||||
drpmsync | 39 +++++++++++++++++++++++++++------------
|
||||
1 file changed, 27 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/drpmsync b/drpmsync
|
||||
index f629aad..2265b7e 100755
|
||||
--- a/drpmsync
|
||||
+++ b/drpmsync
|
||||
@@ -2686,6 +2686,7 @@ sub opensock {
|
||||
return if $sock_isopen;
|
||||
my $tcpproto = getprotobyname('tcp');
|
||||
socket(S, PF_INET, SOCK_STREAM, $tcpproto) || die("socket: $!\n");
|
||||
+ setsockopt(S, SOL_SOCKET, SO_KEEPALIVE, pack("l",1)) || die("setsockopt: $!\n");
|
||||
connect(S, sockaddr_in($syncport, $syncaddr)) || die("connect: $!\n");
|
||||
$sock_isopen = 1;
|
||||
}
|
||||
@@ -2974,7 +2975,8 @@ sub drpmsync_get_update {
|
||||
} elsif ($type eq 'FISO') {
|
||||
$ans = copytofile(*S, "$tmpnam.fiso", $ans, $anssize, $ctx);
|
||||
$ans = finishreq(*S, $ans, $ctx, $id);
|
||||
- return 'FISO', [ $tmpnam, undef, substr($extra, 0, 12) ];
|
||||
+ $d = [ $tmpnam, undef, substr($extra, 0, 12) ];
|
||||
+ return ('FISO', $d);
|
||||
} elsif ($type eq 'RPM ') {
|
||||
$sabytes -= $anssize;
|
||||
my $delta;
|
||||
@@ -2982,36 +2984,49 @@ sub drpmsync_get_update {
|
||||
die("nothing to do?\n") if $nrpm == 0 && $ndrpm == 0;
|
||||
my @deltas;
|
||||
my $dextra = substr($extra, 12 + 16);
|
||||
+ my @renames;
|
||||
while ($ndrpm > 0) {
|
||||
$delta = $tmpnam;
|
||||
$delta =~ s/[^\/]*$//;
|
||||
$delta .= substr($dextra, 12, 32 * 3);
|
||||
- # end old job if we have a delta conflict
|
||||
- checkjob() if $runningjob && -e $delta;
|
||||
my $size = hex(substr($dextra, 12 + 3 * 32, 8));
|
||||
die("delta rpm bigger than answer? $size > $anssize\n") if $size > $anssize;
|
||||
+ push @deltas, $delta;
|
||||
+ # conflict with running job?
|
||||
+ if ($runningjob && -e $delta) {
|
||||
+ push @renames, $delta;
|
||||
+ $delta .= ".tmp";
|
||||
+ }
|
||||
$ans = copytofile(*S, $delta, $ans, $size, $ctx);
|
||||
$anssize -= $size;
|
||||
fixmodetime($delta, substr($dextra, 0, 12));
|
||||
$dextra = substr($dextra, 12 + 32 * 3 + 8);
|
||||
- push @deltas, $delta;
|
||||
$ndrpm--;
|
||||
}
|
||||
- if ($nrpm == 1) {
|
||||
+ if ($nrpm) {
|
||||
$ans = copytofile_seek(*S, $tmpnam, $extractoff, $ans, $anssize, $ctx);
|
||||
- $ans = finishreq(*S, $ans, $ctx, $id);
|
||||
- return 'RPM ', [ $dto->[0] ], @deltas if $rextract;
|
||||
+ } else {
|
||||
+ die("junk at end of answer\n") if $anssize;
|
||||
+ }
|
||||
+ $ans = finishreq(*S, $ans, $ctx, $id);
|
||||
+ if (@renames) {
|
||||
+ checkjob();
|
||||
+ for (@renames) {
|
||||
+ rename("$_.tmp", $_) || die("rename $_.tmp $_: $!\n");
|
||||
+ }
|
||||
+ }
|
||||
+ if (!$nrpm) {
|
||||
+ $d = [ undef, undef, substr($extra, 0, 12) ];
|
||||
+ } elsif ($rextract) {
|
||||
+ $d = [ $dto->[0] ];
|
||||
+ } else {
|
||||
fixmodetime($tmpnam, substr($extra, 0, 12));
|
||||
my @s = stat($tmpnam);
|
||||
die("$tmpnam: $!\n") unless @s;
|
||||
$sabytes += $s[7];
|
||||
$d = [ $dto->[0], "$s[9]/$s[7]/$s[1]", sprintf("1%03x%08x", ($s[2] & 07777), $s[9]), rpminfo($tmpnam) ];
|
||||
- } else {
|
||||
- die("junk at end of answer\n") if $anssize;
|
||||
- $ans = finishreq(*S, $ans, $ctx, $id);
|
||||
- $d = [ undef, undef, substr($extra, 0, 12) ];
|
||||
}
|
||||
- return 'RPM ', $d, @deltas;
|
||||
+ return ('RPM ', $d, @deltas);
|
||||
} else {
|
||||
die("received strange answer type: $type\n");
|
||||
}
|
||||
--
|
||||
2.1.0
|
||||
|
||||
@ -1,25 +0,0 @@
|
||||
From 6b13095e1ae5b3ba2f2631ce750ac1d3d3d3e152 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Schroeder <mls@suse.de>
|
||||
Date: Fri, 9 Jan 2015 12:39:39 +0100
|
||||
Subject: [PATCH 3/4] add newline in missing prelink error
|
||||
|
||||
---
|
||||
prelink.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/prelink.c b/prelink.c
|
||||
index 07516f8..e74fbc5 100644
|
||||
--- a/prelink.c
|
||||
+++ b/prelink.c
|
||||
@@ -130,7 +130,7 @@ prelinked_open(char *name)
|
||||
if (stat("/usr/sbin/prelink", &stb))
|
||||
{
|
||||
perror("/usr/sbin/prelink");
|
||||
- fprintf(stderr, "prelink not installed, cannot undo prelinking");
|
||||
+ fprintf(stderr, "prelink not installed, cannot undo prelinking\n");
|
||||
exit(1);
|
||||
}
|
||||
strcpy(template, "/tmp/deltarpm.XXXXXX");
|
||||
--
|
||||
2.1.0
|
||||
|
||||
@ -1,41 +0,0 @@
|
||||
From 1d0657b29ee72e842e0d1ada61ea0177b3159a8e Mon Sep 17 00:00:00 2001
|
||||
From: Jonathan Dieter <jdieter@lesbg.com>
|
||||
Date: Mon, 12 Jan 2015 13:47:51 +0200
|
||||
Subject: [PATCH 4/4] Return error rather than crashing if we can't allocate
|
||||
memory
|
||||
|
||||
Signed-off-by: Jonathan Dieter <jdieter@lesbg.com>
|
||||
---
|
||||
deltarpmmodule.c | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/deltarpmmodule.c b/deltarpmmodule.c
|
||||
index cf333b6..40ea60f 100644
|
||||
--- a/deltarpmmodule.c
|
||||
+++ b/deltarpmmodule.c
|
||||
@@ -46,6 +46,11 @@ PyObject *createDict(struct deltarpm d)
|
||||
if (d.seq) {
|
||||
char *tmp = calloc(d.seql * 2 + 1, sizeof(char));
|
||||
int i;
|
||||
+
|
||||
+ if(tmp == NULL) {
|
||||
+ PyErr_SetFromErrno(PyExc_SystemError);
|
||||
+ return NULL;
|
||||
+ }
|
||||
for (i = 0; i < d.seql; i++) {
|
||||
char buf[3];
|
||||
|
||||
@@ -54,6 +59,10 @@ PyObject *createDict(struct deltarpm d)
|
||||
}
|
||||
o = PyString_FromString(tmp);
|
||||
free(tmp);
|
||||
+ if(o == NULL) {
|
||||
+ PyErr_SetFromErrno(PyExc_SystemError);
|
||||
+ return NULL;
|
||||
+ }
|
||||
PyDict_SetItemString(dict, "seq", o);
|
||||
Py_DECREF(o);
|
||||
} else {
|
||||
--
|
||||
2.1.0
|
||||
|
||||
@ -1,26 +0,0 @@
|
||||
From 619eaf318b3420056c14933bd513201bfb8af494 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Schroeder <mls@suse.de>
|
||||
Date: Mon, 12 Jan 2015 14:38:50 +0100
|
||||
Subject: [PATCH 5/6] fix off-by-one error in delta generation code
|
||||
|
||||
This could lead to a segfault in rare circumstances.
|
||||
---
|
||||
delta.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/delta.c b/delta.c
|
||||
index 3569351..caafa62 100644
|
||||
--- a/delta.c
|
||||
+++ b/delta.c
|
||||
@@ -366,7 +366,7 @@ scannext:
|
||||
{
|
||||
if (memcmp(new + scan + HSIZE *3, old + pos2 - 1, HSIZE))
|
||||
{
|
||||
- ssx2 = (ssx2 == prime) ? 0 : ssx2 + 1;
|
||||
+ ssx2 = (ssx2 == prime - 1) ? 0 : ssx2 + 1;
|
||||
pos2 = hash[ssx2];
|
||||
}
|
||||
}
|
||||
--
|
||||
2.1.0
|
||||
|
||||
@ -1,43 +0,0 @@
|
||||
From 19b7ad9efae520997da8b4b58a5ae0208185952c Mon Sep 17 00:00:00 2001
|
||||
From: Jonathan Dieter <jdieter@lesbg.com>
|
||||
Date: Wed, 14 Jan 2015 08:16:55 +0200
|
||||
Subject: [PATCH 6/6] Add fflush's so output can be watched using tail -f
|
||||
|
||||
Signed-off-by: Jonathan Dieter <jdieter@lesbg.com>
|
||||
---
|
||||
applydeltaiso.c | 11 +++++++++--
|
||||
1 file changed, 9 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/applydeltaiso.c b/applydeltaiso.c
|
||||
index 67f8e39..e482694 100644
|
||||
--- a/applydeltaiso.c
|
||||
+++ b/applydeltaiso.c
|
||||
@@ -122,6 +122,7 @@ processrpm(FILE *fpold, struct cfile *ocf, struct cfile *cf, unsigned int *nmp,
|
||||
unsigned char buf[8192];
|
||||
|
||||
printf("%s: verbatim copy\n", namebuf);
|
||||
+ fflush(stdout);
|
||||
len = cget4(cf);
|
||||
while (len)
|
||||
{
|
||||
@@ -141,9 +142,15 @@ processrpm(FILE *fpold, struct cfile *ocf, struct cfile *cf, unsigned int *nmp,
|
||||
return;
|
||||
}
|
||||
if (ctype == 254)
|
||||
- printf("%s: copying unchanged payload\n", namebuf);
|
||||
+ {
|
||||
+ printf("%s: copying unchanged payload\n", namebuf);
|
||||
+ fflush(stdout);
|
||||
+ }
|
||||
else
|
||||
- printf("%s (%s): applying delta\n", namebuf, cfile_comp2str(ctype));
|
||||
+ {
|
||||
+ printf("%s (%s): applying delta\n", namebuf, cfile_comp2str(ctype));
|
||||
+ fflush(stdout);
|
||||
+ }
|
||||
rpmn = cget4(cf);
|
||||
if (rpmn < 0 || rpmn >= nmpn)
|
||||
{
|
||||
--
|
||||
2.1.0
|
||||
|
||||
BIN
3.6.2.tar.gz
Normal file
BIN
3.6.2.tar.gz
Normal file
Binary file not shown.
@ -1,12 +0,0 @@
|
||||
diff -urb deltarpm-3.6/Makefile deltarpm-3.6b/Makefile
|
||||
--- deltarpm-3.6/Makefile 2013-06-07 16:02:18.000000000 +0100
|
||||
+++ deltarpm-3.6b/Makefile 2018-07-14 22:36:28.105979631 +0100
|
||||
@@ -12,7 +12,7 @@
|
||||
CPPFLAGS = -fPIC -DDELTARPM_64BIT -DBSDIFF_NO_SUF -DRPMDUMPHEADER=\"$(rpmdumpheader)\" $(zlibcppflags)
|
||||
LDLIBS = -lbz2 $(zlibldflags) -llzma
|
||||
LDFLAGS =
|
||||
-PYTHONS = python python3
|
||||
+PYTHONS = python2 python3
|
||||
|
||||
all: makedeltarpm applydeltarpm rpmdumpheader makedeltaiso applydeltaiso combinedeltarpm fragiso
|
||||
|
||||
Binary file not shown.
@ -1,17 +1,11 @@
|
||||
%bcond_without python3
|
||||
Name: deltarpm
|
||||
Version: 3.6
|
||||
Release: 30
|
||||
Version: 3.6.2
|
||||
Release: 1
|
||||
Summary: deltarpm contains the difference between an old and a new version of an RPM package.
|
||||
License: BSD
|
||||
URL: http://gitorious.org/deltarpm/deltarpm
|
||||
Source0: https://github.com/rpm-software-management/%{name}/archive/%{name}-%{version}.tar.bz2
|
||||
Patch0: 0002-do-not-finish-applydeltarpm-jobs-when-in-the-middle-.patch
|
||||
Patch1: 0003-add-newline-in-missing-prelink-error.patch
|
||||
Patch2: 0004-Return-error-rather-than-crashing-if-we-can-t-alloca.patch
|
||||
Patch3: 0005-fix-off-by-one-error-in-delta-generation-code.patch
|
||||
Patch4: 0006-Add-fflush-s-so-output-can-be-watched-using-tail-f.patch
|
||||
Patch5: deltarpm-3.6-fix-python2.patch
|
||||
Source0: https://github.com/rpm-software-management/deltarpm/archive/3.6.2.tar.gz
|
||||
|
||||
BuildRequires: gcc bzip2-devel perl-generators xz-devel rpm-devel popt-devel zlib-devel
|
||||
BuildRequires: %{_vendor}-rpm-config
|
||||
@ -61,7 +55,6 @@ Python3 bindings for deltarpm.
|
||||
%install
|
||||
%makeinstall pylibprefix=%{buildroot}
|
||||
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%license LICENSE.BSD
|
||||
@ -84,6 +77,12 @@ Python3 bindings for deltarpm.
|
||||
%{python3_sitearch}/_%{name}module.so
|
||||
|
||||
%changelog
|
||||
* Sat Jan 11 2020 openEuler Buildteam <buildteam@openeuler.org> - 3.6.2-1
|
||||
- Type: enhancement
|
||||
- ID: NA
|
||||
- SUG: NA
|
||||
- DESC: update to 3.6.2
|
||||
|
||||
* Mon Dec 23 2019 openEuler Buildteam <buildteam@openeuler.org> - 3.6-30
|
||||
- Modify email address
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user