[vlc-commits] pkg-rewrite-absolute.py: use OrderedDict for variables

Alexandre Janniaux git at videolan.org
Wed Mar 11 14:27:35 CET 2020


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Wed Mar 11 14:20:00 2020 +0100| [8943620b856fbc838147026d5190e949e6314c48] | committer: Marvin Scholz

pkg-rewrite-absolute.py: use OrderedDict for variables

Otherwise we can end up with .pc files having variables being used
before being declared, which is not supported by old pkg-config
executables. For example, on libplacebo.pc, with the (in)correct version
of python, it was ending up with:

libdir=${prefix}/lib
prefix=/foo

Refs videolan/vlc-android#1213

Signed-off-by: Marvin Scholz <epirat07 at gmail.com>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8943620b856fbc838147026d5190e949e6314c48
---

 contrib/src/pkg-rewrite-absolute.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/contrib/src/pkg-rewrite-absolute.py b/contrib/src/pkg-rewrite-absolute.py
index 8b7967c93c..4441f3f4eb 100755
--- a/contrib/src/pkg-rewrite-absolute.py
+++ b/contrib/src/pkg-rewrite-absolute.py
@@ -1,13 +1,14 @@
 #!/usr/bin/env python3
 import os, sys, argparse
+from collections import OrderedDict
 
 class PkgConfigFile():
     """Representation of a pkg-config file (.pc)"""
 
-    pc_variables = {}
-    pc_variables_expanded = {}
+    pc_variables = OrderedDict()
+    pc_variables_expanded = OrderedDict()
 
-    pc_keywords = {}
+    pc_keywords = OrderedDict()
 
     def __init__(self, file):
         for line in file:



More information about the vlc-commits mailing list