mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 05:10:05 +02:00
librsync: fix gcc2_x86 build (#1498)
This commit is contained in:
committed by
Jérôme Duval
parent
63b30ecbe9
commit
9dcef57df9
@@ -12,9 +12,12 @@ COPYRIGHT="1995 Patrick Powell
|
||||
1999-2014 Martin Pool
|
||||
2002-2003 Donovan Baarda"
|
||||
LICENSE="GNU LGPL v2.1"
|
||||
REVISION="3"
|
||||
REVISION="4"
|
||||
SOURCE_URI="https://github.com/librsync/librsync/archive/v$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256='b5c4dd114289832039397789e42d4ff0d1108ada89ce74f1999398593fae2169'
|
||||
if [ $effectiveTargetArchitecture = x86_gcc2 ]; then
|
||||
PATCHES="librsync-$portVersion.patchset"
|
||||
fi
|
||||
|
||||
ARCHITECTURES="x86_gcc2 x86 x86_64"
|
||||
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
|
||||
@@ -68,7 +71,7 @@ INSTALL()
|
||||
{
|
||||
make -C build install
|
||||
|
||||
mkdir -p $includeDir
|
||||
mkdir -p $includeDir
|
||||
mv $prefix/include/* $includeDir
|
||||
rmdir $prefix/include
|
||||
|
||||
|
||||
314
net-libs/librsync/patches/librsync-2.0.0.patchset
Normal file
314
net-libs/librsync/patches/librsync-2.0.0.patchset
Normal file
@@ -0,0 +1,314 @@
|
||||
From 3d1328ce82ea49438d9a0fce3bd219ed449279cf Mon Sep 17 00:00:00 2001
|
||||
From: begasus <begasus@gmail.com>
|
||||
Date: Sat, 8 Jul 2017 16:35:17 +0200
|
||||
Subject: librsync, fix gcc2_x86 build
|
||||
|
||||
|
||||
diff --git a/src/delta.c b/src/delta.c
|
||||
index 4a7bece..7683002 100644
|
||||
--- a/src/delta.c
|
||||
+++ b/src/delta.c
|
||||
@@ -3,7 +3,7 @@
|
||||
* librsync -- library for network deltas
|
||||
*
|
||||
* Copyright (C) 2000, 2001 by Martin Pool <mbp@sourcefrog.net>
|
||||
- * Copyright (C) 2003 by Donovan Baarda <abo@minkirri.apana.org.au>
|
||||
+ * Copyright (C) 2003 by Donovan Baarda <abo@minkirri.apana.org.au>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
@@ -84,18 +84,18 @@ const int RS_BLAKE2_SUM_LENGTH = 32;
|
||||
|
||||
/**
|
||||
* 2002-06-26: Donovan Baarda
|
||||
- *
|
||||
+ *
|
||||
* The following is based entirely on pysync. It is much cleaner than the
|
||||
* previous incarnation of this code. It is slightly complicated because in
|
||||
* this case the output can block, so the main delta loop needs to stop
|
||||
* when this happens.
|
||||
- *
|
||||
+ *
|
||||
* In pysync a 'last' attribute is used to hold the last miss or match for
|
||||
- * extending if possible. In this code, basis_len and scoop_pos are used
|
||||
+ * extending if possible. In this code, basis_len and scoop_pos are used
|
||||
* instead of 'last'. When basis_len > 0, last is a match. When basis_len =
|
||||
* 0 and scoop_pos is > 0, last is a miss. When both are 0, last is None
|
||||
* (ie, nothing).
|
||||
- *
|
||||
+ *
|
||||
* Pysync is also slightly different in that a 'flush' method is available
|
||||
* to force output of accumulated data. This 'flush' is use to finalise
|
||||
* delta calculation. In librsync input is terminated with an eof flag on
|
||||
@@ -104,19 +104,19 @@ const int RS_BLAKE2_SUM_LENGTH = 32;
|
||||
* for a flush style API if one is ever needed. Note that flush in pysync
|
||||
* can be used for more than just terminating delta calculation, so a flush
|
||||
* based API can in some ways be more flexible...
|
||||
- *
|
||||
+ *
|
||||
* The input data is first scanned, then processed. Scanning identifies
|
||||
* input data as misses or matches, and emits the instruction stream.
|
||||
* Processing the data consumes it off the input scoop and outputs the
|
||||
* processed miss data into the tube.
|
||||
- *
|
||||
+ *
|
||||
* The scoop contains all data yet to be processed. The scoop_pos is an
|
||||
* index into the scoop that indicates the point scanned to. As data is
|
||||
* scanned, scoop_pos is incremented. As data is processed, it is removed
|
||||
* from the scoop and scoop_pos adjusted. Everything gets complicated
|
||||
* because the tube can block. When the tube is blocked, no data can be
|
||||
* processed.
|
||||
- *
|
||||
+ *
|
||||
*/
|
||||
|
||||
/* used by rdiff, but now redundant */
|
||||
@@ -135,7 +135,7 @@ static inline rs_result rs_processmiss(rs_job_t *job);
|
||||
|
||||
/**
|
||||
* \brief Get a block of data if possible, and see if it matches.
|
||||
- *
|
||||
+ *
|
||||
* On each call, we try to process all of the input data available on the
|
||||
* scoop and input buffer. */
|
||||
static rs_result rs_delta_s_scan(rs_job_t *job)
|
||||
@@ -151,7 +151,7 @@ static rs_result rs_delta_s_scan(rs_job_t *job)
|
||||
/* output any pending output from the tube */
|
||||
result=rs_tube_catchup(job);
|
||||
/* while output is not blocked and there is a block of data */
|
||||
- while ((result==RS_DONE) &&
|
||||
+ while ((result==RS_DONE) &&
|
||||
((job->scoop_pos + job->block_len) < job->scoop_avail)) {
|
||||
/* check if this block matches */
|
||||
if (rs_findmatch(job,&match_pos,&match_len)) {
|
||||
@@ -172,7 +172,7 @@ static rs_result rs_delta_s_scan(rs_job_t *job)
|
||||
(int)RollsumDigest(&job->weak_sum),
|
||||
(int)RollsumDigest(&test));
|
||||
}
|
||||
-
|
||||
+
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -237,21 +237,21 @@ static rs_result rs_delta_s_end(rs_job_t *job)
|
||||
|
||||
void rs_getinput(rs_job_t *job) {
|
||||
size_t len;
|
||||
-
|
||||
+
|
||||
len=rs_scoop_total_avail(job);
|
||||
if (job->scoop_avail < len) {
|
||||
rs_scoop_input(job,len);
|
||||
}
|
||||
}
|
||||
|
||||
-
|
||||
+
|
||||
/**
|
||||
* find a match at scoop_pos, returning the match_pos and match_len.
|
||||
* Note that this will calculate weak_sum if required. It will also
|
||||
* determine the match_len.
|
||||
- *
|
||||
+ *
|
||||
* Note that this routine could be modified to do xdelta style matches that
|
||||
- * would extend matches past block boundaries by matching backwards and
|
||||
+ * would extend matches past block boundaries by matching backwards and
|
||||
* forwards beyond the block boundaries. Extending backwards would require
|
||||
* decrementing scoop_pos as appropriate.
|
||||
*/
|
||||
@@ -285,7 +285,7 @@ inline int rs_findmatch(rs_job_t *job, rs_long_t *match_pos, size_t *match_len)
|
||||
inline rs_result rs_appendmatch(rs_job_t *job, rs_long_t match_pos, size_t match_len)
|
||||
{
|
||||
rs_result result=RS_DONE;
|
||||
-
|
||||
+
|
||||
/* if last was a match that can be extended, extend it */
|
||||
if (job->basis_len && (job->basis_pos + job->basis_len) == match_pos) {
|
||||
job->basis_len+=match_len;
|
||||
@@ -309,14 +309,14 @@ inline rs_result rs_appendmatch(rs_job_t *job, rs_long_t match_pos, size_t match
|
||||
|
||||
/**
|
||||
* Append a miss of length miss_len to the delta, extending a previous miss
|
||||
- * if possible, or flushing any previous match.
|
||||
- *
|
||||
+ * if possible, or flushing any previous match.
|
||||
+ *
|
||||
* This also breaks misses up into block_len segments to avoid accumulating
|
||||
* too much in memory. */
|
||||
inline rs_result rs_appendmiss(rs_job_t *job, size_t miss_len)
|
||||
{
|
||||
rs_result result=RS_DONE;
|
||||
-
|
||||
+
|
||||
/* if last was a match, or block_len misses, appendflush it */
|
||||
if (job->basis_len || (job->scoop_pos >= rs_outbuflen)) {
|
||||
result=rs_appendflush(job);
|
||||
@@ -356,8 +356,8 @@ inline rs_result rs_appendflush(rs_job_t *job)
|
||||
* function processes that match data, returning RS_DONE if it completes,
|
||||
* or RS_BLOCKED if it gets blocked. After it completes scoop_pos is reset
|
||||
* to still point at the next unscanned data.
|
||||
- *
|
||||
- * This function currently just removes data from the scoop and adjusts
|
||||
+ *
|
||||
+ * This function currently just removes data from the scoop and adjusts
|
||||
* scoop_pos appropriately. In the future this could be used for something
|
||||
* like context compressing of miss data. Note that it also calls
|
||||
* rs_tube_catchup to output any pending output. */
|
||||
@@ -368,19 +368,19 @@ inline rs_result rs_processmatch(rs_job_t *job)
|
||||
job->scoop_pos=0;
|
||||
return rs_tube_catchup(job);
|
||||
}
|
||||
-
|
||||
+
|
||||
/**
|
||||
* The scoop contains miss data at scoop_next of length scoop_pos. This
|
||||
* function processes that miss data, returning RS_DONE if it completes, or
|
||||
* RS_BLOCKED if it gets blocked. After it completes scoop_pos is reset to
|
||||
* still point at the next unscanned data.
|
||||
- *
|
||||
+ *
|
||||
* This function uses rs_tube_copy to queue copying from the scoop into
|
||||
* output. and uses rs_tube_catchup to do the copying. This automaticly
|
||||
* removes data from the scoop, but this can block. While rs_tube_catchup
|
||||
* is blocked, scoop_pos does not point at legit data, so scanning can also
|
||||
* not proceed.
|
||||
- *
|
||||
+ *
|
||||
* In the future this could do compression of miss data before outputing
|
||||
* it. */
|
||||
inline rs_result rs_processmiss(rs_job_t *job)
|
||||
@@ -410,7 +410,7 @@ static rs_result rs_delta_s_slack(rs_job_t *job)
|
||||
if (rs_job_input_is_ending(job)) {
|
||||
job->statefn = rs_delta_s_end;
|
||||
return RS_RUNNING;
|
||||
- } else {
|
||||
+ } else {
|
||||
return RS_BLOCKED;
|
||||
}
|
||||
}
|
||||
@@ -449,7 +449,8 @@ rs_job_t *rs_delta_begin(rs_signature_t *sig)
|
||||
if (!sig->tag_table)
|
||||
rs_fatal("Must call rs_build_hash_table() prior to calling rs_delta_begin()");
|
||||
|
||||
- rs_job_t *job;
|
||||
+ {
|
||||
+ rs_job_t *job;
|
||||
|
||||
job = rs_job_new("delta", rs_delta_s_header);
|
||||
job->signature = sig;
|
||||
@@ -470,5 +471,6 @@ rs_job_t *rs_delta_begin(rs_signature_t *sig)
|
||||
}
|
||||
|
||||
return job;
|
||||
+ }
|
||||
}
|
||||
|
||||
diff --git a/src/search.c b/src/search.c
|
||||
index 75433b4..07b842b 100644
|
||||
--- a/src/search.c
|
||||
+++ b/src/search.c
|
||||
@@ -1,31 +1,31 @@
|
||||
/*= -*- c-basic-offset: 4; indent-tabs-mode: nil; -*-
|
||||
*
|
||||
* librsync -- the library for network deltas
|
||||
- *
|
||||
+ *
|
||||
* Copyright (C) 1999, 2000, 2001, 2014 by Martin Pool <mbp@sourcefrog.net>
|
||||
* Copyright (C) 1999 by Andrew Tridgell
|
||||
- *
|
||||
+ *
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation; either version 2.1 of the License, or
|
||||
* (at your option) any later version.
|
||||
- *
|
||||
+ *
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
- *
|
||||
+ *
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
-/*
|
||||
+/*
|
||||
* This file contains code for searching the sumset for matching
|
||||
* values.
|
||||
*/
|
||||
|
||||
-/*
|
||||
+/*
|
||||
* TODO: The common case is that the next block in both streams
|
||||
* match. Can we make that a bit faster at all? We'd need to perhaps
|
||||
* add a link forward between blocks in the sum_struct corresponding
|
||||
@@ -58,9 +58,11 @@ static void swap(rs_target_t *t1, rs_target_t *t2) {
|
||||
t1->t = t2->t;
|
||||
t2->t = ts;
|
||||
|
||||
- int ti = t1->i;
|
||||
+ {
|
||||
+ int ti = t1->i;
|
||||
t1->i = t2->i;
|
||||
t2->i = ti;
|
||||
+ }
|
||||
}
|
||||
|
||||
static int rs_compare_targets(rs_target_t const *t1, rs_target_t const *t2, rs_signature_t * sums) {
|
||||
@@ -68,7 +70,8 @@ static int rs_compare_targets(rs_target_t const *t1, rs_target_t const *t2, rs_s
|
||||
if (v != 0)
|
||||
return v;
|
||||
|
||||
- rs_weak_sum_t w1 = sums->block_sigs[t1->i].weak_sum;
|
||||
+ {
|
||||
+ rs_weak_sum_t w1 = sums->block_sigs[t1->i].weak_sum;
|
||||
rs_weak_sum_t w2 = sums->block_sigs[t2->i].weak_sum;
|
||||
|
||||
v = (w1 > w2) - (w1 < w2);
|
||||
@@ -78,6 +81,7 @@ static int rs_compare_targets(rs_target_t const *t1, rs_target_t const *t2, rs_s
|
||||
return memcmp(sums->block_sigs[t1->i].strong_sum,
|
||||
sums->block_sigs[t2->i].strong_sum,
|
||||
sums->strong_sum_len);
|
||||
+ }
|
||||
}
|
||||
|
||||
static void heap_sort(rs_signature_t * sums) {
|
||||
@@ -153,7 +157,7 @@ rs_build_hash_table(rs_signature_t * sums)
|
||||
|
||||
|
||||
|
||||
-/*
|
||||
+/*
|
||||
* See if there is a match for the specified block INBUF..BLOCK_LEN in
|
||||
* the checksum set, using precalculated WEAK_SUM.
|
||||
*
|
||||
@@ -173,7 +177,8 @@ rs_search_for_block(rs_weak_sum_t weak_sum,
|
||||
if (!sig->tag_table)
|
||||
rs_fatal("Must have called rs_build_hash_table() by now");
|
||||
|
||||
- rs_strong_sum_t strong_sum;
|
||||
+ {
|
||||
+ rs_strong_sum_t strong_sum;
|
||||
int got_strong = 0;
|
||||
int hash_tag = gettag(weak_sum);
|
||||
rs_tag_table_entry_t *bucket = &(sig->tag_table[hash_tag]);
|
||||
@@ -235,9 +240,12 @@ rs_search_for_block(rs_weak_sum_t weak_sum,
|
||||
got_strong = 1;
|
||||
}
|
||||
v = memcmp(strong_sum, b->strong_sum, sig->strong_sum_len);
|
||||
- int token = b->i;
|
||||
+ {
|
||||
+ int token = b->i;
|
||||
*match_where = (rs_long_t)(token - 1) * sig->block_len;
|
||||
+ }
|
||||
}
|
||||
|
||||
return !v;
|
||||
+ }
|
||||
}
|
||||
--
|
||||
2.7.0
|
||||
|
||||
Reference in New Issue
Block a user