[curl/f16] curl-config now provides dummy --static-libs option (#733956)

Kamil Dudka kdudka at fedoraproject.org
Mon Sep 19 12:55:52 UTC 2011


commit ef25fd1d9fbd1835a8fc5ae578ba79027979807a
Author: Kamil Dudka <kdudka at redhat.com>
Date:   Mon Sep 19 14:19:53 2011 +0200

    curl-config now provides dummy --static-libs option (#733956)

 0005-curl-7.21.7-61ae7e9.patch  |    4 +-
 0006-curl-7.21.7-3445fa2.patch  |  146 +++++++++++++++++++++++++++++++++++++++
 0101-curl-7.21.1-multilib.patch |   50 ++++++++------
 curl.spec                       |   24 ++++---
 4 files changed, 190 insertions(+), 34 deletions(-)
---
diff --git a/0005-curl-7.21.7-61ae7e9.patch b/0005-curl-7.21.7-61ae7e9.patch
index 87a1365..46cfe47 100644
--- a/0005-curl-7.21.7-61ae7e9.patch
+++ b/0005-curl-7.21.7-61ae7e9.patch
@@ -19,7 +19,7 @@ diff --git a/src/main.c b/src/main.c
 index 276718b..56cd133 100644
 --- a/src/main.c
 +++ b/src/main.c
-@@ -5415,8 +5415,6 @@ operate(struct Configurable *config, int argc, argv_item_t argv[])
+@@ -5371,8 +5371,6 @@ operate(struct Configurable *config, int argc, argv_item_t argv[])
          my_setopt(curl, CURLOPT_QUOTE, config->quote);
          my_setopt(curl, CURLOPT_POSTQUOTE, config->postquote);
          my_setopt(curl, CURLOPT_PREQUOTE, config->prequote);
@@ -28,7 +28,7 @@ index 276718b..56cd133 100644
          my_setopt_str(curl, CURLOPT_COOKIEFILE, config->cookiefile);
          /* cookie jar was added in 7.9 */
          if(config->cookiejar)
-@@ -5621,6 +5619,12 @@ operate(struct Configurable *config, int argc, argv_item_t argv[])
+@@ -5577,6 +5575,12 @@ operate(struct Configurable *config, int argc, argv_item_t argv[])
            my_setopt(curl, CURLOPT_HEADERFUNCTION, header_callback);
            my_setopt(curl, CURLOPT_HEADERDATA, &outs);
          }
diff --git a/0006-curl-7.21.7-3445fa2.patch b/0006-curl-7.21.7-3445fa2.patch
new file mode 100644
index 0000000..fe9cf74
--- /dev/null
+++ b/0006-curl-7.21.7-3445fa2.patch
@@ -0,0 +1,146 @@
+From 3445fa2e3f28b359a3acd2a884f4e119b11e0a57 Mon Sep 17 00:00:00 2001
+From: Kamil Dudka <kdudka at redhat.com>
+Date: Fri, 26 Aug 2011 11:10:58 +0200
+Subject: [PATCH] tests: break busy loops in tests 502, 555, and 573
+
+---
+ tests/libtest/lib502.c |   23 +++++++++++++++++++++--
+ tests/libtest/lib555.c |   23 +++++++++++++++++++++--
+ tests/libtest/lib573.c |   23 +++++++++++++++++++++--
+ 3 files changed, 63 insertions(+), 6 deletions(-)
+
+diff --git a/tests/libtest/lib502.c b/tests/libtest/lib502.c
+index 9ade12a..9040b2b 100644
+--- a/tests/libtest/lib502.c
++++ b/tests/libtest/lib502.c
+@@ -73,6 +73,10 @@ int test(char *URL)
+   mp_start = tutil_tvnow();
+ 
+   while (running) {
++    static struct timeval timeout = /* 100 ms */ { 0, 100000L };
++    fd_set fdread, fdwrite, fdexcep;
++    int maxfd = -1;
++
+     res = (int)curl_multi_perform(m, &running);
+     if (tutil_tvdiff(tutil_tvnow(), mp_start) >
+         MULTI_PERFORM_HANG_TIMEOUT) {
+@@ -83,11 +87,26 @@ int test(char *URL)
+       fprintf(stderr, "nothing left running.\n");
+       break;
+     }
++
++    FD_ZERO(&fdread);
++    FD_ZERO(&fdwrite);
++    FD_ZERO(&fdexcep);
++    curl_multi_fdset(m, &fdread, &fdwrite, &fdexcep, &maxfd);
++
++    /* In a real-world program you OF COURSE check the return code of the
++       function calls.  On success, the value of maxfd is guaranteed to be
++       greater or equal than -1.  We call select(maxfd + 1, ...), specially in
++       case of (maxfd == -1), we call select(0, ...), which is basically equal
++       to sleep. */
++
++    if (select(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout) == -1) {
++      res = ~CURLM_OK;
++      break;
++    }
+   }
+ 
+   if (mp_timedout) {
+-    if (mp_timedout) fprintf(stderr, "mp_timedout\n");
+-    fprintf(stderr, "ABORTING TEST, since it seems "
++    fprintf(stderr, "mp_timedout\nABORTING TEST, since it seems "
+             "that it would have run forever.\n");
+     res = TEST_ERR_RUNS_FOREVER;
+   }
+diff --git a/tests/libtest/lib555.c b/tests/libtest/lib555.c
+index c675015..1e73a5a 100644
+--- a/tests/libtest/lib555.c
++++ b/tests/libtest/lib555.c
+@@ -135,6 +135,10 @@ int test(char *URL)
+   mp_start = tutil_tvnow();
+ 
+   while (running) {
++    static struct timeval timeout = /* 100 ms */ { 0, 100000L };
++    fd_set fdread, fdwrite, fdexcep;
++    int maxfd = -1;
++
+     res = (int)curl_multi_perform(m, &running);
+     if (tutil_tvdiff(tutil_tvnow(), mp_start) >
+         MULTI_PERFORM_HANG_TIMEOUT) {
+@@ -148,11 +152,26 @@ int test(char *URL)
+       fprintf(stderr, "nothing left running.\n");
+       break;
+     }
++
++    FD_ZERO(&fdread);
++    FD_ZERO(&fdwrite);
++    FD_ZERO(&fdexcep);
++    curl_multi_fdset(m, &fdread, &fdwrite, &fdexcep, &maxfd);
++
++    /* In a real-world program you OF COURSE check the return code of the
++       function calls.  On success, the value of maxfd is guaranteed to be
++       greater or equal than -1.  We call select(maxfd + 1, ...), specially in
++       case of (maxfd == -1), we call select(0, ...), which is basically equal
++       to sleep. */
++
++    if (select(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout) == -1) {
++      res = ~CURLM_OK;
++      break;
++    }
+   }
+ 
+   if (mp_timedout) {
+-    if (mp_timedout) fprintf(stderr, "mp_timedout\n");
+-    fprintf(stderr, "ABORTING TEST, since it seems "
++    fprintf(stderr, "mp_timedout\nABORTING TEST, since it seems "
+             "that it would have run forever.\n");
+     res = TEST_ERR_RUNS_FOREVER;
+   }
+diff --git a/tests/libtest/lib573.c b/tests/libtest/lib573.c
+index 4661858..b5fafe1 100644
+--- a/tests/libtest/lib573.c
++++ b/tests/libtest/lib573.c
+@@ -76,6 +76,10 @@ int test(char *URL)
+   mp_start = tutil_tvnow();
+ 
+   while (running) {
++    static struct timeval timeout = /* 100 ms */ { 0, 100000L };
++    fd_set fdread, fdwrite, fdexcep;
++    int maxfd = -1;
++
+     res = (int)curl_multi_perform(m, &running);
+     if (tutil_tvdiff(tutil_tvnow(), mp_start) >
+         MULTI_PERFORM_HANG_TIMEOUT) {
+@@ -86,11 +90,26 @@ int test(char *URL)
+       fprintf(stderr, "nothing left running.\n");
+       break;
+     }
++
++    FD_ZERO(&fdread);
++    FD_ZERO(&fdwrite);
++    FD_ZERO(&fdexcep);
++    curl_multi_fdset(m, &fdread, &fdwrite, &fdexcep, &maxfd);
++
++    /* In a real-world program you OF COURSE check the return code of the
++       function calls.  On success, the value of maxfd is guaranteed to be
++       greater or equal than -1.  We call select(maxfd + 1, ...), specially in
++       case of (maxfd == -1), we call select(0, ...), which is basically equal
++       to sleep. */
++
++    if (select(maxfd + 1, &fdread, &fdwrite, &fdexcep, &timeout) == -1) {
++      res = ~CURLM_OK;
++      break;
++    }
+   }
+ 
+   if (mp_timedout) {
+-    if (mp_timedout) fprintf(stderr, "mp_timedout\n");
+-    fprintf(stderr, "ABORTING TEST, since it seems "
++    fprintf(stderr, "mp_timedout\nABORTING TEST, since it seems "
+             "that it would have run forever.\n");
+     res = TEST_ERR_RUNS_FOREVER;
+   }
+-- 
+1.7.4.4
+
diff --git a/0101-curl-7.21.1-multilib.patch b/0101-curl-7.21.1-multilib.patch
index 83c1cd8..cbb5bab 100644
--- a/0101-curl-7.21.1-multilib.patch
+++ b/0101-curl-7.21.1-multilib.patch
@@ -1,20 +1,13 @@
- curl-config.in |   22 ++++------------------
- libcurl.pc.in  |    1 +
- 2 files changed, 5 insertions(+), 18 deletions(-)
+ curl-config.in     |   16 +++-------------
+ docs/curl-config.1 |    4 +++-
+ libcurl.pc.in      |    1 +
+ 3 files changed, 7 insertions(+), 14 deletions(-)
 
 diff --git a/curl-config.in b/curl-config.in
-index ebda129..b404827 100644
+index 150004d..95d0759 100644
 --- a/curl-config.in
 +++ b/curl-config.in
-@@ -43,7 +43,6 @@ Available values for OPTION include:
-   --libs      library linking information
-   --prefix    curl install prefix
-   --protocols newline separated list of enabled protocols
--  --static-libs static libcurl library linking information
-   --version   output version information
-   --vernum    output the version information as a number (hexadecimal)
- EOF
-@@ -74,7 +73,7 @@ while test $# -gt 0; do
+@@ -74,7 +74,7 @@ while test $# -gt 0; do
  	;;
  
      --cc)
@@ -23,7 +16,7 @@ index ebda129..b404827 100644
  	;;
  
      --prefix)
-@@ -136,25 +135,12 @@ while test $# -gt 0; do
+@@ -136,24 +136,14 @@ while test $# -gt 0; do
         	;;
  
      --libs)
@@ -37,21 +30,36 @@ index ebda129..b404827 100644
 -	else
 -	  echo ${CURLLIBDIR}-lcurl @LDFLAGS@ @LIBS@
 -	fi
--	;;
--
--    --static-libs)
--	echo @libdir@/libcurl. at libext@ @LDFLAGS@ @LIBCURL_LIBS@ @LIBS@
 +	pkg-config libcurl --libs
  	;;
  
+     --static-libs)
+-	echo @libdir@/libcurl. at libext@ @LDFLAGS@ @LIBCURL_LIBS@ @LIBS@
+ 	;;
+ 
      --configure)
 -      echo @CONFIGURE_OPTIONS@
--    ;;
 +	pkg-config libcurl --variable=configure_options | sed 's/^"//;s/"$//'
-+	;;
+     ;;
  
      *)
-         echo "unknown option: $1"
+diff --git a/docs/curl-config.1 b/docs/curl-config.1
+index c4f4e2b..3e0ea60 100644
+--- a/docs/curl-config.1
++++ b/docs/curl-config.1
+@@ -65,7 +65,9 @@ be listed using uppercase and are separated by newlines. There may be none,
+ one, or several protocols in the list. (Added in 7.13.0)
+ .IP "--static-libs"
+ Shows the complete set of libs and other linker options you will need in order
+-to link your application with libcurl statically. (Added in 7.17.1)
++to link your application with libcurl statically. Note that Fedora/RHEL libcurl
++packages do not provide any static libraries, thus cannot be linked statically.
++(Added in 7.17.1)
+ .IP "--version"
+ Outputs version information about the installed libcurl.
+ .IP "--vernum"
+diff --git a/libcurl.pc.in b/libcurl.pc.in
+index 2ba9c39..f8f8b00 100644
 --- a/libcurl.pc.in
 +++ b/libcurl.pc.in
 @@ -29,6 +29,7 @@ libdir=@libdir@
diff --git a/curl.spec b/curl.spec
index fd172a6..faee635 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,7 +1,7 @@
 Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
 Name: curl
 Version: 7.21.7
-Release: 4%{?dist}
+Release: 5%{?dist}
 License: MIT
 Group: Applications/Internet
 Source: http://curl.haxx.se/download/%{name}-%{version}.tar.lzma
@@ -21,6 +21,9 @@ Patch3: 0003-curl-7.21.7-5538904.patch
 # initialize NSS with no database if the selected database is broken (#728562)
 Patch4: 0004-curl-7.21.7-d6f319f.patch
 
+# break busy loops in tests 502, 555, and 573
+Patch6: 0006-curl-7.21.7-3445fa2.patch
+
 # patch making libcurl multilib ready
 Patch101: 0101-curl-7.21.1-multilib.patch
 
@@ -54,16 +57,10 @@ BuildRequires: pkgconfig
 BuildRequires: stunnel
 BuildRequires: zlib-devel
 
-# FIXME: valgrind temporarily disabled.  If not, we get random test suite
-# failures on our build-hosts (tests 532 535 555 573 1047 1048).  It is hard to
-# debug unless I am able to reproduce them in mock locally.  It seems to be
-# independent of the mock profile.  Maybe the kernel is different, or the hosts
-# are under load, or just too slow to go through valgrind.
-
-# # valgrind is not available on s390(x), sparc or arm5
-# %ifnarch s390 s390x %{sparc} %{arm}
-# BuildRequires: valgrind
-# %endif
+# valgrind is not available on s390(x), sparc or arm5
+%ifnarch s390 s390x %{sparc} %{arm}
+BuildRequires: valgrind
+%endif
  
 Requires: libcurl = %{version}-%{release}
 
@@ -131,6 +128,7 @@ done
 %patch3 -p1
 %patch4 -p1
 %patch5 -p1
+%patch6 -p1
 
 # Fedora patches
 %patch101 -p1
@@ -244,6 +242,10 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/aclocal/libcurl.m4
 
 %changelog
+* Mon Sep 19 2011 Kamil Dudka <kdudka at redhat.com> 7.21.7-5
+- curl-config now provides dummy --static-libs option (#733956)
+- break busy loops in tests 502, 555, and 573
+
 * Sun Aug 21 2011 Paul Howarth <paul at city-fan.org> 7.21.7-4
 - actually fix SIGSEGV of curl -O -J given more than one URL (#723075)
 


More information about the scm-commits mailing list