[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#742318: apt: version 'amd64' has bad syntax



On Sat, 22 Mar 2014, david@kalnischkies.de wrote:
>
> Control: merge 741962 -1
> Control: tags -1 + pending
> Control: found -1 0.9.16
> Control: notfound -1 0.9.15.5
>
> On Sat, Mar 22, 2014 at 10:34:17AM +0100, Cristian Ionescu-Idbohrn wrote:
> > /etc/kernel/postinst.d/apt-auto-removal is run when installing a new
> > linux-image package.  A package list is generated at some point, and
> > version numbers extracted:
> […]
>
> Correct analyse and patch, thanks!
>
> I have commited yesterday a slightly different fix though which removes
> the star from the initial matcher to get to the same behaviour – which
> was also the behaviour before 0.9.16 as shell glob vs regex.

Sounds good.

May I suggest a replacement for:

list="$(${DPKG} -l | awk '/^ii[ ]+(linux|kfreebsd|gnumach)-image-[0-9]/ && $2 !~ /-dbg$/ { print $2 }' | sed -e 's#\(linux\|kfreebsd\|gnumach\)-image-##')"

Either of these:

list=$($DPKG -l | sed -rne '/^ii[[:blank:]]+((linux|kfreebsd|gnumach)-image-([0-9][^[:blank:]]+))[[:blank:]].*/{s//\3/;/-dbg$/d;p}')
list=$($DPKG -l | sed -ne '/^ii[[:blank:]]\+\(\(linux\|kfreebsd\|gnumach\)-image-\([0-9][^[:blank:]]\+\)\)[[:blank:]].*/{s//\3/;/-dbg$/d;p}')

remove the need of forking `awk'.


Cheers,

-- 
Cristian


Reply to: