summaryrefslogtreecommitdiffstats
path: root/data
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2016-05-11 13:51:04 +0000
committerintrigeri <intrigeri@boum.org>2016-05-11 14:22:23 +0000
commit4720253c8662859479db647fb6efbc4d577ebb72 (patch)
tree55c1b6683654ae6ff2ed39fc038f8be09f316ede /data
parent5e06fa66aa90f34c82ae1ff9ccbb617d9ccc008d (diff)
apt-get wrapper: deal with an unlikely corner case.
We know that apt-get's action (install, update, etc.) will come _before_ any package name, so as soon as we see a supported action, we stop looking for one. The only problem left is if apt-get is called with an unsupported action, followed by a package name equal to one of our supported actions. If this were to happen, even though unlikely, then mode=$package and likely the resulting apt-get command-line should be invalid or break the build sooner or later, so I'm not too concerned about this breaking stuff without us noticing immediately.
Diffstat (limited to 'data')
-rwxr-xr-xdata/wrappers/apt-get4
1 files changed, 3 insertions, 1 deletions
diff --git a/data/wrappers/apt-get b/data/wrappers/apt-get
index 6269c66..f6609be 100755
--- a/data/wrappers/apt-get
+++ b/data/wrappers/apt-get
@@ -2,18 +2,20 @@
set -e
set -u
-# XXX: what if a package is called install or source...
mode=unknown
for param in "$@"; do
case "$param" in
install | download | upgrade | dist-upgrade)
mode=binuris
+ break
;;
source)
mode=srcuris
+ break
;;
update | autoclean | autoremove | purge)
mode=noop
+ break
;;
esac
done