openexr: make architecture independent
[oi-userland.git] / tools / python-resolve-deps
blob61bcc7f3cb848e00a41657c5aa3af138211c32b2
1 #! /usr/bin/sh
4 # This file and its contents are supplied under the terms of the
5 # Common Development and Distribution License ("CDDL"), version 1.0.
6 # You may only use this file in accordance with the terms of version
7 # 1.0 of the CDDL.
9 # A full copy of the text of the CDDL should have accompanied this
10 # source. A copy of the CDDL is also available via the Internet at
11 # http://www.illumos.org/license/CDDL.
15 # Copyright 2022 Marcel Telka
18 # Helper tool to recursively resolve -r/--requirement in list of python
19 # dependencies
21 while read line ; do
22 # some projects specify extra dependencies in form of .[extra] in deps
23 # key instead of using separate extras key
24 extra=${line#.[}
25 extra=${extra%]}
26 if [ ".[$extra]" == "$line" ] ; then
27 # run the command passed in as argument(s) to handle extras
28 eval "$@" $extra
29 continue
32 [ "${line:0:2}" == "-c" ] && continue
33 [ "${line:0:12}" == "--constraint" ] && continue
34 if [ "${line:0:2}" == "-r" ] ; then
35 line=${line:2}
36 while [ "${line:0:1}" == " " ] ; do line=${line:1} ; done
37 dos2unix -ascii $line | $0
38 continue
40 if [ "${line:0:13}" == "--requirement" ] ; then
41 line=${line:14}
42 while [ "${line:0:1}" == " " ] ; do line=${line:1} ; done
43 dos2unix -ascii $line | $0
44 continue
46 echo "$line"
47 done