Bug#514656: pbuilder: does not handle comments in debian/control correctly

Junichi Uekawa dancer at netfort.gr.jp
Wed Feb 11 02:24:15 UTC 2009


Hi,

I didn't realize there was a comment character in debian/control.
Interesting.


At Mon, 9 Feb 2009 23:03:31 +0100,
Adeodato Simó wrote:
> 
> Package: pbuilder
> Version: 0.185
> Severity: important
> Tags: patch
> 
> Hello,
> 
> I don't use pbuilder myself, but a user who tried to build one of my
> packages reported this problem to me, and after inspection I think it is
> a bug in pbuilder.
> 
> The involved package is amule, which used to have a debian/control in
> the form of:
> 
> -8<-
> Source: amule
> ...
> Build-Depends: 
>  autotools-dev,
>  debhelper,
>  quilt,
>  ##
>  libwxgtk2.8-dev,
>  etc
> -8<-
> 
> With this, pbuilder died for this user with:
> 
>   dpkg-deb: parse error, in file
>   `/tmp/satisfydepends-aptitude/pbuilder-satisfydepends-dummy/DEBIAN/control'
>   near line 7 package `pbuilder-satisfydepends-dummy':
>   `Depends' field, invalid package name `##': must start with an alphanumeric
> 
> It was pointed out to me that such use of the '#' character in
> debian/control is not correct: according to deb-control(5), comments
> are allowed, but the hash character must not be preceded by whitespaced.
> Hence, I fixed my debian/control to read:
> 
> -8<-
> Source: amule
> ...
> Build-Depends: 
>  autotools-dev,
>  debhelper,
>  quilt,
> ##
>  libwxgtk2.8-dev,
>  etc
> -8<-
> 
> But the error persisted. I would say that it's get_control_re() fault,
> that does not support comments. Adding this to that function should
> work:
> 
>     cat "$control" |
>         awk '
>         BEGIN { source=1 }
>         /^$/ { source=0 }
>         /^Source:/ { source=1 }
>         /^[^ ]*:/ { p=0 }
> +       /^#/ { next }
>         tolower($0) ~ /^'"$re"':/ { p=1 }
>         { if (p && source) { print $0 } }' |
>         sed 's/^[^: ]*://'
> 

Looks okay to me.






More information about the Pbuilder-maint mailing list