nit pick:
I don't like the added new lines. I much prefer:
if some-condition; then
to
if some-condition
the
In simply testing 'need_packages_installed()', it doesn't seem to work at all
for me.
$ cat need-installed
#!/bin/sh
need_packages_installed() {
dpkg-query -f '${Version}\n' --show $pkgs | grep -q '^$'
}
need_packages_installed "$@"
$ ./need-installed fooobooo && echo y || echo n
n
$ ./need-installed grep
n
$ ./need-installed cloud-init
n
This seems to work for me though:
filter_installed_packages() {
LC_ALL=C dpkg-query --show --showformat='${Version}' "$@" 2>&1 |
sed -n '/^No packages/ { s/^.* //; s/[.]$//; p; }'
}
$ filter_installed_packages grep
$ filter_installed_packages cloud-init
cloud-init
$ filter_installed_packages cloud-init grep bzip2 python
cloud-init
Regarding removal of 'apt-get update'.....
really, any time you install apckages you should apt-get update. So i'm not
sure what i think about that.
$ need_packages_installed grep
$ need_packages_installed cloud-init
--
https://code.launchpad.net/~jtv/orchestra/odev-without-apt-get-update/+merge/96515
Your team orchestra is requested to review the proposed merge of
lp:~jtv/orchestra/odev-without-apt-get-update into lp:~orchestra/orchestra/odev.
--
Mailing list: https://launchpad.net/~orchestra
Post to : [email protected]
Unsubscribe : https://launchpad.net/~orchestra
More help : https://help.launchpad.net/ListHelp