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

tree won't be installed #1

Open
janpieper opened this issue Oct 6, 2017 · 0 comments
Open

tree won't be installed #1

janpieper opened this issue Oct 6, 2017 · 0 comments

Comments

@janpieper
Copy link
Owner

There are some other packages that contain tree in their name, so the function to detect if a package is installed (see below) doesn't work as expected...

Function

package_installed() {
  dpkg --list | grep "\b$1\b" &> /dev/null
}

Changing ^$1$ to \b$1\b doesn't feel better because some of my packages that needs to be installed (e.g. vim) aren't spelled as in the package manager or doesn't exist. Maybe I need to change this.

Example

$ dpkg -l | grep "\btree\b"
ii  libhtml-tree-perl                          5.03-2                                       all          Perl module to represent and create HTML syntax trees
ii  libxml-twig-perl                           1:3.48-1                                     all          Perl module for processing huge XML documents in tree mode
ii  tree                                       1.7.0-3                                      amd64        displays an indented directory tree, in color
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant