git » kde5-pkgbuilds.git » main » tree

[main] / orderize.py

#!/usr/bin/env python3

import os
import sys

fnordered = "order"
fnmess = "built-order"

def arrf(fn):
    with open(fn, 'r') as f:
         return [ l.strip() for l in f.readlines() ]

order = arrf(fnordered)
mess = arrf(fnmess)
neworder = []

for l in mess:
    if l in order:
        continue
    order.append(l)
    neworder.append(l)

print('\n'.join(neworder))