From 036a2502689092bb278b929f6e8ef2a119c1cf35 Mon Sep 17 00:00:00 2001 From: Robert Yang Date: Thu, 23 Aug 2012 23:13:25 +0800 Subject: archiver.bbclass: remove the "upper()" function The configuration value from the conf file is lower case, e.g. srpm, tar, so there is no reason to use the upper case which makes things complicated. [YOCTO #2619] Signed-off-by: Robert Yang Signed-off-by: Saul Wold --- meta/classes/package_rpm.bbclass | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'meta/classes/package_rpm.bbclass') diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass index b999c28a9b..d44ab4c693 100644 --- a/meta/classes/package_rpm.bbclass +++ b/meta/classes/package_rpm.bbclass @@ -570,19 +570,19 @@ python write_specfile () { # append information for logs and patches to %prep def add_prep(d,spec_files_bottom): - if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) and d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True).upper() == 'SRPM': + if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) == 'srpm': spec_files_bottom.append('%%prep -n %s' % d.getVar('PN', True) ) spec_files_bottom.append('%s' % "echo \"include logs and patches, Please check them in SOURCES\"") spec_files_bottom.append('') # get the name of tarball for sources, patches and logs def get_tarballs(d): - if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) and d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True).upper() == 'SRPM': + if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) == 'srpm': return get_package(d) # append the name of tarball to key word 'SOURCE' in xxx.spec. def tail_source(d,source_list=[],patch_list=None): - if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) and d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True).upper() == 'SRPM': + if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) == 'srpm': source_number = 0 patch_number = 0 workdir = d.getVar('WORKDIR', True) @@ -1020,7 +1020,7 @@ python write_specfile () { python do_package_rpm () { def creat_srpm_dir(d): - if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) and d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True).upper() == 'SRPM': + if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) == 'srpm': clean_licenses = get_licenses(d) pkgwritesrpmdir = bb.data.expand('${PKGWRITEDIRSRPM}/${PACKAGE_ARCH_EXTEND}', d) pkgwritesrpmdir = pkgwritesrpmdir + '/' + clean_licenses @@ -1147,14 +1147,14 @@ python do_package_rpm () { cmd = cmd + " --define 'debug_package %{nil}'" cmd = cmd + " --define '_rpmfc_magic_path " + magicfile + "'" cmd = cmd + " --define '_tmppath " + workdir + "'" - if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) and d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True).upper() == 'SRPM': + if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) == 'srpm': cmd = cmd + " --define '_sourcedir " + workdir + "'" cmdsrpm = cmd + " --define '_srcrpmdir " + creat_srpm_dir(d) + "'" cmdsrpm = cmdsrpm + " -bs " + outspecfile cmd = cmd + " -bb " + outspecfile # Build the source rpm package ! - if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) and d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True).upper() == 'SRPM': + if d.getVar('SOURCE_ARCHIVE_PACKAGE_TYPE', True) == 'srpm': d.setVar('SBUILDSPEC', cmdsrpm + "\n") d.setVarFlag('SBUILDSPEC', 'func', '1') bb.build.exec_func('SBUILDSPEC', d) -- cgit v1.2.3