Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Apr 2020 10:45:10 +0000 (UTC)
From:      Muhammad Moinur Rahman <bofh@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r531105 - in head/net: . irrd-legacy irrd-legacy/files
Message-ID:  <202004081045.038AjAMH016182@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bofh
Date: Wed Apr  8 10:45:10 2020
New Revision: 531105
URL: https://svnweb.freebsd.org/changeset/ports/531105

Log:
  [NEW] net/irrd-legacy: Legacy V 2.X of net/irrd
  
  - Pet portlint
  - Make patches makepatch compatible
  - Take MAINTAINERSHIP
  
  Approved by:	ume (private mail)

Added:
  head/net/irrd-legacy/
     - copied from r530944, head/net/irrd/
  head/net/irrd-legacy/files/patch-lib_config_config__file.c   (contents, props changed)
  head/net/irrd-legacy/files/patch-programs_IRRd_database.c   (contents, props changed)
  head/net/irrd-legacy/files/patch-programs_IRRd_uii__commands.c   (contents, props changed)
Deleted:
  head/net/irrd-legacy/files/patch-config_file.c
  head/net/irrd-legacy/files/patch-database.c
  head/net/irrd-legacy/files/patch-uii_commands.c
Modified:
  head/net/Makefile
  head/net/irrd-legacy/Makefile
  head/net/irrd-legacy/files/patch-lib_mrt_prefix.c

Modified: head/net/Makefile
==============================================================================
--- head/net/Makefile	Wed Apr  8 10:17:12 2020	(r531104)
+++ head/net/Makefile	Wed Apr  8 10:45:10 2020	(r531105)
@@ -282,6 +282,7 @@
     SUBDIR += ipsvd
     SUBDIR += ipxe
     SUBDIR += irrd
+    SUBDIR += irrd-legacy
     SUBDIR += isboot-kmod
     SUBDIR += isc-dhcp44-client
     SUBDIR += isc-dhcp44-relay

Modified: head/net/irrd-legacy/Makefile
==============================================================================
--- head/net/irrd/Makefile	Tue Apr  7 02:34:29 2020	(r530944)
+++ head/net/irrd-legacy/Makefile	Wed Apr  8 10:45:10 2020	(r531105)
@@ -4,26 +4,27 @@
 PORTNAME=	irrd
 PORTVERSION=	2.3.10
 DISTVERSIONPREFIX=	v
-PORTREVISION=	3
 CATEGORIES=	net
+PKGNAMESUFFIX=	-legacy
 
-MAINTAINER=	ume@FreeBSD.org
+MAINTAINER=	bofh@FreeBSD.org
 COMMENT=	Internet Routing Registry database server
 
 LICENSE=	BSD4CLAUSE
-LICENSE_FILE=	${WRKDIR}/${PORTNAME}-legacy-${PORTVERSION}/COPYRIGHT
+LICENSE_FILE=	${WRKDIR}/${PORTNAME}${PKGNAMESUFFIX}-${PORTVERSION}/COPYRIGHT
 
 RUN_DEPENDS=	wget:ftp/wget
 
-WRKSRC_SUBDIR=	src
-
-IRRD_CONFDIR=	${PREFIX}/etc
-
 USES=		shebangfix
-USE_RC_SUBR=	irrd
 USE_GITHUB=	yes
+USE_RC_SUBR=	irrd
+
 GH_ACCOUNT=	irrdnet
-GH_PROJECT=	irrd-legacy
+GH_PROJECT=	${PORTNAME}${PKGNAMESUFFIX}
+
+WRKSRC_SUBDIR=	src
+
+IRRD_CONFDIR=	${PREFIX}/etc
 
 GNU_CONFIGURE=	yes
 CONFIGURE_ENV=	YACC="${YACC}"

Added: head/net/irrd-legacy/files/patch-lib_config_config__file.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/irrd-legacy/files/patch-lib_config_config__file.c	Wed Apr  8 10:45:10 2020	(r531105)
@@ -0,0 +1,11 @@
+--- lib/config/config_file.c.orig	2015-04-03 11:26:26 UTC
++++ lib/config/config_file.c
+@@ -772,7 +772,7 @@ config_line_address (uii_connection_t * uii, prefix_t 
+ 	Deref_Prefix (prefix);
+         return (1);
+     }
+-    if (prefix_compare2 (UII->prefix, prefix) != 0) {
++    if ( UII->prefix == NULL || prefix_compare2 (UII->prefix, prefix) != 0) {
+     	set_uii (UII, UII_ADDR, prefix, 0);
+ 	listen_uii2 (NULL);
+     }

Modified: head/net/irrd-legacy/files/patch-lib_mrt_prefix.c
==============================================================================
--- head/net/irrd/files/patch-lib_mrt_prefix.c	Tue Apr  7 02:34:29 2020	(r530944)
+++ head/net/irrd-legacy/files/patch-lib_mrt_prefix.c	Wed Apr  8 10:45:10 2020	(r531105)
@@ -1,17 +1,16 @@
 Index: lib/mrt/prefix.c
-diff -u -p lib/mrt/prefix.c.orig lib/mrt/prefix.c
---- lib/mrt/prefix.c.orig	Fri Aug 31 03:10:31 2001
-+++ lib/mrt/prefix.c	Mon May  1 12:05:11 2006
-@@ -15,7 +15,7 @@
- #include <ws2tcpip.h>
- #endif /* NT */
+--- lib/mrt/prefix.c.orig	2015-04-03 11:26:26 UTC
++++ lib/mrt/prefix.c
+@@ -5,7 +5,7 @@
+ #include <mrt.h>
+ #include <netdb.h>
  
 -#ifndef __GLIBC__
 +#if !defined(__GLIBC__) && !defined(__FreeBSD__)
  #ifdef __osf__
  
  /* apparently, OSF's gethostby{name,addr}_r's are different, broken, and
-@@ -50,7 +50,7 @@ struct hostent  *gethostbyaddr_r
+@@ -29,7 +29,7 @@ struct hostent  *gethostbyaddr_r
        For the time being, this part tries to convert Linux glibc 2.X
        gethostXX_r into Solaris's that we use to code MRT. -- masaki
      */

Added: head/net/irrd-legacy/files/patch-programs_IRRd_database.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/irrd-legacy/files/patch-programs_IRRd_database.c	Wed Apr  8 10:45:10 2020	(r531105)
@@ -0,0 +1,16 @@
+--- programs/IRRd/database.c.orig	2015-04-03 11:26:26 UTC
++++ programs/IRRd/database.c
+@@ -59,9 +59,11 @@ void database_clear (irr_database_t *db) {
+ 
+   db->radix_v4 = New_Radix (32);
+   db->radix_v6 = New_Radix (128);
+-  fclose (db->db_fp);
+ 
+-  db->db_fp = NULL;
++  if (db->db_fp) {
++    fclose (db->db_fp);
++    db->db_fp = NULL;
++  }
+ }
+ 
+ 

Added: head/net/irrd-legacy/files/patch-programs_IRRd_uii__commands.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/irrd-legacy/files/patch-programs_IRRd_uii__commands.c	Wed Apr  8 10:45:10 2020	(r531105)
@@ -0,0 +1,55 @@
+--- programs/IRRd/uii_commands.c.orig	2015-04-03 11:26:26 UTC
++++ programs/IRRd/uii_commands.c
+@@ -14,6 +14,8 @@
+ #include <ctype.h>
+ #include "irrd.h"
+ 
++#include <errno.h>
++
+ #include <fcntl.h>
+ #ifndef SETPGRP_VOID
+ #endif
+@@ -700,6 +702,10 @@ int uii_read_update_file (uii_connection_t *uii, char 
+ 
+ void run_cmd (char *cmd, FILE **in, FILE **out) {
+   int pin[2], pout[2];
++  int pid;
++  int omask, pstat;
++  pid_t ppid;
++  extern int errno;
+ 
+   if (in != NULL)
+     *in = NULL;
+@@ -713,7 +719,9 @@ void run_cmd (char *cmd, FILE **in, FILE **out) {
+   if (out != NULL)
+     pipe (pout);
+   
+-  if (fork() == 0) { /* We're the child */
++/*  if (fork() == 0) { */
++  pid = fork();
++  if (pid == 0) { /* We're the child */
+     if (in != NULL) {
+       close (pin[1]);
+       dup2  (pin[0], 0);
+@@ -727,7 +735,7 @@ void run_cmd (char *cmd, FILE **in, FILE **out) {
+       close (pout[1]);
+     }
+     
+-    execl("/bin/sh", "sh", "-c", cmd, NULL);
++    execlp("/bin/sh", "sh", "-c", cmd, NULL);
+     _exit(127);
+   }
+ 
+@@ -741,6 +749,12 @@ void run_cmd (char *cmd, FILE **in, FILE **out) {
+     close (pin[0]);
+     *in = fdopen (pin[1], "w");
+   }
++
++  omask = sigblock(sigmask(SIGINT)|sigmask(SIGQUIT)|sigmask(SIGHUP));
++  do {
++    ppid = waitpid(pid, (int *) &pstat, 0);
++  } while (pid == -1 && errno == EINTR);
++  (void)sigsetmask(omask);
+ }
+ 
+ int kill_irrd (uii_connection_t *uii) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202004081045.038AjAMH016182>