diff options
author | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-08-28 14:34:53 +0200 |
---|---|---|
committer | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-08-28 14:34:53 +0200 |
commit | d1c10b2f406b0e2b38bfd61022de3d640580c738 (patch) | |
tree | a3dce170f16feaef9bf0dfba561c228f8e90047d /SBO-Lib/lib | |
parent | 5f6818be6eca7b849de73947d2d5a5c408c3624c (diff) | |
download | sbotools-d1c10b2f406b0e2b38bfd61022de3d640580c738.tar.xz |
SBO::Lib::Info/Tree: move get_orig_version from ::Tree to ::Info
and update ::Pkgs accordingly
Diffstat (limited to 'SBO-Lib/lib')
-rw-r--r-- | SBO-Lib/lib/SBO/Lib/Info.pm | 23 | ||||
-rw-r--r-- | SBO-Lib/lib/SBO/Lib/Pkgs.pm | 4 | ||||
-rw-r--r-- | SBO-Lib/lib/SBO/Lib/Tree.pm | 22 |
3 files changed, 24 insertions, 25 deletions
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<get_orig_version()> 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); diff --git a/SBO-Lib/lib/SBO/Lib/Pkgs.pm b/SBO-Lib/lib/SBO/Lib/Pkgs.pm index ec1f182..7918240 100644 --- a/SBO-Lib/lib/SBO/Lib/Pkgs.pm +++ b/SBO-Lib/lib/SBO/Lib/Pkgs.pm @@ -7,8 +7,8 @@ use warnings; our $VERSION = '2.0'; use SBO::Lib::Util qw/ %config script_error open_read version_cmp /; -use SBO::Lib::Tree qw/ get_orig_version get_sbo_location get_sbo_locations is_local /; -use SBO::Lib::Info qw/ get_sbo_version /; +use SBO::Lib::Tree qw/ get_sbo_location get_sbo_locations is_local /; +use SBO::Lib::Info qw/ get_orig_version get_sbo_version /; use Exporter 'import'; diff --git a/SBO-Lib/lib/SBO/Lib/Tree.pm b/SBO-Lib/lib/SBO/Lib/Tree.pm index c347659..5fa321e 100644 --- a/SBO-Lib/lib/SBO/Lib/Tree.pm +++ b/SBO-Lib/lib/SBO/Lib/Tree.pm @@ -13,7 +13,6 @@ use Exporter 'import'; our @EXPORT_OK = qw{ get_orig_location - get_orig_version get_sbo_location get_sbo_locations is_local @@ -59,27 +58,6 @@ sub get_orig_location { return $orig{$sbo}; } -=head2 get_orig_version - - my $ver = get_orig_version($sbo); - -C<get_orig_version()> 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_sbo_location my $loc = get_sbo_location($sbo, ...); |