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

Add package adds uninstalled package as being installed #10

Closed
timstoop opened this issue Oct 28, 2015 · 6 comments
Closed

Add package adds uninstalled package as being installed #10

timstoop opened this issue Oct 28, 2015 · 6 comments
Labels

Comments

@timstoop
Copy link

A copy/paste says more than a thousand words:

vagrant@ceph1:/vagrant$ goss a package vim-tiny
Adding Package to './goss.json':

{
    "vim-tiny": {
        "installed": true,
        "versions": [
            ""
        ]
    }
}

vagrant@ceph1:/vagrant$ dpkg -l vim-tiny 
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                   Version          Architecture     Description
+++-======================-================-================-==================================================
un  vim-tiny               <none>           <none>           (no description available)
vagrant@ceph1:/vagrant$

I'd expect goss a package to recognise when a package is not installed. Or am I missing something?

@timstoop
Copy link
Author

It actually works for packages that have never been installed:

vagrant@ceph1:/vagrant$ goss a package ibritish
Adding Package to './goss.json':

{
    "ibritish": {
        "installed": false
    }
}

vagrant@ceph1:/vagrant$ dpkg -l ibritish
dpkg-query: no packages found matching ibritish
vagrant@ceph1:/vagrant$

@timstoop
Copy link
Author

The validation suffers from the same problem, an uninstalled package is seen as being installed even when it's not.

@aelsabbahy
Copy link
Member

Seems like a misunderstanding on my part on how dpkg-query worked.

I was marking a package as installed/not based on exit status.

I'll change the logic to also check "${state}." I'll also add Debian integration-tests (I've been pushing this off).

Thanks for the copy/paste, very clear.

@aelsabbahy aelsabbahy added the bug label Oct 28, 2015
@timstoop
Copy link
Author

Thanks. Just forked and looking at learning Go to see if I can help with these kind bugs.

aelsabbahy added a commit that referenced this issue Oct 29, 2015
@aelsabbahy aelsabbahy mentioned this issue Oct 29, 2015
@aelsabbahy
Copy link
Member

Fixed in v0.0.10

@aelsabbahy
Copy link
Member

Thanks for the feedback, let me know if you have any other issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants