sync-available has a syntax error and possibly a bashism
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dctrl-tools |
Fix Released
|
Unknown
|
|||
dctrl-tools (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Intrepid |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Binary package hint: dctrl-tools
There's a syntax error in sync-available:
apollock@
[: 41: Illegal number:
Merging available database in /tmp/apt-
Replacing available packages info, using /tmp/apt-
Information about 24871 package(s) was updated.
apollock@
+ set -e
+ aptcache=
+ [ 0 -ge 1 ]
+ [ -ne 0 ]
[: 1: Illegal number:
+ [ ! -x /usr/bin/apt-cache ]
+ mktemp -t apt-available.
+ tf=/tmp/
+ echo -n Merging available database in /tmp/apt-
Merging available database in /tmp/apt-
+ echo done.
done.
+ dpkg --update-avail /tmp/apt-
Replacing available packages info, using /tmp/apt-
Information about 24871 package(s) was updated.
+ rm /tmp/apt-
I think it's this part:
if [ "$EUID" -ne "0" ]
then
echo "$0: root privileges are required"
exit 1
fi
If you're going to compare these as strings, you should use the == string comparison operator, not the -ne numeric comparison operator.
So your choices are:
if [ -n "$EUID" ] && [ $EUID -ne 0 ]
or
if [ "$EUID" == "0" ]
That said, $EUID seems to be a bash-provided variable, according to the bash man page, but I can't see any mention of dash providing it. That'll be why this syntax error is being exposed in the first place.
Changed in grep-dctrl: | |
status: | Unknown → Fix Committed |
Changed in grep-dctrl: | |
status: | Fix Committed → Fix Released |
Or, better, just replace $EUID with `id -u`
This rather silly bug has gone unfixed since Hardy. Does anyone feel like slipping a fix into Intrepid before final freeze?