From d1c10b2f406b0e2b38bfd61022de3d640580c738 Mon Sep 17 00:00:00 2001 From: Andreas Guldstrand Date: Sun, 28 Aug 2016 14:34:53 +0200 Subject: SBO::Lib::Info/Tree: move get_orig_version from ::Tree to ::Info and update ::Pkgs accordingly --- SBO-Lib/lib/SBO/Lib/Info.pm | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'SBO-Lib/lib/SBO/Lib/Info.pm') diff --git a/SBO-Lib/lib/SBO/Lib/Info.pm b/SBO-Lib/lib/SBO/Lib/Info.pm index 9d89364..b4efc2a 100644 --- a/SBO-Lib/lib/SBO/Lib/Info.pm +++ b/SBO-Lib/lib/SBO/Lib/Info.pm @@ -7,7 +7,7 @@ use warnings; our $VERSION = '2.0'; use SBO::Lib::Util qw/ get_arch get_sbo_from_loc open_read script_error /; -use SBO::Lib::Tree qw/ get_sbo_location is_local /; +use SBO::Lib::Tree qw/ get_orig_location get_sbo_location is_local /; use Exporter 'import'; @@ -15,6 +15,7 @@ our @EXPORT_OK = qw{ check_x32 get_download_info get_from_info + get_orig_version get_requires get_sbo_version }; @@ -147,6 +148,26 @@ sub get_from_info { return $store->{$args{GET}}; } +=head2 get_orig_version + + my $ver = get_orig_version($sbo); + +C returns the version in the SlackBuilds.org tree for the +given C<$sbo>. + +=cut + +sub get_orig_version { + script_error('get_orig_version requires an argument.') unless @_ == 1; + my $sbo = shift; + + my $location = get_orig_location($sbo); + + return $location if not defined $location; + + return get_sbo_version($location); +} + =head2 get_requires my $reqs = get_requires($sbo); -- cgit v1.2.3