summaryrefslogtreecommitdiff
path: root/engine/SCons/Tool/packaging/rpm.py
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2016-04-10 16:42:40 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2016-04-10 16:42:40 +0200
commit70639bffe44444b5faee83772cc3c73dc2e46fed (patch)
tree124bf797d20d37bf34c54e5a5a668c2e7cc2cea0 /engine/SCons/Tool/packaging/rpm.py
parent6a570afd28bccdb118edde36488ba9834494d6c7 (diff)
Imported Upstream version 2.5.0upstream/2.5.0
Diffstat (limited to 'engine/SCons/Tool/packaging/rpm.py')
-rw-r--r--engine/SCons/Tool/packaging/rpm.py24
1 files changed, 7 insertions, 17 deletions
diff --git a/engine/SCons/Tool/packaging/rpm.py b/engine/SCons/Tool/packaging/rpm.py
index cf3ea81..6c00e8c 100644
--- a/engine/SCons/Tool/packaging/rpm.py
+++ b/engine/SCons/Tool/packaging/rpm.py
@@ -4,7 +4,7 @@ The rpm packager.
"""
#
-# Copyright (c) 2001 - 2015 The SCons Foundation
+# Copyright (c) 2001 - 2016 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.4.1:3453:73fefd3ea0b0 2015/11/09 03:25:05 bdbaddog"
+__revision__ = "src/engine/SCons/Tool/packaging/rpm.py rel_2.5.0:3543:937e55cd78f7 2016/04/09 11:29:54 bdbaddog"
import os
@@ -72,7 +72,6 @@ def package(env, target, source, PACKAGEROOT, NAME, VERSION,
# if no "SOURCE_URL" tag is given add a default one.
if 'SOURCE_URL' not in kw:
- #kw['SOURCE_URL']=(str(target[0])+".tar.gz").replace('.rpm', '')
kw['SOURCE_URL']=(str(target[0])+".tar.gz").replace('.rpm', '')
# mangle the source and target list for the rpmbuild
@@ -86,26 +85,21 @@ def package(env, target, source, PACKAGEROOT, NAME, VERSION,
def collectintargz(target, source, env):
""" Puts all source files into a tar.gz file. """
- # the rpm tool depends on a source package, until this is chagned
+ # the rpm tool depends on a source package, until this is changed
# this hack needs to be here that tries to pack all sources in.
sources = env.FindSourceFiles()
# filter out the target we are building the source list for.
- #sources = [s for s in sources if not (s in target)]
sources = [s for s in sources if s not in target]
# 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] )
- spec_file = lambda s: str(s).rfind('.spec') != -1
- sources.extend( list(filter(spec_file, source)) )
+ sources.extend( [s for s in source if str(s).rfind('.spec')!=-1] )
# 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', '')
tarball = (str(target[0])+".tar.gz").replace('.rpm', '')
try:
- #tarball = env['SOURCE_URL'].split('/')[-1]
tarball = env['SOURCE_URL'].split('/')[-1]
except KeyError, e:
raise SCons.Errors.UserError( "Missing PackageTag '%s' for RPM packager" % e.args[0] )
@@ -194,7 +188,7 @@ def build_specfile_sections(spec):
return str
def build_specfile_header(spec):
- """ Builds all section but the %file of a rpm specfile
+ """ Builds all sections but the %file of a rpm specfile
"""
str = ""
@@ -312,11 +306,10 @@ class SimpleTagCompiler(object):
self.mandatory = mandatory
def compile(self, values):
- """ compiles the tagset and returns a str containing the result
+ """ Compiles the tagset and returns a str containing the result
"""
def is_international(tag):
- #return tag.endswith('_')
- return tag[-1:] == '_'
+ return tag.endswith('_')
def get_country_code(tag):
return tag[-2:]
@@ -327,7 +320,6 @@ class SimpleTagCompiler(object):
replacements = list(self.tagset.items())
str = ""
- #domestic = [ (k,v) for k,v in replacements if not is_international(k) ]
domestic = [t for t in replacements if not is_international(t[0])]
for key, replacement in domestic:
try:
@@ -336,11 +328,9 @@ class SimpleTagCompiler(object):
if self.mandatory:
raise e
- #international = [ (k,v) for k,v in replacements if is_international(k) ]
international = [t for t in replacements if is_international(t[0])]
for key, replacement in international:
try:
- #int_values_for_key = [ (get_country_code(k),v) for k,v in values.items() if strip_country_code(k) == key ]
x = [t for t in values.items() if strip_country_code(t[0]) == key]
int_values_for_key = [(get_country_code(t[0]),t[1]) for t in x]
for v in int_values_for_key: