diff --git a/README.rst b/README.rst index 89b1a168..79e1c032 100644 --- a/README.rst +++ b/README.rst @@ -505,7 +505,7 @@ Build packages and passing variables to the script: First export variable(s) like: - $ export SLPKG_FFMPEG_ASS=yes SLPKG_FFMPEG_X264=yes + $ export FFMPEG_ASS=yes FFMPEG_X264=yes And then run as you know: diff --git a/slpkg/pkg/build.py b/slpkg/pkg/build.py index 4277d470..72869a4a 100644 --- a/slpkg/pkg/build.py +++ b/slpkg/pkg/build.py @@ -104,14 +104,15 @@ class BuildPackage(object): def _pass_variable(self): ''' - Grep slpkg bash variable + Return enviroment variables ''' pass_var = [] - bash_var = subprocess.check_output("set | grep 'SLPKG'", shell=True) - for var in bash_var.splitlines(): - if (var.startswith('SLPKG_') and - var.split('_')[-2].lower() == self.prgnam.lower()): - pass_var.append(var[len('SLPKG') + len(self.prgnam) + 2:]) + for var in os.environ.keys(): + if (var.startswith('{0}_'.format(self.prgnam.upper())) and + var.split('_')[-2] == self.prgnam.upper()): + pass_var.append('{0}={1}'.format( + var[len(self.prgnam.upper()) + 1:], + os.environ[var])) return pass_var