From owner-freebsd-ports@FreeBSD.ORG Tue Mar 4 04:44:42 2014 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FE922D4 for ; Tue, 4 Mar 2014 04:44:42 +0000 (UTC) Received: from mail-pa0-x22b.google.com (mail-pa0-x22b.google.com [IPv6:2607:f8b0:400e:c03::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D92AFD4D for ; Tue, 4 Mar 2014 04:44:41 +0000 (UTC) Received: by mail-pa0-f43.google.com with SMTP id bj1so4635049pad.16 for ; Mon, 03 Mar 2014 20:44:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=KJs2GHubLh6Z9v7mOPJeyDFjHF4mSev28h0bFAi9szg=; b=1JfgaVHCyg5h5K7ti7AC/j1GPS77yj8v0DXysfWvwaNbmCx1SWwZrEylB1jueOsd4z 1ofhj/zHLYZzznxyN/fOOlOwWs2yjS4KysrTaVQNDUitE1kTfbW1QllcqDm2wvhuoh4k Sni++tFcHD0XRMggqL+WpntbMOM6DG8nrR8g3W+tsEbBFu5xImP+n2/CPsX86+JO3PY6 hHEWlY4/OWO389cnRrPRk4h7Rvus6McIeTnpmp8KnjSYok1WE+WtyxYhmIfp6aeipbOr Ia4sMCwzpa12YcS4puRP18H0G3Z+gpg+QOt0x7ydrHhYtg8JePD8KOYN0CXly9TBsPER i7SA== MIME-Version: 1.0 X-Received: by 10.68.76.68 with SMTP id i4mr23455726pbw.73.1393908281308; Mon, 03 Mar 2014 20:44:41 -0800 (PST) Sender: kob6558@gmail.com Received: by 10.66.0.164 with HTTP; Mon, 3 Mar 2014 20:44:41 -0800 (PST) In-Reply-To: References: <4238376.5ExdFi7rnP@alex.super> Date: Mon, 3 Mar 2014 20:44:41 -0800 X-Google-Sender-Auth: UZMSY3V4-ciGJwYCJHed6iGumzM Message-ID: Subject: Re: graphics/imageindex - 1.1_5 From: Kevin Oberman To: "Alex V. Petrov" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: "freebsd-ports@freebsd.org" X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Mar 2014 04:44:42 -0000 On Mon, Mar 3, 2014 at 12:25 PM, Kevin Oberman wrote: > On Mon, Mar 3, 2014 at 9:54 AM, Alex V. Petrov wrote: > > I installed subj on 10-stable. >> Result: >> >> $ imageindex >> defined(@array) is deprecated at /usr/local/bin/imageindex line 2301. >> (Maybe you should just omit the defined()?) >> defined(@array) is deprecated at /usr/local/bin/imageindex line 2314. >> (Maybe you should just omit the defined()?) >> defined(@array) is deprecated at /usr/local/bin/imageindex line 2478. >> (Maybe you should just omit the defined()?) >> defined(@array) is deprecated at /usr/local/bin/imageindex line 2502. >> (Maybe you should just omit the defined()?) >> > > Yes, recent versions of perl don't allow this use of "defined". > > >> Can't locate flush.pl in @INC (@INC contains: >> /usr/local/lib/perl5/5.16/BSDPAN >> /usr/local/lib/perl5/site_perl/5.16/mach >> /usr/local/lib/perl5/site_perl/5.16 >> /usr/local/lib/perl5/5.16/mach /usr/local/lib/perl5/5.16 .) at >> /usr/local/bin/imageindex line 328. >> >> >> Whats wrong? >> >> flush.pl was one of several old perl4 include files that were deprecated > back when perl5 came out and was removed in Perl 5.16. It probably should > be replaced by IO::Handle. > > From the ancient Perl syntax, I'd say that this port or the upstream needs > to be updated to modern syntax. To fix these is trivial, but the > maintainer/author should probably check for other things that are obsolete. > The last version is seven years old. > > Pulled down the source and it is a bit crufty, but not as bad. Just a few things that need fixing. Here is a patch. I have not actually tried it, but it should do the trick. It passes -wc. I probably should have thrown in a "use strict;".. I just don't have time right now to scope all of the variables that are now default global (no scope declared). Most will be "my", but it will take time to adjust for any that should be "local" or "global", if any. cd /usr/ports/graphics/imageindex make extract mkdir files Copy the following into files ========================================================================= --- imageindex.orig 2007-04-04 12:55:51.000000000 -0700 +++ imageindex 2014-03-03 20:29:22.000000000 -0800 @@ -325,7 +325,7 @@ use File::Copy; use English; use Carp; -require 'flush.pl'; +use IO::Handle; # to shut up -w use vars qw($opt_recurse); @@ -523,7 +523,7 @@ # Extract info print "Extracting image info"; -flush (STDOUT); +STDOUT->flush(); foreach my $file (@files) { @@ -1708,7 +1708,7 @@ # at the user so that the video regexp might be adjusted if ($retval == -1) { print "\nwarning: $pathname identified by extension as video file but mplayer doesn't recognize it\n"; - flush (STDOUT); + STDOUT->flush(); } } else { &extract_image_info ($filename); @@ -1731,15 +1731,15 @@ my ($arate, $anch, $length, $is_video); print "."; - flush (STDOUT); + STDOUT->flush(); if ($mplayer_prog eq '' || ($do_video_files == 0)) { if (($do_video_files != 0) && $mplayer_prog eq '') { print "\nwarning: Trying to process video files but cannot find mplayer in \$path!\n"; - flush (STDOUT); + STDOUT->flush(); } print "\nSkipping $pathname"; - flush (STDOUT); + STDOUT->flush(); return 0; } else { $object_counter++; @@ -1893,14 +1893,14 @@ my $i; print "."; - flush (STDOUT); + STDOUT->flush(); $retval = $image->Read($pathname); if ($retval ne "") { print "\nSkipping $pathname"; - flush (STDOUT); + STDOUT->flush(); return; } else { $object_counter++; @@ -2298,7 +2298,7 @@ if (defined($lastdate)) { print "\n"; } - if (!defined ($opt_includeall) && defined (@opt_exclude) && scalar (@opt_exclude)) { + if (!defined ($opt_includeall) && @opt_exclude && scalar (@opt_exclude)) { my $tmp = join (',', @opt_exclude); my $etmp; @@ -2311,7 +2311,7 @@ } printf ("\n", $image_counter); - if (defined (@opt_skipmont) && scalar (@opt_skipmont)) { + if (@opt_skipmont && scalar (@opt_skipmont)) { my $tmp = join (',', @opt_skipmont); printf ("\n", $tmp); } @@ -2475,7 +2475,7 @@ # then process. Check to see if any of the -skipmont options were given as # strings of filenames concatenated with ',' characters. If so, support it. # - if (defined (@opt_skipmont)) { + if (@opt_skipmont) { foreach (@opt_skipmont) { (@tokens) = split (/,/, $_); foreach $token (@tokens) { @@ -2499,7 +2499,7 @@ # then process. Check to see if any of the -exclude options were given as # strings of filenames concatenated with ',' characters. If so, support it. # - if (defined (@opt_exclude)) { + if (@opt_exclude) { # -includeall takes priority over -exclude on the commandline if they are # used together (wierd, but ...) # ========================================================================= Install the port as you normally would. -- R. Kevin Oberman, Network Engineer, Retired E-mail: rkoberman@gmail.com