diff options
| author | xocel <xocel@iquidus.org> | 2012-12-28 11:02:57 +1300 | 
|---|---|---|
| committer | xocel <xocel@iquidus.org> | 2012-12-28 11:02:57 +1300 | 
| commit | cdfb56c6951da7e44a5a11af9ee85a5bab09dd64 (patch) | |
| tree | c906c70f70128ec514e9290f6bb01cd6e9c4b3df /SBO-Lib | |
| parent | 5bac066116d3ffaf4a2bd12d1c77b78be5d2147c (diff) | |
| download | sbotools2-cdfb56c6951da7e44a5a11af9ee85a5bab09dd64.tar.xz | |
fixed tests
Diffstat (limited to 'SBO-Lib')
| -rw-r--r-- | SBO-Lib/lib/SBO/Lib.pm | 20 | 
1 files changed, 17 insertions, 3 deletions
diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm index ded1dac..5844868 100644 --- a/SBO-Lib/lib/SBO/Lib.pm +++ b/SBO-Lib/lib/SBO/Lib.pm @@ -14,8 +14,8 @@ use strict;  use warnings FATAL => 'all'; -package SBO::Lib 1.2; -my $version = '1.2'; +package SBO::Lib; +our $VERSION = '1.2';  require Exporter;  our @ISA = qw(Exporter); @@ -39,6 +39,7 @@ our @EXPORT = qw(  	get_tmp_extfn  	get_arch  	get_build_queue +	merge_queues  	$tempdir  	$conf_dir  	$conf_file @@ -119,7 +120,7 @@ our $slackbuilds_txt = "$config{SBO_HOME}/SLACKBUILDS.TXT";  my $name_regex = '\ASLACKBUILD\s+NAME:\s+';  sub show_version () { -	say "sbotools version $version"; +	say "sbotools version $VERSION";  	say 'licensed under the WTFPL';  	say '<http://sam.zoy.org/wtfpl/COPYING>';  } @@ -765,3 +766,16 @@ sub get_build_queue {  	}  	return \@build_queue;  } + +sub merge_queues { +	# Usage: merge_queues(\@queue_a, \@queue_b); +	# Results in queue_b being merged into queue_a (without duplicates) +	exists $_[1] or script_error 'merge_queues requires two arguments.'; +    my $queue_a = $_[0]; +    my $queue_b = $_[1]; + +    for my $item (reverse @$queue_b) { +        push @$queue_a, $item unless $item ~~ @$queue_a; +    } +    return $queue_a; +}
\ No newline at end of file  | 
