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
d0e4b42e
Kaydet (Commit)
d0e4b42e
authored
Eyl 10, 2000
tarafından
Greg Ward
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added --python and --fix-python options for better control over what
interpreter the .spec file refers to. Cosmetic tweaks.
üst
4826a894
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
16 deletions
+33
-16
bdist_rpm.py
Lib/distutils/command/bdist_rpm.py
+33
-16
No files found.
Lib/distutils/command/bdist_rpm.py
Dosyayı görüntüle @
d0e4b42e
...
...
@@ -7,7 +7,7 @@ distributions)."""
__revision__
=
"$Id$"
import
os
,
string
import
sys
,
os
,
string
import
glob
from
types
import
*
from
distutils.core
import
Command
,
DEBUG
...
...
@@ -28,6 +28,12 @@ class bdist_rpm (Command):
(
'dist-dir='
,
'd'
,
"directory to put final RPM files in "
"(and .spec files if --spec-only)"
),
(
'python='
,
None
,
"path to Python interpreter to hard-code in the .spec file "
"(default:
\"
python
\"
)"
),
(
'fix-python'
,
None
,
"hard-code the exact path to the current Python interpreter in "
"the .spec file"
),
(
'spec-only'
,
None
,
"only regenerate spec file"
),
(
'source-only'
,
None
,
...
...
@@ -114,6 +120,8 @@ class bdist_rpm (Command):
self
.
bdist_base
=
None
self
.
rpm_base
=
None
self
.
dist_dir
=
None
self
.
python
=
None
self
.
fix_python
=
None
self
.
spec_only
=
None
self
.
binary_only
=
None
self
.
source_only
=
None
...
...
@@ -159,6 +167,15 @@ class bdist_rpm (Command):
"you must specify --rpm-base in RPM 2 mode"
self
.
rpm_base
=
os
.
path
.
join
(
self
.
bdist_base
,
"rpm"
)
if
self
.
python
is
None
:
if
self
.
fix_python
:
self
.
python
=
sys
.
executable
else
:
self
.
python
=
"python"
elif
self
.
fix_python
:
raise
DistutilsOptionError
,
\
"--python and --fix-python are mutually exclusive options"
if
os
.
name
!=
'posix'
:
raise
DistutilsPlatformError
,
\
(
"don't know how to create RPM "
...
...
@@ -275,21 +292,21 @@ class bdist_rpm (Command):
# build package
self
.
announce
(
'
B
uilding RPMs'
)
rpm_
args
=
[
'rpm'
,
]
self
.
announce
(
'
b
uilding RPMs'
)
rpm_
cmd
=
[
'rpm'
]
if
self
.
source_only
:
# what kind of RPMs?
rpm_
args
.
append
(
'-bs'
)
rpm_
cmd
.
append
(
'-bs'
)
elif
self
.
binary_only
:
rpm_
args
.
append
(
'-bb'
)
rpm_
cmd
.
append
(
'-bb'
)
else
:
rpm_
args
.
append
(
'-ba'
)
rpm_
cmd
.
append
(
'-ba'
)
if
self
.
rpm3_mode
:
rpm_
args
.
extend
([
'--define'
,
rpm_
cmd
.
extend
([
'--define'
,
'_topdir
%
s/
%
s'
%
(
os
.
getcwd
(),
self
.
rpm_base
),])
if
self
.
clean
:
rpm_
args
.
append
(
'--clean'
)
rpm_
args
.
append
(
spec_path
)
self
.
spawn
(
rpm_
args
)
rpm_
cmd
.
append
(
'--clean'
)
rpm_
cmd
.
append
(
spec_path
)
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
...
...
@@ -398,10 +415,10 @@ class bdist_rpm (Command):
# rpm scripts
# figure out default build script
def_build
=
"
%
s setup.py build"
%
self
.
python
if
self
.
use_rpm_opt_flags
:
def_build
=
'env CFLAGS="$RPM_OPT_FLAGS" python setup.py build'
else
:
def_build
=
'python setup.py build'
def_build
=
'env CFLAGS="$RPM_OPT_FLAGS" '
+
def_build
# insert contents of files
# XXX this is kind of misleading: user-supplied options are files
...
...
@@ -412,9 +429,9 @@ class bdist_rpm (Command):
(
'prep'
,
'prep_script'
,
"
%
setup"
),
(
'build'
,
'build_script'
,
def_build
),
(
'install'
,
'install_script'
,
"python
setup.py install "
"--root=$RPM_BUILD_ROOT "
"--record=INSTALLED_FILES"
),
(
"
%
s
setup.py install "
"--root=$RPM_BUILD_ROOT "
"--record=INSTALLED_FILES"
)
%
self
.
python
),
(
'clean'
,
'clean_script'
,
"rm -rf $RPM_BUILD_ROOT"
),
(
'pre'
,
'pre_install'
,
None
),
(
'post'
,
'post_install'
,
None
),
...
...
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