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
7a36ccf1
Commit
7a36ccf1
authored
3 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[mirror] Add support for osx-arm64 architecture (mac m1)
parent
216d9381
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#51306
passed
3 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/devtools/mirror.py
+10
-2
10 additions, 2 deletions
bob/devtools/mirror.py
bob/devtools/scripts/mirror.py
+13
-2
13 additions, 2 deletions
bob/devtools/scripts/mirror.py
with
23 additions
and
4 deletions
bob/devtools/mirror.py
+
10
−
2
View file @
7a36ccf1
...
...
@@ -80,7 +80,7 @@ def get_json(channel, platform, name):
----------
channel : str
Complete channel URL
platform : {
'
linux-64
'
,
'
osx-64
'
,
'
noarch
'
}
platform : {
'
linux-64
'
,
'
osx-64
'
,
'
osx-arm64
'
,
'
noarch
'
}
The platform of interest
name : str
The name of the file to retrieve. If the name ends in
'
.bz2
'
, then it
...
...
@@ -90,11 +90,18 @@ def get_json(channel, platform, name):
-------
repodata : dict
contents of repodata.json
Raises
------
RuntimeError :
If the URL cannot be reached
"""
url
=
channel
+
"
/
"
+
platform
+
"
/
"
+
name
logger
.
debug
(
"
[checking] %s...
"
,
url
)
r
=
requests
.
get
(
url
,
allow_redirects
=
True
,
stream
=
True
)
if
r
.
status_code
==
404
:
raise
RuntimeError
(
"
URL
'
%s
'
does not exist
"
%
url
)
size
=
r
.
headers
.
get
(
"
Content-length
"
,
"
??
"
)
logger
.
info
(
"
[download] %s (%s bytes)...
"
,
url
,
size
)
...
...
@@ -374,7 +381,8 @@ def checksum_packages(repodata, dest_dir, arch, packages):
dest_dir : str
Path leading to local mirror
arch : str
Current architecture being considered (e.g. noarch, linux-64 or osx-64)
Current architecture being considered (e.g. noarch, linux-64, osx-64,
osx-arm64)
packages : list
List of packages that are available locally, by name
...
...
This diff is collapsed.
Click to expand it.
bob/devtools/scripts/mirror.py
+
13
−
2
View file @
7a36ccf1
...
...
@@ -169,7 +169,7 @@ def mirror(
logger
.
warn
(
"
!!!! DRY RUN MODE !!!!
"
)
logger
.
warn
(
"
Nothing will be really mirrored
"
)
DEFAULT_SUBDIRS
=
[
"
noarch
"
,
"
linux-64
"
,
"
osx-64
"
]
DEFAULT_SUBDIRS
=
[
"
noarch
"
,
"
linux-64
"
,
"
osx-64
"
,
"
osx-arm64
"
]
noarch
=
os
.
path
.
join
(
dest_dir
,
"
noarch
"
)
if
not
os
.
path
.
exists
(
noarch
):
# first time
...
...
@@ -188,7 +188,18 @@ def mirror(
for
arch
in
DEFAULT_SUBDIRS
:
remote_repodata
=
get_json
(
channel_url
,
arch
,
"
repodata_from_packages.json.bz2
"
)
try
:
remote_repodata
=
get_json
(
channel_url
,
arch
,
"
repodata_from_packages.json.bz2
"
)
except
RuntimeError
:
# the architecture does not exist?
logger
.
warning
(
"
Architecture %s does not seem to exist at channel %s - ignoring...
"
,
arch
,
channel_url
,
)
continue
# merge all available packages into one single dictionary
remote_package_info
=
{}
...
...
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