diff options
| author | xocel <xocel@iquidus.org> | 2012-12-30 05:14:37 +1300 | 
|---|---|---|
| committer | xocel <xocel@iquidus.org> | 2012-12-30 05:14:37 +1300 | 
| commit | a9491fed6e115adb86b8b7bdc94d5a6d4862a703 (patch) | |
| tree | 2e50c68f331c357d59e1bd51b3dcbb1e1b51888c /SBO-Lib/lib | |
| parent | e452c4871418a5cc9152ed830d641f0ceefba3f2 (diff) | |
| download | sbotools2-a9491fed6e115adb86b8b7bdc94d5a6d4862a703.tar.xz | |
sboremove: minor fixes, moved get_requires to lib.pm, added tests, updated man page, more comments
Diffstat (limited to 'SBO-Lib/lib')
| -rw-r--r-- | SBO-Lib/lib/SBO/Lib.pm | 12 | 
1 files changed, 9 insertions, 3 deletions
| diff --git a/SBO-Lib/lib/SBO/Lib.pm b/SBO-Lib/lib/SBO/Lib.pm index 5844868..47a379d 100644 --- a/SBO-Lib/lib/SBO/Lib.pm +++ b/SBO-Lib/lib/SBO/Lib.pm @@ -30,6 +30,7 @@ our @EXPORT = qw(  	get_installed_sbos  	get_inst_names  	get_available_updates +	get_requires  	do_slackbuild  	make_clean  	make_distclean @@ -722,6 +723,13 @@ sub do_upgradepkg ($) {  	return 1;  } +# wrapper to pull the list of requirements for a given sbo +sub get_requires ($) { +	my $location = get_sbo_location(shift); +	return unless $location; +	my $info = get_from_info(LOCATION => $location, GET => 'REQUIRES'); +	return $$info[0] ne '' ? $info : undef; +}  # avoid being called to early to check prototype when add_to_queue calls itself  sub add_to_queue ($); @@ -731,9 +739,7 @@ sub add_to_queue ($) {  	my $sbo = \${$args}{NAME};  	return unless $$sbo;  	push @$args{QUEUE}, $$sbo; -	my $location = get_sbo_location ($$sbo); -	return unless $location; -	my $requires = get_from_info (LOCATION => $location, GET => 'REQUIRES'); +	my $requires = get_requires $$sbo;  	FIRST: for my $req (@$requires) {  		next FIRST if $req eq $$sbo;  		if ($req eq "%README%") { | 
