ports/73241: porteasy patch for optional pre-2.7.19 behavior

yury at black.cat.kazan.su yury at black.cat.kazan.su
Thu Oct 28 13:00:50 UTC 2004


>Number:         73241
>Category:       ports
>Synopsis:       porteasy patch for optional pre-2.7.19 behavior
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 28 13:00:49 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Jurij Ivliev
>Release:        FreeBSD 4.10-RELEASE-p2 i386
>Organization:
EsterDev, Ltd
>Environment:
System: FreeBSD shelob.esterdev.com 4.10-RELEASE-p2 FreeBSD 4.10-RELEASE-p2 #0: Fri Jul 16 00:41:46 GMT 2004     root at smaug.esterdev.com:/usr/obj/usr/src/sys/SHELOB-P3  i386
>Description:
porteasy 2.7.18 and older use port arguments as regular expressions.
Since 2.7.19 porteasy escepes non-word characters in each port argument 
with '\\'.
This patch adds -R option to make escaping optional.
>How-To-Repeat:
## original:
$ porteasy -V
This is porteasy 2.7.13.
Copyright (c) 2000-2004 Dag-Erling SmЬrgrav. All rights reserved.
$ porteasy -l 'trafshow-[4-9]'
Can't find required port 'trafshow-[4-9]', assuming you mean trafshow-4.0.
 * net/trafshow4 (trafshow-4.0)
$ porteasy -V
This is porteasy 2.7.20.
Copyright (c) 2000-2004 Dag-Erling SmЬrgrav. All rights reserved.
$ porteasy -l 'trafshow-[4-9]'
Can't find required port 'trafshow-[4-9]'
some required ports were not found.

## patched:
$ porteasy -lR 'trafshow-[4-9]'
Can't find required port 'trafshow-[4-9]', assuming you mean trafshow-4.0.
 * net/trafshow4 (trafshow-4.0)
>Fix:
*** porteasy.orig	Thu Oct 28 06:56:51 2004
--- porteasy	Thu Oct 28 08:22:19 2004
***************
*** 72,77 ****
--- 72,78 ----
  my $list      = 0;		# List ports
  my $plist     = 0;		# Print packing list
  my $build     = 0;		# Build ports
+ my $regexp    = 0;		# Port names as regexps
  my $status    = 0;		# List installed ports and their status
  my $update    = 0;		# Update ports tree from CVS
  my $verbose   = 0;		# Verbose mode
***************
*** 423,429 ****
  
      stderr("Can't find required port '$port'");
      my $portre = $port;
!     $portre =~ s/([^\w])/\\$1/g;
      @suggest = grep(/^$portre/i, keys(%ports));
      if (@suggest == 1 && $suggest[0] =~ m/^$portre[0-9.-]/) {
  	$port = $ports{$suggest[0]};
--- 424,430 ----
  
      stderr("Can't find required port '$port'");
      my $portre = $port;
!     $portre =~ s/([^\w])/\\$1/g if !$regexp;
      @suggest = grep(/^$portre/i, keys(%ports));
      if (@suggest == 1 && $suggest[0] =~ m/^$portre[0-9.-]/) {
  	$port = $ports{$suggest[0]};
***************
*** 1072,1078 ****
  #
  sub usage() {
  
!     stderr("Usage: porteasy [-abCceFfhIikLlsuVvw] [-D date] [-d dir]\n" .
  	   "    [-p dir] [-r dir] [-t tag] [port ...]\n");
      exit(1);
  }
--- 1073,1079 ----
  #
  sub usage() {
  
!     stderr("Usage: porteasy [-abCceFfhIikLlRsuVvw] [-D date] [-d dir]\n" .
  	   "    [-p dir] [-r dir] [-t tag] [port ...]\n");
      exit(1);
  }
***************
*** 1110,1115 ****
--- 1111,1117 ----
    -k, --packages           Build packages for the specified ports
    -L, --plist              Show the packing lists for the specified ports
    -l, --list               List required ports and their dependencies
+   -R, --regexp             Assume port names as regular expressions
    -s, --status             List installed ports and their status
    -u, --update             Update relevant portions of the ports tree
    -V, --version            Show version number
***************
*** 1166,1171 ****
--- 1168,1174 ----
  	       "L|plist"		=> \$plist,
  	       "l|list"			=> \$list,
  	       "p|portsdir=s"		=> \$portsdir,
+ 	       "R|regexp"		=> \$regexp,
  	       "r|cvsroot=s"		=> \$cvsroot,
  	       "s|status"		=> \$status,
  	       "t|tag=s"		=> \$tag,
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list