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
04e25a1b
Commit
04e25a1b
authored
Aug 22, 2000
by
Greg Ward
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure destination directory exists before trying to create a tarball
or ZIP file.
parent
72b93ec1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
Lib/distutils/archive_util.py
Lib/distutils/archive_util.py
+4
-2
No files found.
Lib/distutils/archive_util.py
View file @
04e25a1b
...
...
@@ -10,7 +10,7 @@ __revision__ = "$Id$"
import
os
from
distutils.errors
import
DistutilsExecError
from
distutils.spawn
import
spawn
from
distutils.dir_util
import
mkpath
def
make_tarball
(
base_name
,
base_dir
,
compress
=
"gzip"
,
verbose
=
0
,
dry_run
=
0
):
...
...
@@ -42,6 +42,7 @@ def make_tarball (base_name, base_dir, compress="gzip",
"bad value for 'compress': must be None, 'gzip', or 'compress'"
archive_name
=
base_name
+
".tar"
mkpath
(
os
.
path
.
dirname
(
archive_name
),
verbose
=
verbose
,
dry_run
=
dry_run
)
cmd
=
[
"tar"
,
"-cf"
,
archive_name
,
base_dir
]
spawn
(
cmd
,
verbose
=
verbose
,
dry_run
=
dry_run
)
...
...
@@ -68,6 +69,7 @@ def make_zipfile (base_name, base_dir, verbose=0, dry_run=0):
# no changes needed!
zip_filename
=
base_name
+
".zip"
mkpath
(
os
.
path
.
dirname
(
zip_filename
),
verbose
=
verbose
,
dry_run
=
dry_run
)
try
:
spawn
([
"zip"
,
"-rq"
,
zip_filename
,
base_dir
],
verbose
=
verbose
,
dry_run
=
dry_run
)
...
...
@@ -114,7 +116,7 @@ ARCHIVE_FORMATS = {
'bztar'
:
(
make_tarball
,
[(
'compress'
,
'bzip2'
)],
"bzip2'ed tar-file"
),
'ztar'
:
(
make_tarball
,
[(
'compress'
,
'compress'
)],
"compressed tar file"
),
'tar'
:
(
make_tarball
,
[(
'compress'
,
None
)],
"uncompressed tar file"
),
'zip'
:
(
make_zipfile
,
[],
"
zip-
file"
)
'zip'
:
(
make_zipfile
,
[],
"
ZIP
file"
)
}
def
check_archive_formats
(
formats
):
...
...
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