Update of /cvsroot/fink/fink/perlmod/Fink
In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv9272/perlmod/Fink

Modified Files:
        ChangeLog VirtPackage.pm 
Log Message:
add /usr/X11 detection

Index: VirtPackage.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/VirtPackage.pm,v
retrieving revision 1.117
retrieving revision 1.118
diff -u -d -r1.117 -r1.118
--- VirtPackage.pm      12 Jan 2007 02:18:22 -0000      1.117
+++ VirtPackage.pm      26 Feb 2007 00:11:07 -0000      1.118
@@ -1039,11 +1039,13 @@
 
                                my $found_xserver = 0;
                                print STDERR "- checking for X servers... " if 
($options{debug});
-                               for my $xserver (@xservers) {
-                                       if (-x '/usr/X11R6/bin/' . $xserver) {
-                                               print STDERR "$xserver\n" if 
($options{debug});
-                                               $found_xserver++;
-                                               last;
+                               for my $xdir ('/usr/X11R6', '/usr/X11') {
+                                       for my $xserver (@xservers) {
+                                               if (-x $xdir . '/bin/' . 
$xserver) {
+                                                       print STDERR 
"$xdir/bin/$xserver\n" if ($options{debug});
+                                                       $found_xserver++;
+                                                       last;
+                                               }
                                        }
                                }
                                print STDERR "missing\n" if ($options{debug} 
and $found_xserver == 0);
@@ -1204,11 +1206,14 @@
 =cut
 
                                print STDERR "- checking for rman... " if 
($options{debug});
-                               if (-x '/usr/X11R6/bin/rman') {
-                                       print STDERR "found, system-xfree86 
provides rman\n" if ($options{debug});
-                                       push(@{$provides->{'system-xfree86'}}, 
'rman');
-                               } else {
-                                       print STDERR "missing\n" if 
($options{debug});
+                               for my $xdir ('/usr/X11R6', '/usr/X11') {
+                                       print STDERR "$xdir... " if 
($options{debug});
+                                       if (-x $xdir . '/bin/rman') {
+                                               print STDERR "found, 
system-xfree86 provides rman\n" if ($options{debug});
+                                               
push(@{$provides->{'system-xfree86'}}, 'rman');
+                                       } else {
+                                               print STDERR "missing\n" if 
($options{debug});
+                                       }
                                }
 
 =item "xfree86-base-threaded" and "xfree86-base-threaded-shlibs"
@@ -1492,40 +1497,44 @@
 sub check_x11_version {
        my (@XF_VERSION_COMPONENTS, $XF_VERSION);
        for my $checkfile ('xterm.1', 'bdftruncate.1', 'gccmakedep.1') {
-               if (-f "/usr/X11R6/man/man1/$checkfile") {
-                       if (open(CHECKFILE, "/usr/X11R6/man/man1/$checkfile")) {
-                               while (<CHECKFILE>) {
-                                       if (/^.*Version\S* ([^\s]+) .*$/) {
-                                               $XF_VERSION = $1;
-                                               @XF_VERSION_COMPONENTS = 
split(/\.+/, $XF_VERSION, 4);
-                                               last;
+               for my $xdir ('/usr/X11R6', '/usr/X11') {
+                       if (-f "$xdir/man/man1/$checkfile") {
+                               if (open(CHECKFILE, 
"$xdir/man/man1/$checkfile")) {
+                                       while (<CHECKFILE>) {
+                                               if (/^.*Version\S* ([^\s]+) 
.*$/) {
+                                                       $XF_VERSION = $1;
+                                                       @XF_VERSION_COMPONENTS 
= split(/\.+/, $XF_VERSION, 4);
+                                                       last;
+                                               }
                                        }
+                                       close(CHECKFILE);
+                               } else {
+                                       print STDERR "WARNING: could not read 
$checkfile: $!\n"
+                                               if ($options{debug});
+                                       return;
                                }
-                               close(CHECKFILE);
-                       } else {
-                               print STDERR "WARNING: could not read 
$checkfile: $!\n"
-                                       if ($options{debug});
-                               return;
                        }
+                       last if (defined $XF_VERSION);
                }
-               last if (defined $XF_VERSION);
        }
        if (not defined $XF_VERSION) {
                for my $binary (@xservers, 'X') {
-                       if (-x '/usr/X11R6/bin/' . $binary) {
-                               if (open (XBIN, "/usr/X11R6/bin/$binary 
-version -iokit 2>\&1 |")) {
-                                       while (my $line = <XBIN>) {
-                                               if ($line =~ /XFree86 Version 
([\d\.]+)/) {
-                                                       $XF_VERSION = $1;
-                                                       @XF_VERSION_COMPONENTS 
= split(/\.+/, $XF_VERSION, 4);
-                                                       last;
+                       for my $xdir ('/usr/X11R6', '/usr/X11') {
+                               if (-x $xdir . '/bin/' . $binary) {
+                                       if (open (XBIN, "$xdir/bin/$binary 
-version -iokit 2>\&1 |")) {
+                                               while (my $line = <XBIN>) {
+                                                       if ($line =~ /(XFree86 
Version|X Protocol.* Release) ([\d\.]+)/) {
+                                                               $XF_VERSION = 
$1;
+                                                               
@XF_VERSION_COMPONENTS = split(/\.+/, $XF_VERSION, 4);
+                                                               last;
+                                                       }
                                                }
+                                               close(XBIN);
+                                       } else {
+                                               print STDERR "couldn't run 
$binary: $!\n";
                                        }
-                                       close(XBIN);
-                               } else {
-                                       print STDERR "couldn't run $binary: 
$!\n";
+                                       last;
                                }
-                               last;
                        }
                }
        }

Index: ChangeLog
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/ChangeLog,v
retrieving revision 1.1434
retrieving revision 1.1435
diff -u -d -r1.1434 -r1.1435
--- ChangeLog   17 Feb 2007 18:40:26 -0000      1.1434
+++ ChangeLog   26 Feb 2007 00:11:07 -0000      1.1435
@@ -1,3 +1,7 @@
+2007-02-25  Benjamin Reed  <[EMAIL PROTECTED]>
+
+       * VirtPackage.pm: added support for detecting /usr/X11
+
 2007-02-17  Dave Morrison  <[EMAIL PROTECTED]>
 
        * SysState.pm: when advising the user to run 'apt-get', the advice


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Fink-commits mailing list
Fink-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to