[Midnightbsd-cvs] mports [20629] trunk/shells/bash: bump revision for import patch

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Nov 1 12:46:28 EST 2015


Revision: 20629
          http://svnweb.midnightbsd.org/mports/?rev=20629
Author:   laffer1
Date:     2015-11-01 12:46:27 -0500 (Sun, 01 Nov 2015)
Log Message:
-----------
bump revision for import patch

Modified Paths:
--------------
    trunk/shells/bash/Makefile

Added Paths:
-----------
    trunk/shells/bash/files/extrapatch-import-functions

Modified: trunk/shells/bash/Makefile
===================================================================
--- trunk/shells/bash/Makefile	2015-11-01 17:24:50 UTC (rev 20628)
+++ trunk/shells/bash/Makefile	2015-11-01 17:46:27 UTC (rev 20629)
@@ -3,17 +3,15 @@
 PORTNAME=		bash
 PATCHLEVEL=		42
 PORTVERSION=		4.3.${PATCHLEVEL:S/^0//g}
-PORTREVISION?=		0
+PORTREVISION?=		1
 CATEGORIES=		shells
-MASTER_SITES=		GNU
-MASTER_SITE_SUBDIR=	${PORTNAME}
+MASTER_SITES=		GNU/${PORTNAME}
 DISTNAME=		${PORTNAME}-${PORTVERSION:R}
 DIST_SUBDIR=		${PORTNAME}
 EXTRACT_ONLY=		${DISTNAME}${EXTRACT_SUFX}
 
-PATCH_SITES=		${MASTER_SITE_GNU} \
-			ftp://ftp.cwru.edu/pub/%SUBDIR%/
-PATCH_SITE_SUBDIR=	${PORTNAME}/${DISTNAME}-patches/
+PATCH_SITES=		GNU/${PORTNAME}/${DISTNAME}-patches/ \
+			ftp://ftp.cwru.edu/pub/${PORTNAME}/${DISTNAME}-patches/
 PATCHFILES!=		/usr/bin/jot -s " " -w \
 			${PORTNAME}${PORTVERSION:R:S/.//g}-%03d \
 			${PATCHLEVEL} 1 ${PATCHLEVEL}
@@ -24,10 +22,12 @@
 LICENSE=		gpl3
 
 OPTIONS_DEFINE=		IMPLICITCD COLONBREAKSWORDS HELP NLS STATIC SYSLOG DOCS
+OPTIONS_DEFINE+=	IMPORTFUNCTIONS
 OPTIONS_DEFAULT=	IMPLICITCD COLONBREAKSWORDS HELP NLS
 IMPLICITCD_DESC=	Use directory name alone to cd into it
 COLONBREAKSWORDS_DESC=	Colons break words
 HELP_DESC=		Enable builtin help
+IMPORTFUNCTIONS_DESC=	Import function from env without --import-functions
 
 USES=			bison cpe makeinfo
 OPTIONS_SUB=		yes
@@ -35,6 +35,8 @@
 
 IMPLICITCD_EXTRA_PATCHES=	${PATCHDIR}/extrapatch-implicitcd
 COLONBREAKSWORDS_EXTRA_PATCHES=	${PATCHDIR}/extrapatch-colonbreakswords
+# Always apply this for now. The option will modify the default.
+EXTRA_PATCHES+=			${PATCHDIR}/extrapatch-import-functions
 
 HELP_CONFIGURE_ENABLE=	help-builtin
 NLS_CONFIGURE_ENABLE=	nls
@@ -51,15 +53,29 @@
 			--disable-rpath \
 			--enable-disabled-builtins
 
+CFLAGS+=		-DUSE_MKTEMP=1 -DUSE_MKSTEMP=1
+
+.if empty(PKGNAMESUFFIX)
+CONFLICTS+=		bash-static-[0-9]*
+.else
+CONFLICTS+=		bash-[0-9]*
+.endif
+
 .include <bsd.mport.options.mk>
 
+.if ${PORT_OPTIONS:MIMPORTFUNCTIONS}
+CFLAGS+=	-DIMPORT_FUNCTIONS_DEF=1
+.else
+CFLAGS+=	-DIMPORT_FUNCTIONS_DEF=0
+.endif
+
 .if ${PORT_OPTIONS:MSTATIC} || defined(NO_DYNAMICROOT) || (defined(NOSHARED) && ${NOSHARED:tl} != "no")
 CONFIGURE_ARGS+=	--enable-static-link
-PKGNAMESUFFIX=		-static
-CONFLICTS+=		bash-[0-9]*
 .else
 CONFIGURE_ARGS+=	--disable-static-link
-CONFLICTS+=		bash-static-[0-9]*
+# Bash symbols must be exported in order to link runtime plugins, i.e.,
+# "enable -f". (Plugins are not supported for bash-static.)
+CFLAGS+=		-Wl,-export-dynamic
 .endif
 
 post-patch:

Added: trunk/shells/bash/files/extrapatch-import-functions
===================================================================
--- trunk/shells/bash/files/extrapatch-import-functions	                        (rev 0)
+++ trunk/shells/bash/files/extrapatch-import-functions	2015-11-01 17:46:27 UTC (rev 20629)
@@ -0,0 +1,66 @@
+Based on christos at NetBSD's patch
+
+--- shell.c.christos    2014-01-14 08:04:32.000000000 -0500
++++ shell.c     2014-09-25 16:11:51.000000000 -0400
+@@ -229,6 +229,7 @@
+ #else
+ int posixly_correct = 0;       /* Non-zero means posix.2 superset. */
+ #endif
++int import_functions = IMPORT_FUNCTIONS_DEF;      /* Import functions from environment */
+ 
+ /* Some long-winded argument names.  These are obviously new. */
+ #define Int 1
+@@ -248,6 +249,7 @@
+   { "help", Int, &want_initial_help, (char **)0x0 },
+   { "init-file", Charp, (int *)0x0, &bashrc_file },
+   { "login", Int, &make_login_shell, (char **)0x0 },
++  { "import-functions", Int, &import_functions, (char **)0x0 },
+   { "noediting", Int, &no_line_editing, (char **)0x0 },
+   { "noprofile", Int, &no_profile, (char **)0x0 },
+   { "norc", Int, &no_rc, (char **)0x0 },
+
+--- variables.c.orig	2014-09-28 11:15:53.189768951 -0500
++++ variables.c	2014-09-28 11:27:07.250722694 -0500
+@@ -110,6 +110,7 @@ extern time_t shell_start_time;
+ extern int assigning_in_environment;
+ extern int executing_builtin;
+ extern int funcnest_max;
++extern int import_functions;
+ 
+ #if defined (READLINE)
+ extern int no_line_editing;
+@@ -328,6 +329,7 @@ initialize_shell_variables (env, privmod
+   char *name, *string, *temp_string;
+   int c, char_index, string_index, string_length, ro;
+   SHELL_VAR *temp_var;
++  int skipped_import;
+ 
+   create_variable_tables ();
+ 
+@@ -352,9 +354,12 @@ initialize_shell_variables (env, privmod
+ 
+       temp_var = (SHELL_VAR *)NULL;
+ 
++      skipped_import = 0;
++reval:
++
+       /* If exported function, define it now.  Don't import functions from
+ 	 the environment in privileged mode. */
+-      if (privmode == 0 && read_but_dont_execute == 0 && 
++      if (skipped_import == 0 && privmode == 0 && read_but_dont_execute == 0 && 
+           STREQN (BASHFUNC_PREFIX, name, BASHFUNC_PREFLEN) &&
+           STREQ (BASHFUNC_SUFFIX, name + char_index - BASHFUNC_SUFFLEN) &&
+ 	  STREQN ("() {", string, 4))
+@@ -367,6 +372,12 @@ initialize_shell_variables (env, privmod
+ 	  tname = name + BASHFUNC_PREFLEN;	/* start of func name */
+ 	  tname[namelen] = '\0';		/* now tname == func name */
+ 
++	  if (!import_functions && !interactive_shell) {
++		  skipped_import = 1;
++		  report_error (_("Skipping importing function definition for `%s': --import-functions required."), tname);
++		  goto reval;
++	  }
++
+ 	  string_length = strlen (string);
+ 	  temp_string = (char *)xmalloc (namelen + string_length + 2);
+ 


Property changes on: trunk/shells/bash/files/extrapatch-import-functions
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property


More information about the Midnightbsd-cvs mailing list