Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d4cc04c6
Commit
d4cc04c6
authored
Jun 17, 1996
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test that script name ends in .py.
Cosmetic changes to usage message (refer to "make install" now).
parent
f75f80eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
Tools/freeze/freeze.py
Tools/freeze/freeze.py
+10
-9
No files found.
Tools/freeze/freeze.py
View file @
d4cc04c6
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
# Usage message
# Usage message
usage_msg
=
"""
usage_msg
=
"""
usage: freeze [-p prefix] [-P exec_prefix] [-e extension] script
[module]
...
usage: freeze [-p prefix] [-P exec_prefix] [-e extension] script
.py [module]
...
-p prefix: This is the prefix used when you ran
-p prefix: This is the prefix used when you ran
'Make inclinstall libainstall' in the Python build directory.
'Make inclinstall libainstall' in the Python build directory.
...
@@ -31,7 +31,7 @@ usage: freeze [-p prefix] [-P exec_prefix] [-e extension] script [module] ...
...
@@ -31,7 +31,7 @@ usage: freeze [-p prefix] [-P exec_prefix] [-e extension] script [module] ...
should also have a Setup file describing the .o files.
should also have a Setup file describing the .o files.
More than one -e option may be given.
More than one -e option may be given.
script
:
The Python script to be executed by the resulting binary.
script
.py:
The Python script to be executed by the resulting binary.
It *must* end with a .py suffix!
It *must* end with a .py suffix!
module ...: Additional Python modules (referenced by pathname)
module ...: Additional Python modules (referenced by pathname)
...
@@ -41,11 +41,7 @@ module ...: Additional Python modules (referenced by pathname)
...
@@ -41,11 +41,7 @@ module ...: Additional Python modules (referenced by pathname)
NOTES:
NOTES:
In order to use freeze successfully, you must have built Python and
In order to use freeze successfully, you must have built Python and
installed it. In particular, the following two non-standard make
installed it ("make install").
targets must have been executed:
make inclinstall
make libainstall # Note: 'liba', not 'lib'
The -p and -P options passed into the freeze script must correspond to
The -p and -P options passed into the freeze script must correspond to
the --prefix and --exec-prefix options passed into Python's configure
the --prefix and --exec-prefix options passed into Python's configure
...
@@ -163,6 +159,10 @@ def main():
...
@@ -163,6 +159,10 @@ def main():
if
not
args
:
if
not
args
:
usage
(
'at least one filename argument required'
)
usage
(
'at least one filename argument required'
)
# check that the script name ends in ".py"
if
args
[
0
][
-
3
:]
!=
".py"
:
usage
(
'the script name must have a .py suffix'
)
# check that file arguments exist
# check that file arguments exist
for
arg
in
args
:
for
arg
in
args
:
if
not
os
.
path
.
exists
(
arg
):
if
not
os
.
path
.
exists
(
arg
):
...
@@ -291,9 +291,10 @@ def main():
...
@@ -291,9 +291,10 @@ def main():
# Print usage message and exit
# Print usage message and exit
def
usage
(
msg
=
None
):
def
usage
(
msg
=
None
):
if
msg
:
sys
.
stderr
.
write
(
str
(
msg
)
+
'
\
n
'
)
sys
.
stderr
.
write
(
usage_msg
)
sys
.
stderr
.
write
(
usage_msg
)
# Put the error last since the usage message scrolls off the screen
if
msg
:
sys
.
stderr
.
write
(
'
\
n
Error: '
+
str
(
msg
)
+
'
\
n
'
)
sys
.
exit
(
2
)
sys
.
exit
(
2
)
...
...
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