[53573] users/devans/utils

devans at macports.org devans at macports.org
Wed Jul 8 11:21:03 PDT 2009


Revision: 53573
          http://trac.macports.org/changeset/53573
Author:   devans at macports.org
Date:     2009-07-08 11:21:02 -0700 (Wed, 08 Jul 2009)
Log Message:
-----------
utils/gnome-latest-version.pl: move to its own project directory.

Added Paths:
-----------
    users/devans/utils/gnome-latest-version/
    users/devans/utils/gnome-latest-version/gnome-latest-version.pl

Removed Paths:
-------------
    users/devans/utils/gnome-latest-version.pl

Copied: users/devans/utils/gnome-latest-version/gnome-latest-version.pl (from rev 53571, users/devans/utils/gnome-latest-version.pl)
===================================================================
--- users/devans/utils/gnome-latest-version/gnome-latest-version.pl	                        (rev 0)
+++ users/devans/utils/gnome-latest-version/gnome-latest-version.pl	2009-07-08 18:21:02 UTC (rev 53573)
@@ -0,0 +1,105 @@
+#!/opt/local/bin/perl
+
+use Getopt::Long;
+use Net::FTP;
+
+my $ftp_host   = "ftp.gnome.org";
+my $ftp_user   = "anonymous";
+my $ftp_passwd = "devans\@macports.org";
+my $ftp_base   = "/pub/gnome/sources";
+my $branch     = "";
+my $debug      = 0;
+my $names_only = 0;
+
+my $result = GetOptions(
+	"host=s"     => \$ftp_host,
+	"user=s"     => \$ftp_user,
+	"password=s" => \$ftp_passwd,
+	"base=s"     => \$ftp_base,
+	"branch=s"   => \$branch,
+	"debug"      => \$debug,
+	"names_only" => \$names_only
+);
+
+my $nargs  = scalar(@ARGV);
+my @gnames = @ARGV;
+
+my $ftp = Net::FTP->new( $ftp_host, Debug => $debug );
+$ftp->login( $ftp_user, $ftp_passwd );
+
+if ( $nargs < 1 ) {
+	$ftp->cwd($ftp_base);
+	@gnames = $ftp->ls;
+	$nargs  = scalar(@gnames);
+}
+
+if ($debug) {
+	print "$nargs arguments:";
+	if ( $nargs > 0 ) {
+		foreach my $gname (@gnames) { print "    $gname\n"; }
+	}
+	if ( $branch ne "" ) { print "Print branch $branch only.\n"; }
+}
+
+foreach my $gname (@gnames) {
+	$ftp->cwd("$ftp_base/$gname") or next;
+	my @lines = $ftp->ls;
+
+	my $major = -1;
+	my $minor = -1;
+
+	foreach my $line (@lines) {
+		if ( $line =~ m/^(\d+)\.(\d+)$/ ) {
+			if ( $branch ne "$major.$minor" ) {
+				if ( $1 > $major ) {
+					$major = $1;
+					$minor = $2;
+				}
+				elsif ( ( $1 == $major ) && ( $2 > $minor ) ) {
+					$minor = $2;
+				}
+			}
+		}
+	}
+
+	undef @lines;
+
+	if ($debug) { print "Latest branch for $gname is $major.$minor\n"; }
+
+	if ( ( $major >= 0 ) && ( $minor >= 0 ) ) {
+
+		if ( ( $branch eq "" ) || ( $branch eq "$major.$minor" ) ) {
+
+			$ftp->cwd("$ftp_base/$gname/$major.$minor")
+			  or die
+			  "$gname: cannot change to working directory $major.$minor: ",
+			  $ftp->message;
+
+			my @lines = $ftp->ls;
+
+			$version = "$major.$minor";
+
+			foreach my $line (@lines) {
+				if ( $line =~ m/^LATEST-IS-(.*)$/ ) {
+					$version = $1;
+				}
+			}
+
+			if ($debug) {
+				print "Latest version for $gname is $version\n";
+			}
+			elsif ($names_only) {
+				print "$gname\n";
+			}
+			else {
+				print "$gname $version\n";
+			}
+
+		}
+
+	}
+
+}
+
+$ftp->quit;
+

Deleted: users/devans/utils/gnome-latest-version.pl
===================================================================
--- users/devans/utils/gnome-latest-version.pl	2009-07-08 14:53:13 UTC (rev 53572)
+++ users/devans/utils/gnome-latest-version.pl	2009-07-08 18:21:02 UTC (rev 53573)
@@ -1,100 +0,0 @@
-#!/opt/local/bin/perl
-
-use Getopt::Long;
-use Net::FTP;
-
-my $ftp_host   = "ftp.gnome.org";
-my $ftp_user   = "anonymous";
-my $ftp_passwd = "devans\@macports.org";
-my $ftp_base   = "/pub/gnome/sources";
-my $branch     = "";
-my $debug      = 0;
-
-my $result = GetOptions(
-	"host=s"     => \$ftp_host,
-	"user=s"     => \$ftp_user,
-	"password=s" => \$ftp_passwd,
-	"base=s"     => \$ftp_base,
-	"branch=s"   => \$branch,
-	"debug"      => \$debug
-);
-
-my $nargs  = scalar(@ARGV);
-my @gnames = @ARGV;
-
-my $ftp = Net::FTP->new( $ftp_host, Debug => $debug );
-$ftp->login( $ftp_user, $ftp_passwd );
-
-if ( $nargs < 1 ) {
-	$ftp->cwd($ftp_base);
-	@gnames = $ftp->ls;
-	$nargs  = scalar(@gnames);
-}
-
-if ($debug) {
-	print "$nargs arguments:";
-	if ( $nargs > 0 ) {
-		foreach my $gname (@gnames) { print "    $gname\n"; }
-	}
-	if ( $branch ne "" ) { print "Print branch $branch only.\n"; }
-}
-
-foreach my $gname (@gnames) {
-	$ftp->cwd("$ftp_base/$gname")
-	  or die "cannot change to working directory $gname: ",
-	  $ftp->message;
-	my @lines = $ftp->ls;
-
-	my $major = -1;
-	my $minor = -1;
-
-	foreach my $line (@lines) {
-		if ( $line =~ m/^(\d+)\.(\d+)$/ ) {
-			if ( $1 > $major ) {
-				$major = $1;
-				$minor = $2;
-			}
-			elsif ( ( $1 == $major ) && ( $2 > $minor ) ) {
-				$minor = $2;
-			}
-		}
-	}
-
-	undef @lines;
-
-	if ($debug) { print "Latest branch for $gname is $major.$minor\n"; }
-
-	if ( ( $major >= 0 ) && ( $minor >= 0 ) ) {
-
-		if ( ( $branch eq "" ) || ( $branch eq "$major.$minor" ) ) {
-
-			$ftp->cwd("$ftp_base/$gname/$major.$minor")
-			  or die
-			  "$gname: cannot change to working directory $major.$minor: ",
-			  $ftp->message;
-
-			my @lines = $ftp->ls;
-			
-			$version = "$major.$minor";
-
-			foreach my $line (@lines) {
-				if ( $line =~ m/^LATEST-IS-(.*)$/ ) {
-					$version = $1;
-				}
-			}
-
-			if ($debug) {
-				print "Latest version for $gname is $version\n";
-			}
-			else {
-				print "$gname $version\n";
-			}
-
-		}
-
-	}
-
-}
-
-$ftp->quit;
-
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090708/08852473/attachment.html>


More information about the macports-changes mailing list