Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.devtools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
bob
bob.devtools
Commits
8885a030
Commit
8885a030
authored
3 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[scripts.mirror] Allow whitelisting to take precedence
parent
c2a129e5
No related branches found
No related tags found
No related merge requests found
Pipeline
#51284
failed
3 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/devtools/scripts/mirror.py
+17
-14
17 additions, 14 deletions
bob/devtools/scripts/mirror.py
with
17 additions
and
14 deletions
bob/devtools/scripts/mirror.py
+
17
−
14
View file @
8885a030
...
...
@@ -199,22 +199,12 @@ def mirror(
local_packages
=
get_local_contents
(
dest_dir
,
arch
)
logger
.
info
(
"
%d packages available in local mirror
"
,
len
(
local_packages
))
# by default, download everything
remote_packages
=
set
(
remote_package_info
.
keys
())
to_download
=
set
(
remote_package_info
.
keys
())
if
blacklist
is
not
None
and
os
.
path
.
exists
(
blacklist
):
globs_to_remove
=
set
(
load_glob_list
(
blacklist
))
else
:
globs_to_remove
=
set
()
# in the remote packages, subset those that need to be downloaded
# according to our own interest
to_download
=
blacklist_filter
(
remote_packages
-
local_packages
,
globs_to_remove
)
if
whitelist
is
not
None
and
os
.
path
.
exists
(
whitelist
):
globs_to_consider
=
set
(
load_glob_list
(
whitelist
))
to_download
=
whitelist_filter
(
to_download
,
globs_to_consider
)
# remove stuff we already downloaded
to_download
-=
local_packages
# if the user passed a cut date, only download packages that are newer
# or at the same date than the proposed date
...
...
@@ -245,6 +235,19 @@ def mirror(
)
to_download
-=
too_old
if
blacklist
is
not
None
and
os
.
path
.
exists
(
blacklist
):
globs_to_remove
=
set
(
load_glob_list
(
blacklist
))
else
:
globs_to_remove
=
set
()
# in the remote packages, subset those that need to be downloaded
# according to our own interest
to_download
=
blacklist_filter
(
to_download
,
globs_to_remove
)
if
whitelist
is
not
None
and
os
.
path
.
exists
(
whitelist
):
globs_to_consider
=
set
(
load_glob_list
(
whitelist
))
to_download
=
whitelist_filter
(
to_download
,
globs_to_consider
)
# in the local packages, subset those that we no longer need, be it
# because they have been removed from the remote repository, or because
# we decided to blacklist them.
...
...
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