tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Assignment to $[ will be fatal in Perl 5.30



From: "Tom Spindler (moof)" <dogcow%babymeat.com@localhost>
Subject: Re: Assignment to $[ will be fatal in Perl 5.30
Date: Sun, 18 Aug 2019 18:46:48 -0700

>> > gmake[2]: Leaving directory '/usr/pkgsrc/sysutils/libgtop/work.x86_64/libgtop-2.
>> > 28.4/lib'
>> It was deprecated since perl 5.12.0...
> libgtop-2.28.4 is also about eight years old, and this specific problem was
> fixed around two years ago:
> https://github.com/GNOME/libgtop/commit/f5939dc69eac2929df8ff37c7babf03759cb94d5#diff-0e1b887ae7100208609b3d398fd43e35

thanx for notify.
mate-system-monitor/Makefile:.include "../../sysutils/libgtop/buildlink3.mk"
makes brake meta-pkgs/mate.
$NetBSD$

http://mail-index.netbsd.org/tech-pkg/2019/08/19/msg021818.html

--- lib/lib.pl.org	2011-06-01 15:40:47.000000000 +0000
+++ lib/lib.pl
@@ -1,21 +1,8 @@
 #!/usr/bin/perl
 
-$[ = 1;			# set array base to 1
 $, = ' ';		# set output field separator
 $\ = "\n";		# set output record separator
 
-sub toupper {
-    local($_) = @_;
-    tr/a-z/A-Z/;
-    return $_;
-}
-
-sub tolower {
-    local($_) = @_;
-    tr/A-Z/a-z/;
-    return $_;
-}
-
 print '/* lib.c */';
 print "/* This is a generated file.  Please modify `lib.pl' */";
 print '';
@@ -86,9 +73,9 @@ while (<>) {
 sub output {
     local($line) = @_;
     @line_fields = split(/\|/, $line, 9999);
-    $retval = $line_fields[1];
-    $feature = $line_fields[2];
-    $param_def = $line_fields[4];
+    $retval = $line_fields[0];
+    $feature = $line_fields[1];
+    $param_def = $line_fields[2];
 
     $orig = $feature;
     $feature =~ s/^@//;
@@ -106,16 +93,16 @@ sub output {
     }
 
     if ($param_def eq 'string') {
-	$call_param = ', ' . $line_fields[5];
+	$call_param = ', ' . $line_fields[3];
 	$param_buf = '';
 	$buf_set = '';
 	$param_decl = ",\n            " . $space . '    const char *' .
 
-	  $line_fields[5];
-	$send_ptr = "\n\tconst void *send_ptr = " . $line_fields[5] . ';';
+	  $line_fields[3];
+	$send_ptr = "\n\tconst void *send_ptr = " . $line_fields[3] . ';';
 	$send_size = "\n\tconst size_t send_size =\n\t\tstrlen (" .
 
-	  $line_fields[5] . ') + 1;';
+	  $line_fields[3] . ') + 1;';
     }
     else {
 	$call_param = '';
@@ -126,9 +113,9 @@ sub output {
 	$buf_set = '';
 	$nr_params = (@params = split(/:/, $param_def, 9999));
 	if ($nr_params) {
-	    $param_buf = "\n\tstruct {\n";
+	    $param_buf = "\t\tstruct {\n";
 	}
-	for ($param = 1; $param <= $nr_params; $param++) {
+	for ($param = 0; $param < $nr_params; $param++) {
 	    $list = $params[$param];
 	    $type = $params[$param];
 	    $type =~ s/\(.*//;
@@ -137,13 +124,13 @@ sub output {
 	    $count = (@fields = split(/,/, $list, 9999));
 
 	    if ($count > 0) {
-		for ($field = 1; $field <= $count; $field++) {
-		    $param_buf .= "\t\t$convert{$type} buf_$fields[$field];\n";
-		    $buf_set .= "\tparam_buf.buf_$fields[$field] = $fields[$field];\n";
+		for ($field = 0; $field < $count; $field++) {
+		    $param_buf .= "\t\t\t$convert{$type} buf_$fields[$field];\n";
+		    $buf_set .= "\t\tparam_buf.buf_$fields[$field] = $fields[$field];\n";
 		}
 	    }
 
-	    for ($field = 1; $field <= $count; $field++) {
+	    for ($field = 0; $field < $count; $field++) {
 		if ($param_decl eq '') {
 		    $param_decl = ",\n            " . $space . '    ';
 		}
@@ -155,19 +142,19 @@ sub output {
 		  $fields[$field];
 		$call_param = $call_param . ', ' . $fields[$field];
 		if ($send_ptr eq '') {
-		    $send_ptr = "\n\tconst void *send_ptr = &param_buf;";
+		    $send_ptr = "\t\tconst void *send_ptr = &param_buf;";
 		}
 	    }
 	}
 	if ($nr_params) {
-	    $param_buf .= "\t} param_buf;";
-	    $send_size  = "\n\tconst size_t send_size = sizeof param_buf;";
+	    $param_buf .= "\t\t} param_buf;\n";
+	    $send_size  = "\t\tconst size_t send_size = sizeof param_buf;";
 	}
 	else {
-	    $send_size = "\n\tconst size_t send_size = 0;";
+	    $send_size = "\t\tconst size_t send_size = 0;";
 	}
 	if ($send_ptr eq '') {
-	    $send_ptr = "\n\tconst void *send_ptr = NULL;";
+	    $send_ptr = "\t\tconst void *send_ptr = NULL;";
 	}
     }
 
@@ -175,17 +162,15 @@ sub output {
 
       $feature . ' *buf' . $param_decl . ')';
 
-    print "{" . $param_buf;
+    print "{";
 
-    print $send_ptr . '' . $send_size;
     if ($retval !~ /^void$/) {
 	print "\t" . $retval . ' retval = (' . $retval . ') 0;';
     }
-    print $buf_set;
 
     print "\tglibtop_init_r (&server, (1 << GLIBTOP_SYSDEPS_" .
 
-      &toupper($feature) . '), 0);';
+      uc($feature) . '), 0);';
 
     print '';
     print "\t/* If neccessary, we ask the server for the requested";
@@ -195,12 +180,21 @@ sub output {
     print "\tif ((server->flags & _GLIBTOP_INIT_STATE_SERVER) &&";
     print "\t    (server->features & (1 << GLIBTOP_SYSDEPS_" .
 
-      &toupper($feature) . ')))';
+      uc($feature) . ')))';
     print "\t{";
 
+    if ($param_buf) {
+        print $param_buf;
+        print $buf_set;
+    }
+
+    print $send_ptr;
+    print $send_size;
+    print '';
+
     print "\t\t" . $prefix . 'glibtop_call_l (server, GLIBTOP_CMND_' .
 
-      &toupper($feature) . ',';
+      uc($feature) . ',';
     print "\t\t\t\t" . $prefix_space . 'send_size, send_ptr,';
     print "\t\t\t\t" . $prefix_space . 'sizeof (glibtop_' . $feature .
 
@@ -209,7 +203,7 @@ sub output {
     print "\t} else {";
 
     if ($orig !~ /^@/) {
-	print '#if (!GLIBTOP_SUID_' . &toupper($feature) . ')';
+	print '#if (!GLIBTOP_SUID_' . uc($feature) . ')';
     }
     print "\t\t" . $prefix . 'glibtop_get_' . $feature . '_s (server, buf' .
 


Home | Main Index | Thread Index | Old Index