Commit 2bcdb6ae authored by Rafaël Carré's avatar Rafaël Carré Committed by Tristan Matthews

pkg-static.sh: also merge Requires.private with Requires

(cherry-picked from vlc commit d2c6b81287fc01b5afea049a87b9280f5cb59522)

Change-Id: I113248aae5114021a19db15fe009a711fa46e720
parent 0c584b1d
......@@ -4,26 +4,35 @@
if test -z "$1" || test -n "$2"; then
echo "Usage: $0 <file.pc>" >&2
echo "Merges the pkg-config Libs.private stanza into Libs stanza." >&2
echo "Merges the pkg-config {Requires/Libs}.private stanza into {Requires/Libs} stanzas." >&2
exit 1
fi
exec <"$1" >"$1.tmp" || exit $?
PUBLIC=""
PRIVATE=""
LIBS_PUBLIC=""
LIBS_PRIVATE=""
REQUIRES_PUBLIC=""
REQUIRES_PRIVATE=""
while read LINE; do
pub="${LINE#Libs:}"
priv="${LINE#Libs.private:}"
if test "$pub" != "$LINE"; then
PUBLIC="$pub"
elif test "$priv" != "$LINE"; then
PRIVATE="$priv"
lpub="${LINE#Libs:}"
lpriv="${LINE#Libs.private:}"
rpub="${LINE#Requires:}"
rpriv="${LINE#Requires.private:}"
if test "$lpub" != "$LINE"; then
LIBS_PUBLIC="$lpub"
elif test "$lpriv" != "$LINE"; then
LIBS_PRIVATE="$lpriv"
elif test "$rpub" != "$LINE"; then
REQUIRES_PUBLIC="$rpub"
elif test "$rpriv" != "$LINE"; then
REQUIRES_PRIVATE="$rpriv"
else
echo "$LINE"
fi
done
echo "Libs: $PUBLIC $PRIVATE"
echo "Libs: $LIBS_PUBLIC $LIBS_PRIVATE"
echo "Requires: $REQUIRES_PUBLIC $REQUIRES_PRIVATE"
mv -f -- "$1.tmp" "$1"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment