Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
56602a14
Kaydet (Commit)
56602a14
authored
Kas 04, 2006
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Patch #1060577: Extract list of RPM files from spec file in
bdist_rpm
üst
5aafe928
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
25 deletions
+38
-25
bdist_rpm.py
Lib/distutils/command/bdist_rpm.py
+35
-25
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/distutils/command/bdist_rpm.py
Dosyayı görüntüle @
56602a14
...
...
@@ -337,37 +337,47 @@ class bdist_rpm (Command):
if
not
self
.
keep_temp
:
rpm_cmd
.
append
(
'--clean'
)
rpm_cmd
.
append
(
spec_path
)
# Determine the binary rpm names that should be built out of this spec
# file
# Note that some of these may not be really built (if the file
# list is empty)
nvr_string
=
"
%
{name}-
%
{version}-
%
{release}"
src_rpm
=
nvr_string
+
".src.rpm"
non_src_rpm
=
"
%
{arch}/"
+
nvr_string
+
".
%
{arch}.rpm"
q_cmd
=
r"rpm -q --qf '
%
s
%
s\n' --specfile '
%
s'"
%
(
src_rpm
,
non_src_rpm
,
spec_path
)
out
=
os
.
popen
(
q_cmd
)
binary_rpms
=
[]
source_rpm
=
None
while
1
:
line
=
out
.
readline
()
if
not
line
:
break
l
=
string
.
split
(
string
.
strip
(
line
))
assert
(
len
(
l
)
==
2
)
binary_rpms
.
append
(
l
[
1
])
# The source rpm is named after the first entry in the spec file
if
source_rpm
is
None
:
source_rpm
=
l
[
0
]
status
=
out
.
close
()
if
status
:
raise
DistutilsExecError
(
"Failed to execute:
%
s"
%
repr
(
q_cmd
))
self
.
spawn
(
rpm_cmd
)
# XXX this is a nasty hack -- we really should have a proper way to
# find out the names of the RPM files created; also, this assumes
# that RPM creates exactly one source and one binary RPM.
if
not
self
.
dry_run
:
if
not
self
.
binary_only
:
srpms
=
glob
.
glob
(
os
.
path
.
join
(
rpm_dir
[
'SRPMS'
],
"*.rpm"
))
assert
len
(
srpms
)
==
1
,
\
"unexpected number of SRPM files found:
%
s"
%
srpms
dist_file
=
(
'bdist_rpm'
,
'any'
,
self
.
_dist_path
(
srpms
[
0
]))
self
.
distribution
.
dist_files
.
append
(
dist_file
)
self
.
move_file
(
srpms
[
0
],
self
.
dist_dir
)
srpm
=
os
.
path
.
join
(
rpm_dir
[
'SRPMS'
],
source_rpm
)
assert
(
os
.
path
.
exists
(
srpm
))
self
.
move_file
(
srpm
,
self
.
dist_dir
)
if
not
self
.
source_only
:
rpms
=
glob
.
glob
(
os
.
path
.
join
(
rpm_dir
[
'RPMS'
],
"*/*.rpm"
))
debuginfo
=
glob
.
glob
(
os
.
path
.
join
(
rpm_dir
[
'RPMS'
],
"*/*debuginfo*.rpm"
))
if
debuginfo
:
rpms
.
remove
(
debuginfo
[
0
])
assert
len
(
rpms
)
==
1
,
\
"unexpected number of RPM files found:
%
s"
%
rpms
dist_file
=
(
'bdist_rpm'
,
get_python_version
(),
self
.
_dist_path
(
rpms
[
0
]))
self
.
distribution
.
dist_files
.
append
(
dist_file
)
self
.
move_file
(
rpms
[
0
],
self
.
dist_dir
)
if
debuginfo
:
dist_file
=
(
'bdist_rpm'
,
get_python_version
(),
self
.
_dist_path
(
debuginfo
[
0
]))
self
.
move_file
(
debuginfo
[
0
],
self
.
dist_dir
)
for
rpm
in
binary_rpms
:
rpm
=
os
.
path
.
join
(
rpm_dir
[
'RPMS'
],
rpm
)
if
os
.
path
.
exists
(
rpm
):
self
.
move_file
(
rpm
,
self
.
dist_dir
)
# run()
def
_dist_path
(
self
,
path
):
...
...
Misc/NEWS
Dosyayı görüntüle @
56602a14
...
...
@@ -93,6 +93,9 @@ Extension Modules
Library
-------
-
Patch
#
1060577
:
Extract
list
of
RPM
files
from
spec
file
in
bdist_rpm
-
Bug
#
1586613
:
fix
zlib
and
bz2
codecs
' incremental en/decoders.
- Patch #1583880: fix tarfile'
s
problems
with
long
names
and
posix
/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment