Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

actions: install-deb: Implement action to install local Debian packages #220

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

obbardc
Copy link
Member

@obbardc obbardc commented Jun 22, 2020

The install-dpkg action allows local .deb packages to be installed using the apt command, much like the apt action but for local packages rather than for packages retrieved from remote apt repositories.

Resolves: #157
Closes: #165

@obbardc obbardc force-pushed the wip/obbardc/action-apt-local-file branch from 69ff4e0 to e764a9d Compare June 23, 2020 14:34
Copy link
Member

@sjoerdsimons sjoerdsimons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fwiw i like this approach overall :)

actions/apt_file_action.go Outdated Show resolved Hide resolved
actions/apt_file_action.go Outdated Show resolved Hide resolved
actions/apt_file_action.go Outdated Show resolved Hide resolved
actions/apt_file_action.go Outdated Show resolved Hide resolved
@obbardc obbardc force-pushed the wip/obbardc/action-apt-local-file branch from e764a9d to eb4cf97 Compare August 14, 2020 10:38
@obbardc obbardc force-pushed the wip/obbardc/action-apt-local-file branch from eb4cf97 to 2cdd04b Compare July 23, 2021 09:57
@obbardc obbardc force-pushed the wip/obbardc/action-apt-local-file branch from 2cdd04b to 493a65a Compare July 27, 2023 11:04
@obbardc obbardc changed the title actions: apt-file: initial implementation of action to install local debian packages actions: install-dpkg: Implement action to install local Debian packages Jul 27, 2023
@obbardc obbardc self-assigned this Jul 27, 2023
@obbardc obbardc force-pushed the wip/obbardc/action-apt-local-file branch from 493a65a to b38e470 Compare January 10, 2024 14:03
@obbardc obbardc requested review from sjoerdsimons and removed request for sjoerdsimons January 10, 2024 14:04
@obbardc obbardc force-pushed the wip/obbardc/action-apt-local-file branch from b38e470 to c39490e Compare January 10, 2024 14:23
@obbardc obbardc added this to the v1.1.4 milestone Jan 10, 2024
The apt commands will also be used by the install-dpkg wrapper, prepare for
this by abstracting the generic apt commands into a wrapper class. Also
create a wrapper base class to be able to abstract common action commands
into generic functions.

Signed-off-by: Christopher Obbard <[email protected]>
The install-dpkg action allows local .deb packages to be installed using
the apt command, much like the apt action but for local packages rather
than for packages retrieved from remote apt repositories.

Resolves: go-debos#157
Closes: go-debos#165
Signed-off-by: Christopher Obbard <[email protected]>
@obbardc obbardc force-pushed the wip/obbardc/action-apt-local-file branch from c39490e to 487fd18 Compare January 10, 2024 15:19
@@ -41,6 +41,7 @@ Some of the actions provided by debos to customize and produce images are:
* download: download a single file from the internet
* filesystem-deploy: deploy a root filesystem to an image previously created
* image-partition: create an image file, make partitions and format them
* install-dpkg: install packages and their dependencies from local 'deb' files
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

install-dpkg is rather weird for an action that install a .deb using apt :p Why not call it install-deb :)

Dependencies will be satisfied first from the `packages` list (i.e. locally
available packages) and then from the target's configured apt repositories. If
`deps` is set to false, dependencies will not be installed and an error will be
thrown. TODO: check this
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do the TODO :)


- action: install-dpkg
description: Install Debian package from url
origin: bmap-tools-pkg
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no packages listen in this example?


Optional properties:

- origin -- reference to named file or directory. Defaults to recipe directory.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

origin shouldn't be a named file or a directory but an origin (which i think has some documentation elsewhere)

Comment on lines +93 to +94
a := &InstallDpkgAction{Update: true}
return a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
a := &InstallDpkgAction{Update: true}
return a
return &InstallDpkgAction{Update: true}

packages = append(packages, matches...)
}
} else {
packages = append(packages, origin)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if the user passed a Package list?

// check for duplicates after globbing
for j := idx + 1; j < len(packages); j++ {
if packages[j] == pkg {
return fmt.Errorf("duplicate package found: %s", pkg)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not dedup the list rather then erroring out ?

}
}

log.Printf("Installing %s", pkg)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're printing Installing; but there is a bunch of stuff and commands being run before things are actually installed

@fcervigni-EP
Copy link

Hi.

As info, is this PR on-hold, or about to be integrated ?

Thanks in advance for the info.

@obbardc obbardc changed the title actions: install-dpkg: Implement action to install local Debian packages actions: install-deb: Implement action to install local Debian packages Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Review required
Development

Successfully merging this pull request may close these issues.

Add a new action to install a debian package
3 participants