-
Notifications
You must be signed in to change notification settings - Fork 139
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
base: main
Are you sure you want to change the base?
Conversation
69ff4e0
to
e764a9d
Compare
There was a problem hiding this 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 :)
e764a9d
to
eb4cf97
Compare
eb4cf97
to
2cdd04b
Compare
2cdd04b
to
493a65a
Compare
493a65a
to
b38e470
Compare
b38e470
to
c39490e
Compare
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]>
c39490e
to
487fd18
Compare
@@ -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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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)
a := &InstallDpkgAction{Update: true} | ||
return a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a := &InstallDpkgAction{Update: true} | |
return a | |
return &InstallDpkgAction{Update: true} |
packages = append(packages, matches...) | ||
} | ||
} else { | ||
packages = append(packages, origin) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
Hi. As info, is this PR on-hold, or about to be integrated ? Thanks in advance for the info. |
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