Server IP : 172.16.15.8 / Your IP : 3.16.76.102 Web Server : Apache System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.2.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /lib/rpm/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
#!/usr/libexec/platform-python # -*- coding:utf-8 -*- # # Copyright (C) 2017 Björn Esser <besser82@fedoraproject.org> # # based on cmake.prov, which is # Copyright (C) 2015 Daniel Vrátil <dvratil@redhat.com> # Copyright (C) 2017 Daniel Vrátil <dvratil@fedoraproject.org> # # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Library General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this program; if not, write to the # Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # import sys import re import subprocess class CMakeParser: def __init__(self, filelist = None): if filelist == None: filelist = sys.stdin has_module = False is_arched = False isa_suf = subprocess.check_output(["/usr/bin/rpm", "-E %{?_isa}"]).decode().strip() paths = map(lambda x: x.rstrip(), filelist.readlines()) for path in paths: modulePath, cmakeModule, lowercase = self.parseCmakeModuleConfig(path) if modulePath and cmakeModule: has_module = True if re.match(".*/usr/lib(64)?/cmake/.*", modulePath): is_arched = True if has_module: if is_arched: print("cmake-filesystem%s" % isa_suf) else: print("cmake-filesystem") def parseCmakeModuleConfig(self, configFile): paths = configFile.rsplit("/", 3) modulePath = "%s/cmake/%s" % (paths[0], paths[2]) cfgFile = paths[3] if cfgFile.endswith("Config.cmake"): return (modulePath, cfgFile[0:-len("Config.cmake")], False) elif cfgFile.endswith("-config.cmake"): return (modulePath, cfgFile[0:-len("-config.cmake")], True) else: return (None, None, False) if __name__ == "__main__": parser = CMakeParser()