-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
apt.install should install dependencies when directly installing .deb files #10107
Comments
This would require adding |
If using
|
I like it! After my previous post, I started to dig through |
Addendum: the parsing in step 1 should also consider the Pre-Depends line - it contains dependencies which must be configured before installation. For testing, you can use any package with unsatisfied dependencies from the standard repos, obtained with |
I think these edits would resolve this, but I want to get someone in IRC to talk about it first (and freenode is under attack... again). https://github.com/tedski/salt/compare/10107 Instead of worrying about Pre-Depends and Depends differences and having to write a control file parser -- parsing the Depends line would be a bit of work -- I just use the Comments welcome. |
This looks fairly good. After the first call to cmd.run, I would add a second call with |
Also, you probably want to pass |
Awesome, good catches. Updating now. |
I've updated that branch, refresh the comparison link above. I added the marking as auto and some better error handling. |
Line 1552, |
Right on. Let me take care of testing now. |
I'm having some issues with lint and I think they can be safely ignored. However, I'd like to check with the dev team before I use |
Ted, be sure that you're using the pylintrc provided with the Salt There are a couple of comments to disable pylint here and there throughout -mp On Mon, Feb 3, 2014 at 8:00 AM, Ted Strzalkowski
|
@cachedout the lint issues were raised by Jenkins here: http://jenkins.saltstack.com/job/salt-pr-lint/825/violations/file/salt/modules/apt.py/ I'd appreciate any input you can give on if I'm doing things correctly with the intra-module import there. |
I think the problem is that you are trying to import a module which has the same name as the current module. If this code works as expected, it might be one of those rare cases where disabling pylint is the correct thing to do. |
Yeah. I talked with @s0undt3ch on IRC and he guided me in the right direction. I'll need to rename salt.modules.apt.py to handle this so I can properly import the dist-package |
Per @s0undt3ch 's advice, I've renamed the apt module to apt_mod (it's renamed via virtual dunder) to allow me to import python-apt. |
Wouldn't it be more descriptive to rename to |
Once again, thanks for the good idea, @tweenk I rebased my fork and it's now apt_pkg. |
It hit me that I'm not covering the case where there are no missing dependencies. #10183 fixes that. I also renamed |
@tedski I see some of your PRs got merged. Do you still want this issue open or shall we go ahead and close it? |
I think we've satisfied the requests in this issue. We should close this one. Any other features can be request in a future issue and prioritized accordingly. |
Super! Thanks for all your help here, @tedski. Much appreciated. |
It appears that this does not handle dependencies recursively, just the immediate dependencies of the .deb file. |
@moloney - it does. The .deb file has dependencies satisfied from the repositories by apt-get. There is no need to recursively evaluate dependencies since apt-get will do that for you. |
Let's say I have a state file like this:
This will fail if some dependencies of package.deb are not already installed on the target system. As a result, a lot of unnecessary boilerplate is needed to install the dependencies first, and they won't be reported as no longer needed when some-package is removed.
apt.install should call
apt-get install -fy
after installing the package to resolve dependencies.The text was updated successfully, but these errors were encountered: