diff options
Diffstat (limited to 'src/engine/SCons/Tool/packaging/rpm.py')
| -rw-r--r-- | src/engine/SCons/Tool/packaging/rpm.py | 17 | 
1 files changed, 9 insertions, 8 deletions
diff --git a/src/engine/SCons/Tool/packaging/rpm.py b/src/engine/SCons/Tool/packaging/rpm.py index 899e375..3c48b02 100644 --- a/src/engine/SCons/Tool/packaging/rpm.py +++ b/src/engine/SCons/Tool/packaging/rpm.py @@ -4,7 +4,7 @@ The rpm packager.  """  # -# Copyright (c) 2001 - 2016 The SCons Foundation +# Copyright (c) 2001 - 2017 The SCons Foundation  #  # Permission is hereby granted, free of charge, to any person obtaining  # a copy of this software and associated documentation files (the @@ -25,7 +25,7 @@ The rpm packager.  # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -__revision__ = "src/engine/SCons/Tool/packaging/rpm.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog" +__revision__ = "src/engine/SCons/Tool/packaging/rpm.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog"  import os @@ -95,13 +95,15 @@ def collectintargz(target, source, env):      # find the .spec file for rpm and add it since it is not necessarily found      # by the FindSourceFiles function.      sources.extend( [s for s in source if str(s).rfind('.spec')!=-1] ) +    # sort to keep sources from changing order across builds +    sources.sort()      # as the source contains the url of the source package this rpm package      # is built from, we extract the target name      tarball = (str(target[0])+".tar.gz").replace('.rpm', '')      try:          tarball = env['SOURCE_URL'].split('/')[-1] -    except KeyError, e: +    except KeyError as e:          raise SCons.Errors.UserError( "Missing PackageTag '%s' for RPM packager" % e.args[0] )      tarball = src_targz.package(env, source=sources, target=tarball, @@ -136,7 +138,7 @@ def build_specfile(target, source, env):          if 'CHANGE_SPECFILE' in env:              env['CHANGE_SPECFILE'](target, source) -    except KeyError, e: +    except KeyError as e:          raise SCons.Errors.UserError( '"%s" package field for RPM is missing.' % e.args[0] ) @@ -225,7 +227,6 @@ def build_specfile_header(spec):          'X_RPM_EXCLUDEARCH'   : 'ExcludeArch: %s\n',          'X_RPM_EXCLUSIVEARCH' : 'ExclusiveArch: %s\n',          'X_RPM_PREFIX'        : 'Prefix: %s\n', -        'X_RPM_CONFLICTS'     : 'Conflicts: %s\n',          # internal use          'X_RPM_BUILDROOT'     : 'BuildRoot: %s\n', } @@ -270,7 +271,7 @@ def build_specfile_filesection(spec, files):      for file in files:          # build the tagset          tags = {} -        for k in supported_tags.keys(): +        for k in list(supported_tags.keys()):              try:                  v = file.GetTag(k)                  if v: @@ -324,7 +325,7 @@ class SimpleTagCompiler(object):          for key, replacement in domestic:              try:                  str = str + replacement % values[key] -            except KeyError, e: +            except KeyError as e:                  if self.mandatory:                      raise e @@ -335,7 +336,7 @@ class SimpleTagCompiler(object):                  int_values_for_key = [(get_country_code(t[0]),t[1]) for t in x]                  for v in int_values_for_key:                      str = str + replacement % v -            except KeyError, e: +            except KeyError as e:                  if self.mandatory:                      raise e  | 
