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
16aebf77
Kaydet (Commit)
16aebf77
authored
Kas 22, 2002
tarafından
Just van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added --link-exec option: make a symlink for the executable only, copy all other files.
üst
224405fc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
4 deletions
+20
-4
bundlebuilder.py
Mac/Lib/bundlebuilder.py
+20
-4
No files found.
Mac/Lib/bundlebuilder.py
Dosyayı görüntüle @
16aebf77
...
...
@@ -212,16 +212,18 @@ class AppBuilder(BundleBuilder):
it will simply be used as the main executable.
nibname: The name of the main nib, for Cocoa apps. Defaults
to None, but must be specified when building a Cocoa app.
symlink_exec: Symlink the executable instead of copying it.
For the other keyword arguments see the BundleBuilder doc string.
"""
def
__init__
(
self
,
name
=
None
,
mainprogram
=
None
,
executable
=
None
,
nibname
=
None
,
**
kwargs
):
nibname
=
None
,
symlink_exec
=
0
,
**
kwargs
):
"""See the class doc string for a description of the arguments."""
self
.
mainprogram
=
mainprogram
self
.
executable
=
executable
self
.
nibname
=
nibname
self
.
symlink_exec
=
symlink_exec
BundleBuilder
.
__init__
(
self
,
name
=
name
,
**
kwargs
)
def
setup
(
self
):
...
...
@@ -254,7 +256,10 @@ class AppBuilder(BundleBuilder):
execpath
=
pathjoin
(
self
.
execdir
,
self
.
name
)
else
:
execpath
=
pathjoin
(
resdir
,
os
.
path
.
basename
(
self
.
executable
))
self
.
files
.
append
((
self
.
executable
,
execpath
))
if
not
self
.
symlink_exec
:
self
.
files
.
append
((
self
.
executable
,
execpath
))
else
:
self
.
execpath
=
execpath
# For execve wrapper
setexecutable
=
setExecutableTemplate
%
os
.
path
.
basename
(
self
.
executable
)
else
:
...
...
@@ -272,6 +277,14 @@ class AppBuilder(BundleBuilder):
open
(
mainwrapperpath
,
"w"
)
.
write
(
mainWrapperTemplate
%
locals
())
os
.
chmod
(
mainwrapperpath
,
0777
)
def
postProcess
(
self
):
if
self
.
symlink_exec
and
self
.
executable
:
self
.
message
(
"Symlinking executable
%
s to
%
s"
%
(
self
.
executable
,
self
.
execpath
),
2
)
dst
=
pathjoin
(
self
.
bundlepath
,
self
.
execpath
)
makedirs
(
os
.
path
.
dirname
(
dst
))
os
.
symlink
(
os
.
path
.
abspath
(
self
.
executable
),
dst
)
def
copy
(
src
,
dst
,
mkdirs
=
0
):
"""Copy a file or a directory."""
...
...
@@ -329,6 +342,7 @@ Options:
--nib=NAME main nib name
-c, --creator=CCCC 4-char creator code (default: '????')
-l, --link symlink files/folder instead of copying them
--link-exec symlink the executable instead of copying it
-v, --verbose increase verbosity level
-q, --quiet decrease verbosity level
-h, --help print this message
...
...
@@ -346,8 +360,8 @@ def main(builder=None):
shortopts
=
"b:n:r:e:m:c:plhvq"
longopts
=
(
"builddir="
,
"name="
,
"resource="
,
"executable="
,
"mainprogram="
,
"creator="
,
"nib="
,
"plist="
,
"link"
,
"help"
,
"verbose"
,
"quiet"
)
"mainprogram="
,
"creator="
,
"nib="
,
"plist="
,
"link"
,
"
link-exec"
,
"help"
,
"
verbose"
,
"quiet"
)
try
:
options
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
shortopts
,
longopts
)
...
...
@@ -373,6 +387,8 @@ def main(builder=None):
builder
.
plist
=
Plist
.
fromFile
(
arg
)
elif
opt
in
(
'-l'
,
'--link'
):
builder
.
symlink
=
1
elif
opt
==
'--link-exec'
:
builder
.
symlink_exec
=
1
elif
opt
in
(
'-h'
,
'--help'
):
usage
()
elif
opt
in
(
'-v'
,
'--verbose'
):
...
...
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