Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP7:GA
python3.36158
Python-3.0b1-record-rpm.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File Python-3.0b1-record-rpm.patch of Package python3.36158
From 0c9d233db82152bcad63e40fc3ce1dcad4831ef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mcepl@cepl.eu> Date: Wed, 3 Apr 2024 10:29:00 +0200 Subject: [PATCH] implement "--record-rpm" option for distutils installations Patch: Python-3.0b1-record-rpm.patch --- Lib/distutils/command/install.py | 54 +++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py index 0258d3deae9..359e925b5df 100644 --- a/Lib/distutils/command/install.py +++ b/Lib/distutils/command/install.py @@ -131,6 +131,8 @@ class install(Command): ('record=', None, "filename in which to record list of installed files"), + ('record-rpm=', None, + "filename in which to record list of installed files and directories suitable as filelist for rpm"), ] boolean_options = ['compile', 'force', 'skip-build'] @@ -213,6 +215,7 @@ class install(Command): #self.install_info = None self.record = None + self.record_rpm = None # -- Option finalizing methods ------------------------------------- @@ -560,12 +563,61 @@ class install(Command): self.create_path_file() # write list of installed files, if requested. - if self.record: + if self.record or self.record_rpm: outputs = self.get_outputs() if self.root: # strip any package prefix root_len = len(self.root) for counter in range(len(outputs)): outputs[counter] = outputs[counter][root_len:] + if self.record_rpm: # add directories + self.record = self.record_rpm + dirs = [] + # directories to reject: + rejectdirs = [ + '/etc', + '/', + '', + self.prefix, + self.exec_prefix, + self.install_base, + self.install_platbase, + self.install_purelib, + self.install_platlib, + self.install_headers[:len(self.install_headers) - len(self.distribution.get_name()) - 1], + self.install_libbase, + self.install_scripts, + self.install_data, + os.path.join(self.install_data, 'share'), + os.path.join(self.install_data, 'share', 'doc'), + ] + # directories whose childs reject: + rejectdirs2 = [ + os.path.join(self.install_data, 'share', 'man'), + ] + # directories whose grandsons reject: + rejectdirs3 = [ + os.path.join(self.install_data, 'share', 'man'), + os.path.join(self.install_data, 'share', 'locale'), + ] + for counter in range(len(rejectdirs)): + if len(rejectdirs[counter]) > root_len: + rejectdirs[counter] = rejectdirs[counter][root_len:] + for counter in range(len(rejectdirs2)): + if len(rejectdirs2[counter]) > root_len: + rejectdirs2[counter] = rejectdirs2[counter][root_len:] + for counter in range(len(rejectdirs3)): + if len(rejectdirs3[counter]) > root_len: + rejectdirs3[counter] = rejectdirs3[counter][root_len:] + for counter in range(len(outputs)): + directory = os.path.dirname(outputs[counter]) + while directory not in rejectdirs and \ + os.path.dirname(directory) not in rejectdirs2 and \ + os.path.dirname(os.path.dirname(directory)) not in rejectdirs3: + dirname = '%dir ' + directory + if dirname not in dirs: + dirs.append(dirname) + directory = os.path.dirname(directory) + outputs += dirs self.execute(write_file, (self.record, outputs), "writing list of installed files to '%s'" % -- 2.45.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor