[arch-projects] [pyalpm][PATCH] Strip comments that aren't at the start from pycman.config
diff -aur pyalpm-0.6.2/pycman/config.py mychanges/pycman/config.py --- pyalpm-0.6.2/pycman/config.py 2013-08-04 13:20:24.000000000 -0600 +++ mychanges/pycman/config.py 2013-09-17 23:07:57.895283250 -0600 @@ -94,6 +94,8 @@ filestack.pop() continue + if line.find(' #') > 0: + line=line[:line.find(' #')].strip() line = line.strip() if len(line) == 0: continue if line[0] == '#':
2013/9/18 Frostyfrog <frostyfrog2@gmail.com>:
diff -aur pyalpm-0.6.2/pycman/config.py mychanges/pycman/config.py --- pyalpm-0.6.2/pycman/config.py 2013-08-04 13:20:24.000000000 -0600 +++ mychanges/pycman/config.py 2013-09-17 23:07:57.895283250 -0600 @@ -94,6 +94,8 @@ filestack.pop() continue
+ if line.find(' #') > 0: + line=line[:line.find(' #')].strip() line = line.strip() if len(line) == 0: continue if line[0] == '#':
I don't understand the purpose of this patch. Can you explain it? Rémy.
On Thu, Sep 19, 2013 at 03:42:24AM +0200, Rémy Oudompheng wrote:
2013/9/18 Frostyfrog <frostyfrog2@gmail.com>:
diff -aur pyalpm-0.6.2/pycman/config.py mychanges/pycman/config.py --- pyalpm-0.6.2/pycman/config.py 2013-08-04 13:20:24.000000000 -0600 +++ mychanges/pycman/config.py 2013-09-17 23:07:57.895283250 -0600 @@ -94,6 +94,8 @@ filestack.pop() continue
+ if line.find(' #') > 0: + line=line[:line.find(' #')].strip() line = line.strip() if len(line) == 0: continue if line[0] == '#':
I don't understand the purpose of this patch. Can you explain it?
I think this is supposed to remove inline comments like: foobar # This is an inline comment. I agree that the commit message should be much more verbose, though. Also, we should rather look for "#" (without the leading space) and we probably also need to take care of escaping/quoting? Do we want this at all?
Rémy.
participants (3)
-
Frostyfrog
-
Lukas Fleischer
-
Rémy Oudompheng