Page MenuHomePhabricator

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

Description

Related code:

https://github.com/Whonix/genmkfile/blob/254f9ea2527e846dd9430e6f4700878419b86c8b/usr/share/genmkfile/make-helper.bsh#L368-L388

Parsing debian/control files. For example:

https://github.com/Whonix/sdwdate/blob/master/debian/control#L18

the end result should be:

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

and

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?

Details

Impact
Normal

Event Timeline

Patrick created this task.Mar 6 2017, 5:31 PM
olemd added a subscriber: olemd.Mar 7 2017, 8:38 AM
olemd added a comment.Mar 7 2017, 10:47 PM

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 http://unix.stackexchange.com/a/215919/11930 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.

olemd added a comment.Mar 8 2017, 12:11 PM

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.)

Done:

https://github.com/Whonix/genmkfile/commit/8d17a9d7c74f565a81707e703f318b9c98528c6b

Patrick closed this task as Resolved.Mar 5 2018, 9:14 PM
Patrick claimed this task.