citrun

watch C/C++ source code execute
Log | Files | Refs | LICENSE

commit c8b8a540686df2f1df7007f3c79bf032ee3494e0
parent 03fc22d893bc70d8a69b2eee4a1cade4c3baeee2
Author: Kyle Milz <kyle@getaddrinfo.net>
Date:   Thu, 16 Jun 2016 00:38:47 -0600

Test: start dependency management on osx

Diffstat:
MTest/Package.pm | 14+++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/Test/Package.pm b/Test/Package.pm @@ -31,13 +31,14 @@ sub dependencies { my @installed_pkgs; @installed_pkgs = get_installed_obsd() if ($^O eq "openbsd"); + @installed_pkgs = get_installed_darwin() if ($^O eq "darwin"); my @missing_deps; for my $dep (@deps) { my $found = 0; for (@installed_pkgs) { - if (/^$dep.*$/) { + if (/^\s*$dep.*$/) { $found = 1; last; } @@ -63,4 +64,15 @@ sub get_installed_obsd { return @installed_pkgs; } +sub get_installed_darwin { + my $pid = open2(\*CHLD_OUT, undef, 'port', 'installed'); + waitpid( $pid, 0 ); + my $pkg_info_exit_code = $? >> 8; + + my @installed_pkgs; + push @installed_pkgs, ($_) while (readline \*CHLD_OUT); + + return @installed_pkgs; +} + 1;