uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
60
pkgs/tools/networking/jwhois/connect.patch
Normal file
60
pkgs/tools/networking/jwhois/connect.patch
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
https://bugzilla.redhat.com/attachment.cgi?id=265091
|
||||
|
||||
This fixes somewhat reversed logic of trying to connect to WHOIS server.
|
||||
Tue Nov 20 2007, Lubomir Kundrak <lkundrak@redhat.com>
|
||||
|
||||
--- jwhois-4.0/src/utils.c.connect 2007-06-26 09:00:20.000000000 +0200
|
||||
+++ jwhois-4.0/src/utils.c 2007-11-20 17:05:33.000000000 +0100
|
||||
@@ -247,7 +247,7 @@ make_connect(const char *host, int port)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
- while (res)
|
||||
+ for (; res; res = res->ai_next)
|
||||
{
|
||||
sa = res->ai_addr;
|
||||
sockfd = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
|
||||
@@ -266,15 +266,15 @@ make_connect(const char *host, int port)
|
||||
flags = fcntl(sockfd, F_GETFL, 0);
|
||||
if (fcntl(sockfd, F_SETFL, flags|O_NONBLOCK) == -1)
|
||||
{
|
||||
+ close (sockfd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
-
|
||||
error = connect(sockfd, res->ai_addr, res->ai_addrlen);
|
||||
-
|
||||
if (error < 0 && errno != EINPROGRESS)
|
||||
{
|
||||
- break;
|
||||
+ close (sockfd);
|
||||
+ continue;
|
||||
}
|
||||
|
||||
FD_ZERO(&fdset);
|
||||
@@ -283,18 +283,20 @@ make_connect(const char *host, int port)
|
||||
error = select(FD_SETSIZE, NULL, &fdset, NULL, &timeout);
|
||||
if (error == 0)
|
||||
{
|
||||
- break;
|
||||
+ close (sockfd);
|
||||
+ return -1;
|
||||
}
|
||||
|
||||
retlen = sizeof(retval);
|
||||
error = getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &retval, &retlen);
|
||||
if (error < 0 || retval)
|
||||
{
|
||||
- break;
|
||||
+ close (sockfd);
|
||||
+ return -1;
|
||||
}
|
||||
- res = res->ai_next;
|
||||
+
|
||||
+ break;
|
||||
}
|
||||
- if (error < 0 || retval) return -1;
|
||||
#endif
|
||||
|
||||
return sockfd;
|
||||
32
pkgs/tools/networking/jwhois/default.nix
Normal file
32
pkgs/tools/networking/jwhois/default.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{lib, stdenv, lynx, fetchurl}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "jwhois";
|
||||
version = "4.0";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://gnu/jwhois/jwhois-${version}.tar.gz";
|
||||
sha256 = "0knn7iaj5v0n6jpmldyv2yk4bcy9dn3kywmv63bwc5drh9kvi6zs";
|
||||
};
|
||||
|
||||
postInstall = ''
|
||||
ln -s jwhois $out/bin/whois
|
||||
sed -i -e "s|/usr/bin/lynx|${lynx}/bin/lynx|g" $out/etc/jwhois.conf
|
||||
'';
|
||||
|
||||
patches = [ ./connect.patch ./service-name.patch ];
|
||||
|
||||
makeFlags = [ "AR=${stdenv.cc.bintools.targetPrefix}ar" ];
|
||||
|
||||
# Work around error from <stdio.h> on aarch64-darwin:
|
||||
# error: 'TARGET_OS_IPHONE' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_]
|
||||
# TODO: this should probably be fixed at a lower level than this?
|
||||
NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin "-Wno-undef-prefix";
|
||||
|
||||
meta = {
|
||||
description = "A client for the WHOIS protocol allowing you to query the owner of a domain name";
|
||||
homepage = "https://www.gnu.org/software/jwhois/";
|
||||
license = lib.licenses.gpl3;
|
||||
platforms = lib.platforms.unix;
|
||||
};
|
||||
}
|
||||
17
pkgs/tools/networking/jwhois/service-name.patch
Normal file
17
pkgs/tools/networking/jwhois/service-name.patch
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
--- a/src/dns.c 2007-06-25 23:58:38.000000000 -0700
|
||||
+++ b/src/dns.c 2016-06-04 16:20:19.644865127 -0700
|
||||
@@ -113,12 +113,13 @@
|
||||
lookup_host_addrinfo(struct addrinfo **res, const char *host, int port)
|
||||
{
|
||||
struct addrinfo hints;
|
||||
- char ascport[10] = "whois";
|
||||
+ char ascport[10] = "nicname";
|
||||
int error;
|
||||
|
||||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_family = PF_UNSPEC;
|
||||
|
||||
+ hints.ai_flags = AI_ADDRCONFIG;
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
if (port)
|
||||
sprintf(ascport, "%9.9d", port);
|
||||
Loading…
Add table
Add a link
Reference in a new issue