Skip to content

Commit

Permalink
Merge pull request #195 from epics-containers/RTEMS
Browse files Browse the repository at this point in the history
Final fixes for RTEMS changes
  • Loading branch information
gilesknap authored Mar 25, 2024
2 parents 03015d9 + 470e3e1 commit 4ed56e1
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 71 deletions.
50 changes: 0 additions & 50 deletions .devcontainer/devcontainer.json

This file was deleted.

18 changes: 0 additions & 18 deletions .devcontainer/local_build.sh

This file was deleted.

4 changes: 3 additions & 1 deletion src/ibek/ioc_cmds/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ def extract_assets(
GLOBALS.PVI_DEFS,
GLOBALS.IBEK_DEFS,
IOC_FOLDER, # get the IOC folder symlink
Path.readlink(IOC_FOLDER), # get contents of IOC folder
Path.readlink(
IOC_FOLDER
).parent, # get contents of IOC folder and its source (parent)
Path("/venv"), # get the virtualenv
] + list(
source.glob("ibek*")
Expand Down
3 changes: 3 additions & 0 deletions src/ibek/ioc_cmds/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ def generate_schema(
log.error("One or more `definitions` required with `--no-ibek-defs`")
raise typer.Exit(1)

definitions = definitions or []

if ibek_defs:
# this allows us to use the definitions inside the container
# which are in a known location after the container is built
Expand Down Expand Up @@ -108,4 +110,5 @@ def extract_runtime_assets(
This should be performed in a throw away container stage (runtime_prep)
as it is destructive of the source folder, because it uses move for speed.
"""
extras = extras or []
extract_assets(destination, source, extras, defaults, dry_run)
24 changes: 22 additions & 2 deletions src/ibek/support_cmds/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,15 @@ def _install_debs(debs: List[str]) -> None:
If they have an http:// or https://
prefix then they will be downloaded and installed from file.
args: debs: List[str] - list of debian packages to install - can also include
any additional 'apt-get install' options required
"""
temp = Path("/tmp")
for i, pkg in enumerate(debs):
if pkg.startswith("http://") or pkg.startswith("https://"):
pkg_file = temp / pkg.split("/")[-1]
subprocess.call(["wget", pkg, "-O", str(pkg_file)])
subprocess.call(["busybox", "wget", pkg, "-O", str(pkg_file)])
debs[i] = str(pkg_file)

if len(debs) == 0:
Expand All @@ -86,11 +89,18 @@ def _install_debs(debs: List[str]) -> None:

@support_cli.command()
def apt_install(
debs: List[str] = typer.Argument(None, help="list of debian packages to install"),
debs: List[str] = typer.Argument(
None,
help=(
"list of debian packages to install. Also may include any "
"additional 'apt-get install' options required"
),
),
):
"""
Install packages
"""
debs = debs or []
_install_debs(debs)


Expand All @@ -100,7 +110,10 @@ def add_runtime_packages(
):
"""
Add packages to RUNTIME_DEBS for later install with apt_install_runtime_packages
The list may include any additional 'apt-get install' options required.
"""
debs = debs or []
add_list_to_file(RUNTIME_DEBS, debs)


Expand Down Expand Up @@ -137,6 +150,9 @@ def git_clone(
):
"""
clone a support module from a remote repository
Add any additional arguments to the git clone command at the end of the
argument list.
"""
url = org + repo_name
location = SUPPORT / repo_name
Expand Down Expand Up @@ -191,6 +207,7 @@ def add_libs(
"""
declare the libraries for this support module for inclusion in IOC Makefile
"""
libs = libs or []
add_list_to_file(IOC_LIBS, libs)


Expand All @@ -201,6 +218,7 @@ def add_dbds(
"""
declare the dbd files for this support module for inclusion in IOC Makefile
"""
dbds = dbds or []
add_list_to_file(IOC_DBDS, dbds)


Expand Down Expand Up @@ -258,6 +276,8 @@ def compile(
):
"""
compile a support module after preparation with `ibek support register` etc.
Add any extra compiler options to the end of the argument list
"""
path = SUPPORT / module

Expand Down

0 comments on commit 4ed56e1

Please sign in to comment.