Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
G
git-repo
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux-tools
git-repo
Commits
aa8d35a5
Commit
aa8d35a5
authored
Apr 09, 2013
by
Matthias Putz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reenabled selfupdate (also on sync)
parent
17cad9d4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
5 deletions
+64
-5
portable.py
portable.py
+0
-1
selfupdate.py
subcmds/selfupdate.py
+62
-0
sync.py
subcmds/sync.py
+2
-4
No files found.
portable.py
View file @
aa8d35a5
...
...
@@ -12,7 +12,6 @@ import stat
from
repo_trace
import
REPO_TRACE
,
IsTrace
,
Trace
SYNC_REPO_PROGRAM
=
False
SUBPROCESSES
=
[]
def
terminateHandle
(
signal
,
frame
):
...
...
subcmds/selfupdate.py
0 → 100644
View file @
aa8d35a5
#
# Copyright (C) 2009 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from
__future__
import
print_function
from
optparse
import
SUPPRESS_HELP
import
sys
from
command
import
Command
,
MirrorSafeCommand
from
subcmds.sync
import
_PostRepoUpgrade
from
subcmds.sync
import
_PostRepoFetch
class
Selfupdate
(
Command
,
MirrorSafeCommand
):
common
=
False
helpSummary
=
"Update repo to the latest version"
helpUsage
=
"""
%
prog
"""
helpDescription
=
"""
The '
%
prog' command upgrades repo to the latest version, if a
newer version is available.
Normally this is done automatically by 'repo sync' and does not
need to be performed by an end-user.
"""
def
_Options
(
self
,
p
):
g
=
p
.
add_option_group
(
'repo Version options'
)
g
.
add_option
(
'--no-repo-verify'
,
dest
=
'no_repo_verify'
,
action
=
'store_true'
,
help
=
'do not verify repo source code'
)
g
.
add_option
(
'--repo-upgraded'
,
dest
=
'repo_upgraded'
,
action
=
'store_true'
,
help
=
SUPPRESS_HELP
)
def
Execute
(
self
,
opt
,
args
):
rp
=
self
.
manifest
.
repoProject
rp
.
PreSync
()
if
opt
.
repo_upgraded
:
_PostRepoUpgrade
(
self
.
manifest
)
else
:
if
not
rp
.
Sync_NetworkHalf
():
print
(
"error: can't update repo"
,
file
=
sys
.
stderr
)
sys
.
exit
(
1
)
rp
.
bare_git
.
gc
(
'--auto'
)
_PostRepoFetch
(
rp
,
no_repo_verify
=
opt
.
no_repo_verify
,
verbose
=
True
)
subcmds/sync.py
View file @
aa8d35a5
...
...
@@ -584,15 +584,13 @@ later is required to fix a server side protocol bug.
if
not
opt
.
local_only
:
to_fetch
=
[]
now
=
time
.
time
()
if
portable
.
SYNC_REPO_PROGRAM
and
_ONE_DAY_S
<=
(
now
-
rp
.
LastFetch
):
if
_ONE_DAY_S
<=
(
now
-
rp
.
LastFetch
):
to_fetch
.
append
(
rp
)
to_fetch
.
extend
(
all_projects
)
to_fetch
.
sort
(
key
=
self
.
_fetch_times
.
Get
,
reverse
=
True
)
fetched
=
self
.
_Fetch
(
to_fetch
,
opt
)
if
portable
.
SYNC_REPO_PROGRAM
:
_PostRepoFetch
(
rp
,
opt
.
no_repo_verify
)
_PostRepoFetch
(
rp
,
opt
.
no_repo_verify
)
if
opt
.
network_only
:
# bail out now; the rest touches the working tree
...
...
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