[libmodule-install-doapchangesets-perl] 27/47: make default data source finding more sane

Jonas Smedegaard js at alioth.debian.org
Fri Aug 9 14:08:42 UTC 2013


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository libmodule-install-doapchangesets-perl.

commit 802f9df00bcebdd566d0fb856f0a55ee582be2ee
Author: Toby Inkster <mail at tobyinkster.co.uk>
Date:   Wed Jul 4 15:02:57 2012 +0100

    make default data source finding more sane
    
    --HG--
    branch : Module-Install-DOAPChangeSets
---
 lib/Module/Install/Admin/DOAPChangeSets.pm |   21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/lib/Module/Install/Admin/DOAPChangeSets.pm b/lib/Module/Install/Admin/DOAPChangeSets.pm
index 01a8158..22a26db 100644
--- a/lib/Module/Install/Admin/DOAPChangeSets.pm
+++ b/lib/Module/Install/Admin/DOAPChangeSets.pm
@@ -18,27 +18,26 @@ sub _make_dcs
 
 	unless (defined $self->{DCS})
 	{
-		my @files_to_try = qw[meta/changes.ttl Changes.ttl];
-		while (!defined $in)
-		{
-			my $f = shift @files_to_try;
-			$in = $f if -e $f;
-		}
-		die "meta/changes.ttl not found.\n" unless defined $in;
-		
-		my $inuri = URI::file->new_abs($in);
-		
 		my $model = eval {
 			require Module::Install::Admin::RDF;
 			Module::Install::Admin::RDF::rdf_metadata($self);
-			};
+		};
 		if (defined $model)
 		{
+			my $inuri = URI::file->new_abs("meta/");
 			$self->{DCS} = RDF::DOAP::ChangeSets->new($inuri, $model);
 		}
 		else
 		{
+			my @files_to_try = qw[meta/changes.ttl Changes.ttl];
+			while (@files_to_try and not defined $in)
+ 			{
+				my $f = shift @files_to_try;
+				$in = $f if -e $f;
+			}
+			die "meta/changes.ttl not found" unless $in;
 			my $data = slurp($in);
+			my $inuri = URI::file->new_abs($in);
 			$self->{DCS} = RDF::DOAP::ChangeSets->new($inuri, undef, $type, $fmt);
 		}
 	}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmodule-install-doapchangesets-perl.git



More information about the Pkg-perl-cvs-commits mailing list