Page MenuHomePhabricator

fix debian/control parsing - make_deb_build_dependencies / make_deb_runtime_dependencies
Closed, ResolvedPublic


Related code:

Parsing debian/control files. For example:

the end result should be:

make_deb_build_dependencies="debhelper genmkfile ruby-ronn dh-systemd dh-apparmor"


make_deb_runtime_dependencies="sudo logrotate bc ruby ruby-inline ruby-dev ruby-all-dev gcc libc6-dev python3-dateutil python3-gevent  python3-socks python3-guimessages python3 tor"

Does that make sense?



Event Timeline

Apparently debian control-files aren't ment to be parsed, or something. My google-fu seems to be stronger than my multiline-regexp-fu, so this seems like a workable solution.

perl -ne 'next if /^#/; $p=(s/^Build-Depends:\s*/ / or (/^ / and $p)); s/,|\n|\([^)]+\)//mg; print if $p' < debian/control

for Build-Depends and

perl -ne 'next if /^#/; $p=(s/^Depends:\s*/ / or (/^ / and $p)); s/,|\n|\([^)]+\)//mg; print if $p'  < debian/control | sed 's/${.*}//' | tr -d '|'

for runtime depends.

I had a quick look at python3-debian as well, but it seems more geared towards doing things with ready-made .debs and already installed packages.

This certainly isn't very pretty, but it does work.

This helps a lot. I almost have a working solution.

I'm sure I could whip up a pull-request as well if you'd like.

Patrick changed the task status from Open to Review.Mar 8 2017, 3:34 PM
Patrick added a project: Whonix 14.

Next time, that would be welcome.

This time I did not know you'd like to do that and was already done implementing it. (Just needed to sort out attribution.)


Patrick claimed this task.