|
|
Created:
7 years, 7 months ago by solb Modified:
7 years, 6 months ago CC:
chromium-reviews Base URL:
https://chromium.googlesource.com/chromium/src.git@master Visibility:
Public. |
DescriptionChange detection method for checking package name changes
The return status of apt-cache show doesn't actually indicate whether a package has any candidates, so we now call grep on apt-cache pkgnames to determine this.
BUG=244473
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=203000
Patch Set 1 #
Total comments: 1
Patch Set 2 : #
Total comments: 4
Patch Set 3 : #Patch Set 4 : Rebased against upstream #Messages
Total messages: 14 (0 generated)
This patch was necessary before I was able to install the build dependencies on my precise Goobuntu system.
Paweł, could you take a look please as well? https://codereview.chromium.org/15741015/diff/1/build/install-build-deps.sh File build/install-build-deps.sh (right): https://codereview.chromium.org/15741015/diff/1/build/install-build-deps.sh#n... build/install-build-deps.sh:127: | grep "Candidate: (none)" >/dev/null 2>&1 ); then I don't know if this will work for non-English locales. Have a look in /etc/bash-completion.d/apt and see how they test for available package names. For example, the apt-cache "pkgnames" option looks promising. Also, consider encapsulating the test into a Bash function, instead of repeating the code 5 times.
On 2013/05/28 18:26:58, Lambros wrote: > Paweł, could you take a look please as well? > > https://codereview.chromium.org/15741015/diff/1/build/install-build-deps.sh > File build/install-build-deps.sh (right): > > https://codereview.chromium.org/15741015/diff/1/build/install-build-deps.sh#n... > build/install-build-deps.sh:127: | grep "Candidate: (none)" >/dev/null 2>&1 ); > then > I don't know if this will work for non-English locales. > > Have a look in /etc/bash-completion.d/apt and see how they test for available > package names. For example, the apt-cache "pkgnames" option looks promising. > > Also, consider encapsulating the test into a Bash function, instead of repeating > the code 5 times. Good point, and thanks for suggesting Bash completion. It looks like they use something like: $ apt-cache --no-generate pkgnames | grep -x $pkgname
On 2013/05/28 18:41:48, solb wrote: > On 2013/05/28 18:26:58, Lambros wrote: > > Paweł, could you take a look please as well? > > > > https://codereview.chromium.org/15741015/diff/1/build/install-build-deps.sh > > File build/install-build-deps.sh (right): > > > > > https://codereview.chromium.org/15741015/diff/1/build/install-build-deps.sh#n... > > build/install-build-deps.sh:127: | grep "Candidate: (none)" >/dev/null 2>&1 ); > > then > > I don't know if this will work for non-English locales. > > > > Have a look in /etc/bash-completion.d/apt and see how they test for available > > package names. For example, the apt-cache "pkgnames" option looks promising. > > > > Also, consider encapsulating the test into a Bash function, instead of > repeating > > the code 5 times. > > Good point, and thanks for suggesting Bash completion. It looks like they use > something like: > $ apt-cache --no-generate pkgnames | grep -x $pkgname I updated the script to use the aforementioned mechanism instead.
Also note following change: https://chromiumcodereview.appspot.com/15911004 https://codereview.chromium.org/15741015/diff/6001/build/install-build-deps.sh File build/install-build-deps.sh (right): https://codereview.chromium.org/15741015/diff/6001/build/install-build-deps.s... build/install-build-deps.sh:26: satisfiable() { nit: Let's change the name from very generic to one of (more suggestions welcome): - is_package_dependency_satisfiable - has_package - is_package_installable - is_package_available - package_exists https://codereview.chromium.org/15741015/diff/6001/build/install-build-deps.s... build/install-build-deps.sh:27: apt-cache --no-generate pkgnames | grep -x $1 > /dev/null 2>&1 Why --no-generate? Just asking for better understanding, and possibly worth a comment.
Looks fine, but I'll defer to Pawel for final LG. https://codereview.chromium.org/15741015/diff/6001/build/install-build-deps.sh File build/install-build-deps.sh (right): https://codereview.chromium.org/15741015/diff/6001/build/install-build-deps.s... build/install-build-deps.sh:26: satisfiable() { On 2013/05/28 19:06:27, Paweł Hajdan Jr. wrote: > nit: Let's change the name from very generic to one of (more suggestions > welcome): +1 on renaming https://codereview.chromium.org/15741015/diff/6001/build/install-build-deps.s... build/install-build-deps.sh:27: apt-cache --no-generate pkgnames | grep -x $1 > /dev/null 2>&1 style nit: "$1". We prefer to quote variables, even though it makes no difference in this case.
On 2013/05/28 19:09:54, Lambros wrote: > Looks fine, but I'll defer to Pawel for final LG. > > https://codereview.chromium.org/15741015/diff/6001/build/install-build-deps.sh > File build/install-build-deps.sh (right): > > https://codereview.chromium.org/15741015/diff/6001/build/install-build-deps.s... > build/install-build-deps.sh:26: satisfiable() { > On 2013/05/28 19:06:27, Paweł Hajdan Jr. wrote: > > nit: Let's change the name from very generic to one of (more suggestions > > welcome): > +1 on renaming > > https://codereview.chromium.org/15741015/diff/6001/build/install-build-deps.s... > build/install-build-deps.sh:27: apt-cache --no-generate pkgnames | grep -x $1 > > /dev/null 2>&1 > style nit: "$1". We prefer to quote variables, even though it makes no > difference in this case. I made the requested name/style changes and removed the --no-generate flag. (I originally included the latter because it was used by bash-completion to speed up execution of the command; however, time confirms that the difference is on the order of magnitude of 0.01 s for subsequent executions after the cache has already been regenerated once.)
On 2013/05/28 20:20:33, solb wrote: > On 2013/05/28 19:09:54, Lambros wrote: > > Looks fine, but I'll defer to Pawel for final LG. > > > > https://codereview.chromium.org/15741015/diff/6001/build/install-build-deps.sh > > File build/install-build-deps.sh (right): > > > > > https://codereview.chromium.org/15741015/diff/6001/build/install-build-deps.s... > > build/install-build-deps.sh:26: satisfiable() { > > On 2013/05/28 19:06:27, Paweł Hajdan Jr. wrote: > > > nit: Let's change the name from very generic to one of (more suggestions > > > welcome): > > +1 on renaming > > > > > https://codereview.chromium.org/15741015/diff/6001/build/install-build-deps.s... > > build/install-build-deps.sh:27: apt-cache --no-generate pkgnames | grep -x $1 > > > > /dev/null 2>&1 > > style nit: "$1". We prefer to quote variables, even though it makes no > > difference in this case. > > I made the requested name/style changes and removed the --no-generate flag. (I > originally included the latter because it was used by bash-completion to speed > up execution of the command; however, time confirms that the difference is on > the order of magnitude of 0.01 s for subsequent executions after the cache has > already been regenerated once.) I rebased this against upstream; if it looks okay, could someone commit it for me?
On 2013/05/28 21:02:06, solb wrote: > On 2013/05/28 20:20:33, solb wrote: > > On 2013/05/28 19:09:54, Lambros wrote: > > > Looks fine, but I'll defer to Pawel for final LG. > > > > > > > https://codereview.chromium.org/15741015/diff/6001/build/install-build-deps.sh > > > File build/install-build-deps.sh (right): > > > > > > > > > https://codereview.chromium.org/15741015/diff/6001/build/install-build-deps.s... > > > build/install-build-deps.sh:26: satisfiable() { > > > On 2013/05/28 19:06:27, Paweł Hajdan Jr. wrote: > > > > nit: Let's change the name from very generic to one of (more suggestions > > > > welcome): > > > +1 on renaming > > > > > > > > > https://codereview.chromium.org/15741015/diff/6001/build/install-build-deps.s... > > > build/install-build-deps.sh:27: apt-cache --no-generate pkgnames | grep -x > $1 > > > > > > /dev/null 2>&1 > > > style nit: "$1". We prefer to quote variables, even though it makes no > > > difference in this case. > > > > I made the requested name/style changes and removed the --no-generate flag. > (I > > originally included the latter because it was used by bash-completion to speed > > up execution of the command; however, time confirms that the difference is on > > the order of magnitude of 0.01 s for subsequent executions after the cache has > > already been regenerated once.) > > I rebased this against upstream; if it looks okay, could someone commit it for > me? Pawel, any objection to landing this?
LGTM
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/solb@chromium.org/15741015/14001
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/solb@chromium.org/15741015/14001
Message was sent while issue was closed.
Change committed as 203000 |