graphics/imageindex - 1.1_5

Kevin Oberman rkoberman at gmail.com
Tue Mar 4 04:44:42 UTC 2014


On Mon, Mar 3, 2014 at 12:25 PM, Kevin Oberman <rkoberman at gmail.com> wrote:

> On Mon, Mar 3, 2014 at 9:54 AM, Alex V. Petrov <alexvpetrov at gmail.com>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 "<META NAME=\"$enddatemetatag\" CONTENT=\"$lastdate\">\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 ("<META NAME=\"$numimagesmetatag\" CONTENT=\"%d\">\n",
$image_counter);

-    if (defined (@opt_skipmont) && scalar (@opt_skipmont)) {
+    if (@opt_skipmont && scalar (@opt_skipmont)) {
     my $tmp = join (',', @opt_skipmont);
     printf ("<META NAME=\"$skipmetatag\" CONTENT=\"%s\">\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 at gmail.com


More information about the freebsd-ports mailing list