From 6fc9e5d1ef9503609c8b59ca2d442e38c0263f4d Mon Sep 17 00:00:00 2001 From: Derek Bankieris Date: Tue, 9 Apr 2019 13:28:16 -0500 Subject: [PATCH] Lift get_paths into its own module Fixes #752 (cherry picked from commit bde2ec515829b64c786db09309a425eba757a5b1) Conflicts: libexec/trick/convert_swig libexec/trick/make_makefile_swig --- libexec/trick/make_makefile_swig | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/libexec/trick/make_makefile_swig b/libexec/trick/make_makefile_swig index 8f5a5863..3c27cef2 100755 --- a/libexec/trick/make_makefile_swig +++ b/libexec/trick/make_makefile_swig @@ -11,6 +11,7 @@ use Digest::MD5 qw(md5_hex) ; use trick_version ; use html ; use verbose_build ; +use get_paths ; use strict ; my @exclude_paths ; @@ -24,21 +25,6 @@ my %trick_headers ; my %python_modules ; my %python_module_dirs ; -sub get_paths { - my @paths = split /:/ , $ENV{$_[0]} ; - if (scalar @paths) { - @paths = sort(@paths ) ; - # trim whitespace - @paths = map { s/(^\s+|\s+$)//g ; $_ } @paths ; - # Remove empty elements. Sort forced all blank names to the front. - while ( scalar @paths and not length @paths[0] ) { - shift @paths ; - } - @paths = map { (-e $_) ? abs_path($_) : $_ } @paths ; - } - return @paths ; -} - sub read_files_to_process() { my @include_paths ; my $cc ;