[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fink-commits
Subject:    fink/perlmod/Fink CLI.pm,1.36,1.37 ChangeLog,1.1181,1.1182 Engine.pm,1.337,1.338 PkgVersion.pm,1.489
From:       Dave Vasilevsky <vasi () users ! sourceforge ! net>
Date:       2005-10-31 21:42:37
Message-ID: E1EWhQS-0005Wl-AY () mail ! sourceforge ! net
[Download RAW message or body]

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

Modified Files:
	CLI.pm ChangeLog Engine.pm PkgVersion.pm 
Log Message:
fix undefined PkgVersion bug

Index: PkgVersion.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/PkgVersion.pm,v
retrieving revision 1.489
retrieving revision 1.490
diff -u -d -r1.489 -r1.490
--- PkgVersion.pm	31 Oct 2005 20:32:34 -0000	1.489
+++ PkgVersion.pm	31 Oct 2005 21:42:35 -0000	1.490
@@ -34,7 +34,7 @@
 					  &store_rename);
 use Fink::CLI qw(&print_breaking &print_breaking_stderr &rejoin_text
 				 &prompt_boolean &prompt_selection
-				 &should_skip_prompt);
+				 &should_skip_prompt &die_breaking);
 use Fink::Config qw($config $basepath $libpath $debarch $buildpath
 					$dbpath $ignore_errors);
 use Fink::NetAccess qw(&fetch_url_to_file);
@@ -2314,16 +2314,17 @@
 		}
 		if (scalar(@$altlist) <= 0 && lc($field) ne "conflicts") {
 			my $package = Fink::Package->package_by_name($altspec[0]->{'depname'});
-			my $diemessage = "Can't resolve $oper \"$altspecs\" for package \
                \"".$self->get_fullname()."\" (no matching packages/versions \
                found)\n";
-			if (defined $package and $package->is_virtual()) {
-				my $version = &latest_version($package->list_versions());
-				$package = $package->get_version($version);
-				$diemessage .= "\nAt least one of the dependencies required (" . \
                $package->get_name() . ") is a virtual package, you might need\n" .
-					"to manually upgrade or install it.  The package details below should have more \
                information\n" .
-					"on where to find an installer:\n\n" .
-					$package->get_description() . "\n";
+			my $msg = "Can't resolve $oper \"$altspecs\" for package \""
+				. $self->get_fullname()
+				. "\" (no matching packages/versions found)\n";
+			if (defined $package and (my $pv = $package->get_latest_version)) {
+				$msg .= "\nAt least one of the dependencies required ("
+					. $pv->get_name . ") is a virtual package, you might need "
+					. "to manually upgrade or install it.  The package details "
+					. "below should have more information on where to find an "
+					. "installer:\n\n" . $pv->get_description . "\n";
 			}
-			die $diemessage;
+			die_breaking $msg;
 		}
 		push @deplist, $altlist;
 		$idx++;

Index: Engine.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/Engine.pm,v
retrieving revision 1.337
retrieving revision 1.338
diff -u -d -r1.337 -r1.338
--- Engine.pm	31 Oct 2005 20:32:34 -0000	1.337
+++ Engine.pm	31 Oct 2005 21:42:35 -0000	1.338
@@ -255,10 +255,14 @@
 	my $commandline = join ' ', 'fink', @$orig_ARGV;
 	my $notifier = Fink::Notify->new();
 	if ($proc_rc->{'$@'}) {                    # now deal with eval results
-		print "Failed: " . $proc_rc->{'$@'};
+		my $msg = $proc_rc->{'$@'};
+		$msg = '' if $msg =~ /^\s*$/; # treat empty messages nicely
+		
+		print ($msg ? "Failed: $msg" : "Exiting with failure.\n");
+		my $notifydesc = $commandline . ($msg ? "\n$msg" : '');
 		$notifier->notify(
 			event => 'finkDoneFailed',
-			description => "$commandline\n$proc_rc->{'$@'}"
+			description => $notifydesc,
 		);
 		return $proc_rc->{'$?'} || 1;
 	}

Index: CLI.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/CLI.pm,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- CLI.pm	6 Oct 2005 14:58:46 -0000	1.36
+++ CLI.pm	31 Oct 2005 21:42:35 -0000	1.37
@@ -38,7 +38,7 @@
 
 	# your exported package globals go here,
 	# as well as any optionally exported functions
-	@EXPORT_OK	 = qw(&print_breaking &print_breaking_stderr
+	@EXPORT_OK	 = qw(&print_breaking &print_breaking_stderr &die_breaking
 					  &rejoin_text
 					  &prompt &prompt_boolean &prompt_selection
 					  &print_optionlist
@@ -193,6 +193,25 @@
 	select $old_fh;
 }
 
+=item die_breaking
+
+  die_breaking $message;
+
+Raises an exception like 'die', but formats the error message with
+print_breaking.
+
+Note that this does not have all the special features of 'die', such as adding
+the line number on which the error occurs or propagating previous errors if
+no argument is passed.
+
+=cut
+
+sub die_breaking {
+	my $msg = shift;
+	print_breaking_stderr $msg;
+	die "\n";
+}
+
 =item rejoin_text
 
 	print_reaking rejoin_text <<EOMSG

Index: ChangeLog
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/ChangeLog,v
retrieving revision 1.1181
retrieving revision 1.1182
diff -u -d -r1.1181 -r1.1182
--- ChangeLog	31 Oct 2005 20:32:34 -0000	1.1181
+++ ChangeLog	31 Oct 2005 21:42:35 -0000	1.1182
@@ -1,3 +1,11 @@
+2005-10-31  Dave Vasilevsky  <vasi@users.sourceforge.net>
+
+	* CLI.pm: Add die_breaking method to die with a nicely formatted message.
+	* Engine.pm: Treat empty death messages nicely, to enable die_breaking to
+	work.
+	* PkgVersion.pm: Only warn that a package may need manual installation when
+	we have a PkgVersion object to get the instructions from.
+
 2005-10-31  Daniel Macks  <dmacks@netspace.org>
 
 	* PkgVersion.pm: overhaul buildlocks again. Now we set/unset lock



-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Fink-commits mailing list
Fink-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fink-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic