Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Sep 2008 16:03:11 +0400 (MSD)
From:      Eygene Ryabinkin <rea-fbsd@codelabs.ru>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/127695: [patch] security/p5-Net-SSLeay: shut up interactive prompt for BATCH mode
Message-ID:  <20080928120311.421D61719D@amnesiac.at.no.dns>
Resent-Message-ID: <200809281210.m8SCA102068130@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         127695
>Category:       ports
>Synopsis:       [patch] security/p5-Net-SSLeay: shut up interactive prompt for BATCH mode
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 28 12:10:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Eygene Ryabinkin
>Release:        FreeBSD 8.0-CURRENT amd64
>Organization:
Code Labs
>Environment:

System: FreeBSD XXX 8.0-CURRENT FreeBSD 8.0-CURRENT #5: Tue Sep 23 18:11:49 MSD 2008 root@XXX:/usr/obj/usr/src/sys/XXX amd64

>Description:

Currently security/p5-Net-SSLeay interactively prompts user about
external tests during the port configuration phase:
-----
Do you want to run external tests?
These tests *will* *fail* if you do not have network connectivity. [n] ^C
-----

It is very annoying to have this prompt during 'portupgrade -a' or the
like -- it effectively hangs the process before human will type
something on the keyboard, so routine upgrades of the installed ports
are very "attention-hungry".

>How-To-Repeat:

Try to build security/p5-Net-SSLeay.

>Fix:

The following patch shuts up the prompt (and disables external tests)
when BATCH variable is defined:
--- disable-prompts-for-BATCH-mode.patch begins here ---
diff -urN ./Makefile ../p5-Net-SSLeay/Makefile
--- ./Makefile	2008-09-28 15:48:50.000000000 +0400
+++ ../p5-Net-SSLeay/Makefile	2008-09-28 15:53:55.000000000 +0400
@@ -7,6 +7,7 @@
 
 PORTNAME=	Net-SSLeay
 PORTVERSION=	1.35
+PORTREVISION=	1
 CATEGORIES=	security perl5
 MASTER_SITES=	CPAN
 PKGNAMEPREFIX=	p5-
@@ -20,6 +21,10 @@
 
 MAN3=		Net::SSLeay.3 Net::SSLeay::Handle.3
 
+.if defined(BATCH)
+EXTRA_PATCHES+=	${PATCHDIR}/BATCH.patch
+.endif
+
 .if !defined(NOPORTEXAMPLES)
 PORTEXAMPLES=	*
 post-install:
diff -urN ./files/BATCH.patch ../p5-Net-SSLeay/files/BATCH.patch
--- ./files/BATCH.patch	1970-01-01 03:00:00.000000000 +0300
+++ ../p5-Net-SSLeay/files/BATCH.patch	2008-09-28 15:48:31.000000000 +0400
@@ -0,0 +1,22 @@
+Disables prompt for the external connectivity tests.  Meant to be used
+in BATCH mode of port building.
+--- inc/Module/Install/PRIVATE/Net/SSLeay.pm.orig	2008-09-28 15:43:59.000000000 +0400
++++ inc/Module/Install/PRIVATE/Net/SSLeay.pm	2008-09-28 15:46:52.000000000 +0400
+@@ -45,15 +45,8 @@
+ 
+     $self->makemaker_args( CCCDLFLAGS => $opts->{cccdlflags} );
+ 
+-    if ( $self->prompt(
+-            "Do you want to run external tests?\n".
+-            "These tests *will* *fail* if you do not have network connectivity.",
+-            'n',
+-    ) =~ /^y/i ) {
+-        $self->tests('t/*/*.t t/*/*/*.t');
+-    } else {
+-        $self->tests('t/local/*.t t/handle/local/*.t');
+-    }
++    # Skip tests that need network connectivity.
++    $self->tests('t/local/*.t t/handle/local/*.t');
+ }
+ 
+ sub ssleay_get_build_opts {
--- disable-prompts-for-BATCH-mode.patch ends here ---

Perhaps it will be better to conditionalize the external tests via
WITH/WITHOUT variables.  I can draft the needed modifications, if
it is desirable.
>Release-Note:
>Audit-Trail:
>Unformatted:



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