Compare commits
10 Commits
51ae739451
...
583bd857fb
Author | SHA1 | Date |
---|---|---|
Joe Orton | 583bd857fb | |
Mohan Boddu | 07786fbded | |
Florian Weimer | 14151e7001 | |
Joe Orton | 1926db32ff | |
Joe Orton | bdd3f4141d | |
Joe Orton | bdff292e39 | |
Branislav Náter | 7cb417b18d | |
Mohan Boddu | ff789f89c0 | |
DistroBaker | 5b33e254a8 | |
DistroBaker | 07efd1f7c7 |
|
@ -0,0 +1 @@
|
|||
58ebc7b35efaebb211c0b9df594ab16c4d874234 apr-1.7.0.tar.bz2
|
|
@ -15,3 +15,4 @@ apr-1.3.9.tar.bz2
|
|||
/apr-1.6.3.tar.bz2
|
||||
/apr-1.6.5.tar.bz2
|
||||
/apr-1.7.0.tar.bz2
|
||||
/apr-1.7.0
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
|
||||
Conflicting e.g. libldap vs libldap_r problems still exist
|
||||
inside httpd. Use RTLD_DEEPBIND by default.
|
||||
Add $APR_DEEPBIND to enable use of RTLD_DEEPBIND in apr_dso_open().
|
||||
|
||||
--- apr-1.7.0/dso/unix/dso.c.deepbind
|
||||
+++ apr-1.7.0/dso/unix/dso.c
|
||||
|
@ -19,10 +18,43 @@ inside httpd. Use RTLD_DEEPBIND by default.
|
|||
void *os_handle;
|
||||
+
|
||||
+ if (use_deepbind == 0)
|
||||
+ use_deepbind = getenv("APR_DEEPBIND") != NULL ? 1 : -1;
|
||||
+ use_deepbind = secure_getenv("APR_DEEPBIND") != NULL ? 1 : -1;
|
||||
+ if (use_deepbind == 1)
|
||||
+ flags |= RTLD_DEEPBIND;
|
||||
+
|
||||
#ifdef _AIX
|
||||
if (strchr(path + 1, '(') && path[strlen(path) - 1] == ')')
|
||||
{
|
||||
--- apr-1.7.0/README.deepbind.deepbind
|
||||
+++ apr-1.7.0/README.deepbind
|
||||
@@ -0,0 +1,30 @@
|
||||
+This distribution of APR contains a modification of the behaviour of
|
||||
+the apr_dso_open() function which allows users enable the
|
||||
+"RTLD_DEEPBIND" flag when dlopen() is called.
|
||||
+
|
||||
+If the "APR_DEEPBIND" environment variable is set at runtime, the
|
||||
+RTLD_DEEPBIND flag is always added to the flags passed to dlopen().
|
||||
+
|
||||
+With normal use of dlopen(), dynamically loaded objects will use
|
||||
+global symbols in preference to any symbols defined within the object.
|
||||
+Using RTLD_DEEPBIND reverses this binding order. See the dlopen(3)
|
||||
+man page for more information.
|
||||
+
|
||||
+This can be useful with Apache httpd, where two different modules are
|
||||
+loaded like:
|
||||
+
|
||||
+1. mod_foo.so uses library "libfoo.so"
|
||||
+ libfoo.so defines a function "SomeSym"
|
||||
+2. mod_bar.so uses library "libbar.so"
|
||||
+ libbar.so defines a different "SomeSym" function
|
||||
+
|
||||
+By default, mod_bar or mod_foo would use the "SomeSym" definition from
|
||||
+the "wrong" library depending on the load order. If RTLD_DEEPBIND is
|
||||
+used, the "SomeSym" definition will always be mapped to the definition
|
||||
+from the corresponding dependent library. This can avoid symbol
|
||||
+conflicts.
|
||||
+
|
||||
+There are some risks with using RTLD_DEEPBIND, in particular potential
|
||||
+issues with modules written in C++. It is not recommended to enable
|
||||
+$APR_DEEPBIND unless it solves a specific problem and after thorough
|
||||
+testing of the configuration.
|
||||
|
|
|
@ -0,0 +1,239 @@
|
|||
# ./pullrev.sh 1891269 1891198 1891196
|
||||
http://svn.apache.org/viewvc?view=revision&revision=1891269
|
||||
http://svn.apache.org/viewvc?view=revision&revision=1891198
|
||||
http://svn.apache.org/viewvc?view=revision&revision=1891196
|
||||
|
||||
--- apr-1.7.0/include/arch/unix/apr_arch_thread_mutex.h
|
||||
+++ apr-1.7.0/include/arch/unix/apr_arch_thread_mutex.h
|
||||
@@ -33,8 +33,10 @@
|
||||
struct apr_thread_mutex_t {
|
||||
apr_pool_t *pool;
|
||||
pthread_mutex_t mutex;
|
||||
+#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
|
||||
apr_thread_cond_t *cond;
|
||||
int locked, num_waiters;
|
||||
+#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
--- apr-1.7.0/locks/unix/thread_mutex.c
|
||||
+++ apr-1.7.0/locks/unix/thread_mutex.c
|
||||
@@ -102,6 +102,7 @@
|
||||
{
|
||||
apr_status_t rv;
|
||||
|
||||
+#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
|
||||
if (mutex->cond) {
|
||||
apr_status_t rv2;
|
||||
|
||||
@@ -133,6 +134,7 @@
|
||||
|
||||
return rv;
|
||||
}
|
||||
+#endif
|
||||
|
||||
rv = pthread_mutex_lock(&mutex->mutex);
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
@@ -148,6 +150,7 @@
|
||||
{
|
||||
apr_status_t rv;
|
||||
|
||||
+#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
|
||||
if (mutex->cond) {
|
||||
apr_status_t rv2;
|
||||
|
||||
@@ -177,6 +180,7 @@
|
||||
|
||||
return rv;
|
||||
}
|
||||
+#endif
|
||||
|
||||
rv = pthread_mutex_trylock(&mutex->mutex);
|
||||
if (rv) {
|
||||
@@ -281,6 +285,7 @@
|
||||
{
|
||||
apr_status_t status;
|
||||
|
||||
+#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
|
||||
if (mutex->cond) {
|
||||
status = pthread_mutex_lock(&mutex->mutex);
|
||||
if (status) {
|
||||
@@ -303,6 +308,7 @@
|
||||
|
||||
mutex->locked = 0;
|
||||
}
|
||||
+#endif
|
||||
|
||||
status = pthread_mutex_unlock(&mutex->mutex);
|
||||
#ifdef HAVE_ZOS_PTHREADS
|
||||
@@ -318,9 +324,12 @@
|
||||
{
|
||||
apr_status_t rv, rv2 = APR_SUCCESS;
|
||||
|
||||
+#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
|
||||
if (mutex->cond) {
|
||||
rv2 = apr_thread_cond_destroy(mutex->cond);
|
||||
}
|
||||
+#endif
|
||||
+
|
||||
rv = apr_pool_cleanup_run(mutex->pool, mutex, thread_mutex_cleanup);
|
||||
if (rv == APR_SUCCESS) {
|
||||
rv = rv2;
|
||||
--- apr-1.7.0/random/unix/sha2.c
|
||||
+++ apr-1.7.0/random/unix/sha2.c
|
||||
@@ -425,7 +425,7 @@
|
||||
usedspace = freespace = 0;
|
||||
}
|
||||
|
||||
-void apr__SHA256_Final(sha2_byte digest[], SHA256_CTX* context) {
|
||||
+void apr__SHA256_Final(sha2_byte digest[SHA256_DIGEST_LENGTH], SHA256_CTX* context) {
|
||||
sha2_word32 *d = (sha2_word32*)digest;
|
||||
unsigned int usedspace;
|
||||
|
||||
@@ -496,7 +496,7 @@
|
||||
usedspace = 0;
|
||||
}
|
||||
|
||||
-char *apr__SHA256_End(SHA256_CTX* context, char buffer[]) {
|
||||
+char *apr__SHA256_End(SHA256_CTX* context, char buffer[SHA256_DIGEST_STRING_LENGTH]) {
|
||||
sha2_byte digest[SHA256_DIGEST_LENGTH], *d = digest;
|
||||
int i;
|
||||
|
||||
--- apr-1.7.0/time/unix/time.c
|
||||
+++ apr-1.7.0/time/unix/time.c
|
||||
@@ -142,6 +142,9 @@
|
||||
static const int dayoffset[12] =
|
||||
{306, 337, 0, 31, 61, 92, 122, 153, 184, 214, 245, 275};
|
||||
|
||||
+ if (xt->tm_mon < 0 || xt->tm_mon >= 12)
|
||||
+ return APR_EBADDATE;
|
||||
+
|
||||
/* shift new year to 1st March in order to make leap year calc easy */
|
||||
|
||||
if (xt->tm_mon < 2)
|
||||
--- apr-1.7.0/time/win32/time.c
|
||||
+++ apr-1.7.0/time/win32/time.c
|
||||
@@ -54,6 +54,9 @@
|
||||
static const int dayoffset[12] =
|
||||
{0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
|
||||
|
||||
+ if (tm->wMonth < 1 || tm->wMonth > 12)
|
||||
+ return APR_EBADDATE;
|
||||
+
|
||||
/* Note; the caller is responsible for filling in detailed tm_usec,
|
||||
* tm_gmtoff and tm_isdst data when applicable.
|
||||
*/
|
||||
@@ -228,6 +231,9 @@
|
||||
static const int dayoffset[12] =
|
||||
{306, 337, 0, 31, 61, 92, 122, 153, 184, 214, 245, 275};
|
||||
|
||||
+ if (xt->tm_mon < 0 || xt->tm_mon >= 12)
|
||||
+ return APR_EBADDATE;
|
||||
+
|
||||
/* shift new year to 1st March in order to make leap year calc easy */
|
||||
|
||||
if (xt->tm_mon < 2)
|
||||
--- apr-1.7.0/file_io/unix/readwrite.c
|
||||
+++ apr-1.7.0/file_io/unix/readwrite.c
|
||||
@@ -146,7 +146,7 @@
|
||||
|
||||
APR_DECLARE(apr_status_t) apr_file_write(apr_file_t *thefile, const void *buf, apr_size_t *nbytes)
|
||||
{
|
||||
- apr_size_t rv;
|
||||
+ apr_size_t rv = APR_SUCCESS;
|
||||
|
||||
if (thefile->buffered) {
|
||||
char *pos = (char *)buf;
|
||||
@@ -160,13 +160,14 @@
|
||||
* logically reading from
|
||||
*/
|
||||
apr_int64_t offset = thefile->filePtr - thefile->dataRead + thefile->bufpos;
|
||||
- if (offset != thefile->filePtr)
|
||||
- lseek(thefile->filedes, offset, SEEK_SET);
|
||||
+ if (offset != thefile->filePtr) {
|
||||
+ thefile->filePtr = lseek(thefile->filedes, offset, SEEK_SET);
|
||||
+ if (thefile->filePtr == -1) rv = errno;
|
||||
+ }
|
||||
thefile->bufpos = thefile->dataRead = 0;
|
||||
thefile->direction = 1;
|
||||
}
|
||||
|
||||
- rv = 0;
|
||||
while (rv == 0 && size > 0) {
|
||||
if (thefile->bufpos == thefile->bufsize) /* write buffer is full*/
|
||||
rv = apr_file_flush_locked(thefile);
|
||||
@@ -244,12 +245,15 @@
|
||||
*/
|
||||
apr_int64_t offset = thefile->filePtr - thefile->dataRead +
|
||||
thefile->bufpos;
|
||||
- if (offset != thefile->filePtr)
|
||||
- lseek(thefile->filedes, offset, SEEK_SET);
|
||||
+ if (offset != thefile->filePtr) {
|
||||
+ thefile->filePtr = lseek(thefile->filedes, offset, SEEK_SET);
|
||||
+ if (thefile->filePtr == -1) rv = errno;
|
||||
+ }
|
||||
thefile->bufpos = thefile->dataRead = 0;
|
||||
}
|
||||
|
||||
file_unlock(thefile);
|
||||
+ if (rv) return rv;
|
||||
}
|
||||
|
||||
if ((bytes = writev(thefile->filedes, vec, nvec)) < 0) {
|
||||
--- apr-1.7.0/locks/unix/proc_mutex.c
|
||||
+++ apr-1.7.0/locks/unix/proc_mutex.c
|
||||
@@ -1518,11 +1518,10 @@
|
||||
|
||||
APR_DECLARE(const char *) apr_proc_mutex_defname(void)
|
||||
{
|
||||
- apr_status_t rv;
|
||||
apr_proc_mutex_t mutex;
|
||||
|
||||
- if ((rv = proc_mutex_choose_method(&mutex, APR_LOCK_DEFAULT,
|
||||
- NULL)) != APR_SUCCESS) {
|
||||
+ if (proc_mutex_choose_method(&mutex, APR_LOCK_DEFAULT,
|
||||
+ NULL) != APR_SUCCESS) {
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
--- apr-1.7.0/memory/unix/apr_pools.c
|
||||
+++ apr-1.7.0/memory/unix/apr_pools.c
|
||||
@@ -1338,7 +1338,7 @@
|
||||
apr_size_t free_index;
|
||||
|
||||
pool_concurrency_set_used(pool);
|
||||
- ps.node = active = pool->active;
|
||||
+ ps.node = pool->active;
|
||||
ps.pool = pool;
|
||||
ps.vbuff.curpos = ps.node->first_avail;
|
||||
|
||||
--- apr-1.7.0/test/teststr.c
|
||||
+++ apr-1.7.0/test/teststr.c
|
||||
@@ -394,6 +394,19 @@
|
||||
ABTS_STR_EQUAL(tc, apr_cstr_skip_prefix("", "12"), NULL);
|
||||
}
|
||||
|
||||
+static void pstrcat(abts_case *tc, void *data)
|
||||
+{
|
||||
+ ABTS_STR_EQUAL(tc, apr_pstrcat(p, "a", "bc", "def", NULL),
|
||||
+ "abcdef");
|
||||
+ ABTS_STR_EQUAL(tc, apr_pstrcat(p, NULL), "");
|
||||
+ ABTS_STR_EQUAL(tc, apr_pstrcat(p,
|
||||
+ "a", "b", "c", "d", "e",
|
||||
+ "f", "g", "h", "i", "j",
|
||||
+ "1", "2", "3", "4", "5",
|
||||
+ NULL),
|
||||
+ "abcdefghij12345");
|
||||
+}
|
||||
+
|
||||
abts_suite *teststr(abts_suite *suite)
|
||||
{
|
||||
suite = ADD_SUITE(suite)
|
||||
@@ -412,6 +425,7 @@
|
||||
abts_run_test(suite, string_cpystrn, NULL);
|
||||
abts_run_test(suite, snprintf_overflow, NULL);
|
||||
abts_run_test(suite, skip_prefix, NULL);
|
||||
+ abts_run_test(suite, pstrcat, NULL);
|
||||
|
||||
return suite;
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
# ./pullrev.sh 1894167
|
||||
http://svn.apache.org/viewvc?view=revision&revision=1894167
|
||||
|
||||
--- apr-1.7.0/build/apr_network.m4
|
||||
+++ apr-1.7.0/build/apr_network.m4
|
||||
@@ -906,8 +906,16 @@
|
||||
dnl
|
||||
AC_DEFUN([APR_CHECK_SCTP],
|
||||
[
|
||||
- AC_CACHE_CHECK([whether SCTP is supported], [apr_cv_sctp], [
|
||||
- AC_TRY_RUN([
|
||||
+AC_ARG_ENABLE([sctp],
|
||||
+ APR_HELP_STRING([--disable-sctp], [disable SCTP protocol support]),
|
||||
+ [apr_wants_sctp=$enableval],
|
||||
+ [apr_wants_sctp=any])
|
||||
+
|
||||
+if test "$apr_wants_sctp" = no; then
|
||||
+ apr_cv_sctp=no
|
||||
+else
|
||||
+ AC_CACHE_CHECK([whether SCTP is supported], [apr_cv_sctp], [
|
||||
+ AC_TRY_RUN([
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
@@ -932,7 +940,12 @@
|
||||
exit(2);
|
||||
exit(0);
|
||||
}], [apr_cv_sctp=yes], [apr_cv_sctp=no], [apr_cv_sctp=no])])
|
||||
+fi
|
||||
|
||||
+if test "${apr_wants_sctp}X${apr_cv_sctp}" = yesXno; then
|
||||
+ AC_MSG_ERROR([SCTP support requested but not available])
|
||||
+fi
|
||||
+
|
||||
if test "$apr_cv_sctp" = "yes"; then
|
||||
have_sctp=1
|
||||
else
|
60
apr.spec
60
apr.spec
|
@ -6,7 +6,7 @@
|
|||
Summary: Apache Portable Runtime library
|
||||
Name: apr
|
||||
Version: 1.7.0
|
||||
Release: 6%{?dist}
|
||||
Release: 11%{?dist}
|
||||
# ASL 2.0: everything
|
||||
# ISC: network_io/apr-1.4.6/network_io/unix/inet_?to?.c
|
||||
# BSD with advertising: strings/apr_snprintf.c, strings/apr_fnmatch.c,
|
||||
|
@ -20,9 +20,10 @@ Source1: apr-wrapper.h
|
|||
Patch1: apr-1.2.2-libdir.patch
|
||||
Patch2: apr-1.2.7-pkgconf.patch
|
||||
Patch3: apr-1.7.0-deepbind.patch
|
||||
Patch4: apr-1.7.0-r1891269+.patch
|
||||
Patch5: apr-1.7.0-r1894167.patch
|
||||
BuildRequires: gcc, autoconf, libtool, libuuid-devel, python3
|
||||
# To enable SCTP support
|
||||
BuildRequires: lksctp-tools-devel
|
||||
BuildRequires: make
|
||||
|
||||
%description
|
||||
The mission of the Apache Portable Runtime (APR) is to provide a
|
||||
|
@ -46,6 +47,8 @@ C data structures and routines.
|
|||
%patch1 -p1 -b .libdir
|
||||
%patch2 -p1 -b .pkgconf
|
||||
%patch3 -p1 -b .deepbind
|
||||
%patch4 -p1 -b .r1891269+
|
||||
%patch5 -p1 -b .r1894167
|
||||
|
||||
%build
|
||||
# regenerate configure script etc.
|
||||
|
@ -58,15 +61,19 @@ export ac_cv_search_shm_open=no
|
|||
%configure \
|
||||
--includedir=%{_includedir}/apr-%{aprver} \
|
||||
--with-installbuilddir=%{_libdir}/apr-%{aprver}/build \
|
||||
--with-devrandom=/dev/urandom
|
||||
make %{?_smp_mflags}
|
||||
--with-devrandom=/dev/urandom \
|
||||
--disable-static \
|
||||
--disable-sctp
|
||||
%{make_build}
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
make install DESTDIR=$RPM_BUILD_ROOT
|
||||
%{make_install}
|
||||
|
||||
mkdir -p $RPM_BUILD_ROOT/%{_datadir}/aclocal
|
||||
install -m 644 build/find_apr.m4 $RPM_BUILD_ROOT/%{_datadir}/aclocal
|
||||
for f in find_apr.m4 apr_common.m4; do
|
||||
install -p -m 644 build/$f $RPM_BUILD_ROOT/%{_datadir}/aclocal
|
||||
done
|
||||
|
||||
# Trim exported dependecies
|
||||
sed -ri '/^dependency_libs/{s,-l(uuid|crypt) ,,g}' \
|
||||
|
@ -88,6 +95,12 @@ install -c -m644 %{SOURCE1} $RPM_BUILD_ROOT%{_includedir}/apr-%{aprver}/apr.h
|
|||
rm -f $RPM_BUILD_ROOT%{_libdir}/apr.exp \
|
||||
$RPM_BUILD_ROOT%{_libdir}/libapr-*.a
|
||||
|
||||
# Additionally packaged (see https://bugzilla.redhat.com/1669589) --
|
||||
sed -i '1s,/.*,/usr/bin/python3,' build/gen-build.py
|
||||
for f in build/gen-build.py build/install.sh build/config.*; do
|
||||
install -c -m755 $f $RPM_BUILD_ROOT%{_libdir}/apr-%{aprver}/build
|
||||
done
|
||||
|
||||
%check
|
||||
# Fail if LFS support isn't present in a 32-bit build, since this
|
||||
# breaks ABI and the soname doesn't change: see #254241
|
||||
|
@ -105,7 +118,7 @@ popd
|
|||
%ldconfig_scriptlets
|
||||
|
||||
%files
|
||||
%doc CHANGES LICENSE NOTICE
|
||||
%doc CHANGES LICENSE NOTICE README*
|
||||
%{_libdir}/libapr-%{aprver}.so.*
|
||||
|
||||
%files devel
|
||||
|
@ -123,6 +136,37 @@ popd
|
|||
%{_datadir}/aclocal/*.m4
|
||||
|
||||
%changelog
|
||||
* Mon Dec 6 2021 Joe Orton <jorton@redhat.com> - 1.7.0-11
|
||||
- always disable SCTP support at build time (#1997107)
|
||||
|
||||
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 1.7.0-10.5
|
||||
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
|
||||
Related: rhbz#1991688
|
||||
|
||||
* Fri Aug 6 2021 Florian Weimer <fweimer@redhat.com> - 1.7.0-9.5
|
||||
- Rebuild to pick up new build flags from redhat-rpm-config (#1984652)
|
||||
|
||||
* Wed Aug 4 2021 Joe Orton <jorton@redhat.com> - 1.7.0-9.4
|
||||
- add apr_common.m4 to -devel as well (#1986937)
|
||||
|
||||
* Wed Jul 7 2021 Joe Orton <jorton@redhat.com> - 1.7.0-9.3
|
||||
- add various Coverity/Clang cleanups (#1977418)
|
||||
|
||||
* Fri Jun 18 2021 Joe Orton <jorton@redhat.com> - 1.7.0-9.2
|
||||
- package additional build/* files in apr-devel (#1945078)
|
||||
|
||||
* Fri Jun 18 2021 Joe Orton <jorton@redhat.com> - 1.7.0-9.1
|
||||
- document APR_DEEPBIND and use secure_getenv() (thanks to mturk)
|
||||
|
||||
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 1.7.0-9
|
||||
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
|
||||
|
||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.0-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
* Fri Nov 6 2020 Joe Orton <jorton@redhat.com> - 1.7.0-7
|
||||
- disable static build in libtool
|
||||
|
||||
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.0-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-9
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}
|
||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier2.functional}
|
||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier3.functional}
|
||||
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.acceptance-tier.functional}
|
|
@ -0,0 +1,54 @@
|
|||
#!/bin/sh -e
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "What?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
repo="https://svn.apache.org/repos/asf/apr/apr/trunk"
|
||||
#repo="https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x"
|
||||
ver=1.7.0
|
||||
prefix="apr-${ver}"
|
||||
suffix="r$1${2:++}"
|
||||
fn="${prefix}-${suffix}.patch"
|
||||
vcurl="http://svn.apache.org/viewvc?view=revision&revision="
|
||||
|
||||
if test -f ${fn}; then
|
||||
mv -v -f ${fn} ${fn}\~
|
||||
echo "# $0 $*" > ${fn}
|
||||
sed '1{/#.*pullrev/d;};/^--- /,$d' < ${fn}\~ >> ${fn}
|
||||
else
|
||||
echo "# $0 $*" > ${fn}
|
||||
fi
|
||||
|
||||
new=0
|
||||
for r in $*; do
|
||||
if ! grep -q "${vcurl}${r}" ${fn}; then
|
||||
echo "${vcurl}${r}"
|
||||
new=1
|
||||
fi
|
||||
done >> ${fn}
|
||||
|
||||
[ $new -eq 0 ] || echo >> ${fn}
|
||||
|
||||
prev=/dev/null
|
||||
for r in $*; do
|
||||
echo "+ fetching ${r}"
|
||||
this=`mktemp /tmp/pullrevXXXXXX`
|
||||
svn diff -c ${r} ${repo} | filterdiff --remove-timestamps --clean -x 'CHANGES' -x 'next-number' -x 'STATUS' \
|
||||
--addprefix="${prefix}/" > ${this}
|
||||
next=`mktemp /tmp/pullrevXXXXXX`
|
||||
combinediff --quiet ${prev} ${this} > ${next}
|
||||
rm -f "${this}"
|
||||
[ "${prev}" = "/dev/null" ] || rm -f "${prev}"
|
||||
prev=${next}
|
||||
done
|
||||
|
||||
cat ${prev} >> ${fn}
|
||||
|
||||
vi "${fn}"
|
||||
echo "+ git add ${fn}"
|
||||
git add "${fn}"
|
||||
echo "+ spec template:"
|
||||
echo "PatchN: ${fn}"
|
||||
echo "%patchN -p1 -b .${suffix}"
|
Loading…
Reference in New Issue