summaryrefslogtreecommitdiffstats
path: root/yocto-poky/meta/lib/oeqa/utils/ftools.py
diff options
context:
space:
mode:
Diffstat (limited to 'yocto-poky/meta/lib/oeqa/utils/ftools.py')
-rw-r--r--yocto-poky/meta/lib/oeqa/utils/ftools.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/yocto-poky/meta/lib/oeqa/utils/ftools.py b/yocto-poky/meta/lib/oeqa/utils/ftools.py
index 1bd9a30a4..a7233d4ca 100644
--- a/yocto-poky/meta/lib/oeqa/utils/ftools.py
+++ b/yocto-poky/meta/lib/oeqa/utils/ftools.py
@@ -36,10 +36,11 @@ def remove_from_file(path, data):
return
else:
raise
- lines = rdata.splitlines()
- rmdata = data.strip().splitlines()
- for l in rmdata:
- for c in range(0, lines.count(l)):
- i = lines.index(l)
- del(lines[i])
- write_file(path, "\n".join(lines))
+
+ contents = rdata.strip().splitlines()
+ for r in data.strip().splitlines():
+ try:
+ contents.remove(r)
+ except ValueError:
+ pass
+ write_file(path, "\n".join(contents))
OpenPOWER on IntegriCloud