Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor Browser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clairehurst
Tor Browser
Commits
e3488f43
Commit
e3488f43
authored
16 years ago
by
Ben Hearsum
Browse files
Options
Downloads
Patches
Plain Diff
bug 455578: make sure upload.py always cleans up after itself. r=ted
parent
123c0075
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
build/upload.py
+24
-18
24 additions, 18 deletions
build/upload.py
with
24 additions
and
18 deletions
build/upload.py
+
24
−
18
View file @
e3488f43
...
...
@@ -162,24 +162,30 @@ def UploadFiles(user, host, path, files, verbose=False, port=None, ssh_key=None,
if
base_path
is
not
None
:
base_path
=
os
.
path
.
abspath
(
base_path
)
remote_files
=
[]
for
file
in
files
:
file
=
os
.
path
.
abspath
(
file
)
if
not
os
.
path
.
isfile
(
file
):
raise
IOError
(
"
File not found: %s
"
%
file
)
# first ensure that path exists remotely
remote_path
=
GetRemotePath
(
path
,
file
,
base_path
)
DoSSHCommand
(
"
mkdir -p
"
+
remote_path
,
user
,
host
,
port
=
port
,
ssh_key
=
ssh_key
)
if
verbose
:
print
"
Uploading
"
+
file
DoSCPFile
(
file
,
remote_path
,
user
,
host
,
port
=
port
,
ssh_key
=
ssh_key
)
remote_files
.
append
(
remote_path
+
'
/
'
+
os
.
path
.
basename
(
file
))
if
post_upload_command
is
not
None
:
if
verbose
:
print
"
Running post-upload command:
"
+
post_upload_command
file_list
=
'"'
+
'"
"'
.
join
(
remote_files
)
+
'"'
DoSSHCommand
(
'
%s
"
%s
"
%s
'
%
(
post_upload_command
,
path
,
file_list
),
user
,
host
,
port
=
port
,
ssh_key
=
ssh_key
)
if
upload_to_temp_dir
:
DoSSHCommand
(
"
rm -rf %s
"
%
path
,
user
,
host
,
port
=
port
,
ssh_key
=
ssh_key
)
try
:
for
file
in
files
:
file
=
os
.
path
.
abspath
(
file
)
if
not
os
.
path
.
isfile
(
file
):
raise
IOError
(
"
File not found: %s
"
%
file
)
# first ensure that path exists remotely
remote_path
=
GetRemotePath
(
path
,
file
,
base_path
)
DoSSHCommand
(
"
mkdir -p
"
+
remote_path
,
user
,
host
,
port
=
port
,
ssh_key
=
ssh_key
)
if
verbose
:
print
"
Uploading
"
+
file
DoSCPFile
(
file
,
remote_path
,
user
,
host
,
port
=
port
,
ssh_key
=
ssh_key
)
remote_files
.
append
(
remote_path
+
'
/
'
+
os
.
path
.
basename
(
file
))
if
post_upload_command
is
not
None
:
if
verbose
:
print
"
Running post-upload command:
"
+
post_upload_command
file_list
=
'"'
+
'"
"'
.
join
(
remote_files
)
+
'"'
DoSSHCommand
(
'
%s
"
%s
"
%s
'
%
(
post_upload_command
,
path
,
file_list
),
user
,
host
,
port
=
port
,
ssh_key
=
ssh_key
)
except
:
print
"
Encountered error while uploading
"
raise
finally
:
if
upload_to_temp_dir
:
DoSSHCommand
(
"
rm -rf %s
"
%
path
,
user
,
host
,
port
=
port
,
ssh_key
=
ssh_key
)
if
verbose
:
print
"
Upload complete
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment