Andreas Tille pushed to branch experimental at Debian Blends Team / blends

Commits:
4fae955d by Andreas Tille at 2018-03-28T20:25:49+02:00
Use Deb822List to evaluate taskprefix rather than the old error prone method.

- - - - -


1 changed file:

- devtools/tasks_diff


Changes:

=====================================
devtools/tasks_diff
=====================================
--- a/devtools/tasks_diff
+++ b/devtools/tasks_diff
@@ -18,6 +18,11 @@ import argparse
 import subprocess
 from debian import deb822
 
+# I shamelessly copied class Deb822List into a file blends_helper.py to test 
using it here
+# That's so hackish that I do not even commit this - needs further discussion
+from blends_helper import Deb822List
+from debian.deb822 import Deb822
+
 #with this we distinguish the start of automatic entry in the changelog so we
 #can replace the entry if needed
 START_FLAG = "* start of automatic changelog entry *"
@@ -195,16 +200,9 @@ if __name__ == "__main__":
        logger = logging.getLogger(__name__)
 
        #load the taskprefix
-       taskprefix = ""
-       if not args.statusdump and args.compare:
-               command = blend_dev_dir+"blend-get-names metapackageprefix"
-               process = subprocess.Popen(command.split(), 
stdout=subprocess.PIPE)
-               output = process.communicate()[0].strip()
-               if process.returncode != 0:
-                       logger.error(output)
-                       sys.exit(-1)
-               else:
-                       taskprefix = output
+       with open(os.path.join('debian', 'control.stub'), encoding="UTF-8") as 
fp:
+           control_stub = Deb822List(Deb822.iter_paragraphs(fp))
+       taskprefix = control_stub[0]['Source'].split('-', 1)[-1]
 
        if not args.statusdump and not args.compare:
                logger.error("At least -s/--statusdump or -c/--compare argument 
must be provided")



View it on GitLab: 
https://salsa.debian.org/blends-team/blends/commit/4fae955db14aabf3a442a6aeb08a1a62c7aa3935

---
View it on GitLab: 
https://salsa.debian.org/blends-team/blends/commit/4fae955db14aabf3a442a6aeb08a1a62c7aa3935
You're receiving this email because of your account on salsa.debian.org.
_______________________________________________
Blends-commit mailing list
Blends-commit@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/blends-commit

Reply via email to