diff options
| author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2019-07-24 09:57:09 +0200 | 
|---|---|---|
| committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2019-07-24 09:57:09 +0200 | 
| commit | c7665433b2004d2b404d6fb9d6fd064998486f63 (patch) | |
| tree | 8525ef6d24f7c6ceb238945ebb2cc997c7afc905 /src/engine/SCons/Tool/packaging/ipk.py | |
| parent | e48d2727885efda8369c7edbc2e3929a59532adc (diff) | |
| parent | 6e228c305122f0564eda1e67d56651f8386d24d7 (diff) | |
Merge branch 'release/debian/3.1.0+repack-1'debian/3.1.0+repack-1
Diffstat (limited to 'src/engine/SCons/Tool/packaging/ipk.py')
| -rw-r--r-- | src/engine/SCons/Tool/packaging/ipk.py | 26 | 
1 files changed, 15 insertions, 11 deletions
diff --git a/src/engine/SCons/Tool/packaging/ipk.py b/src/engine/SCons/Tool/packaging/ipk.py index 71fa2b0..dbf5be8 100644 --- a/src/engine/SCons/Tool/packaging/ipk.py +++ b/src/engine/SCons/Tool/packaging/ipk.py @@ -2,8 +2,8 @@  """  # -# Copyright (c) 2001 - 2017 The SCons Foundation -#  +# Copyright (c) 2001 - 2019 The SCons Foundation +#  # Permission is hereby granted, free of charge, to any person obtaining  # a copy of this software and associated documentation files (the  # "Software"), to deal in the Software without restriction, including @@ -24,11 +24,13 @@  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  # -__revision__ = "src/engine/SCons/Tool/packaging/ipk.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" +__revision__ = "src/engine/SCons/Tool/packaging/ipk.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" + +import os  import SCons.Builder  import SCons.Node.FS -import os +import SCons.Util  from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot @@ -115,15 +117,17 @@ def build_specfiles(source, target, env):      #      #      opened_files={} -    def open_file(needle, haystack): +    def open_file(needle, haystack=None):          try:              return opened_files[needle]          except KeyError: -            file=filter(lambda x: x.get_path().rfind(needle)!=-1, haystack)[0] -            opened_files[needle]=open(file.get_abspath(), 'w') +            files = filter(lambda x: x.get_path().rfind(needle) != -1, haystack) +            # Py3: filter returns an iterable, not a list +            file = list(files)[0] +            opened_files[needle] = open(file.get_abspath(), 'w')              return opened_files[needle] -    control_file=open_file('control', target) +    control_file = open_file('control', target)      if 'X_IPK_DESCRIPTION' not in env:          env['X_IPK_DESCRIPTION']="%s\n %s"%(env['SUMMARY'], @@ -145,7 +149,7 @@ Description: $X_IPK_DESCRIPTION      control_file.write(env.subst(content))      # -    # now handle the various other files, which purpose it is to set post-,  +    # now handle the various other files, which purpose it is to set post-,      # pre-scripts and mark files as config files.      #      # We do so by filtering the source files for files which are marked with @@ -157,14 +161,14 @@ Description: $X_IPK_DESCRIPTION      # into the same named file.      #      for f in [x for x in source if 'PACKAGING_CONFIG' in dir(x)]: -        config=open_file('conffiles') +        config = open_file('conffiles')          config.write(f.PACKAGING_INSTALL_LOCATION)          config.write('\n')      for str in 'POSTRM PRERM POSTINST PREINST'.split():          name="PACKAGING_X_IPK_%s"%str          for f in [x for x in source if name in dir(x)]: -            file=open_file(name) +            file = open_file(name)              file.write(env[str])      #  | 
