[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnewsense-dev] Debderiver: _do2, print, length
From: |
Sam Geeraerts |
Subject: |
Re: [Gnewsense-dev] Debderiver: _do2, print, length |
Date: |
Sat, 10 Mar 2012 19:52:15 +0100 |
User-agent: |
Thunderbird 2.0.0.24 (X11/20101029) |
Stayvoid wrote:
diff6vsorig.txt replaces _do with _do2 and removes \
I only took the backslash removal. See below.
diff7vsorig.txt removes print (again)
diff8vsorig.txt fixes length
Both merged.
I have no idea why
subprocess.Popen(['reprepro', '--noskipold', '-Vb',
'/srv/backuppc/repo/debderiver/base', 'processincoming all'])
doesn't work.
['processincoming', 'all'] works.
It took me a while to understand this, but I still don't understand
the cause of the problem.
os.system passes the command string straight to the shell.
subprocess.Popen is a bit more intelligent: it knows about parameters.
More specifically, each list item is a positional parameter in the
shell. E.g. the difference between:
subprocess.Popen(['grep', 'bash', '/etc/passwd']) = grep bash /etc/passwd
subprocess.Popen(['grep', 'bash /etc/passwd']) = grep 'bash /etc/passwd'
Also note the example [1] in Python documentation.
So your change for update and processincoming is correct. The one for
include still uses a single string, which is valid, but it's cleaner and
more consistent to pass a list. The one for removesrc uses '
'.join(...).split(), which are reverse operations of each other.
BTW, both files (orig and sixth ver) output this:
Error parsing /srv/backuppc/repo/debderiver/base/conf/updates, line 1:
Unknown header 'FilterSrcList'!
To ignore unknown fields use --ignore=unknownfield
There have been errors!
I have no time to investigate this, but AFAICT it's only connected with updates.
Most likely your reprepro version is too old.
[1] http://docs.python.org/library/subprocess.html#subprocess.Popen
- [Gnewsense-dev] Debderiver: _do2, print, length, Stayvoid, 2012/03/09
- Re: [Gnewsense-dev] Debderiver: _do2, print, length,
Sam Geeraerts <=
- Re: [Gnewsense-dev] Debderiver: _do2, print, length, Stayvoid, 2012/03/11
- Re: [Gnewsense-dev] Debderiver: _do2, print, length, Karl Goetz, 2012/03/13
- Re: [Gnewsense-dev] Debderiver: _do2, print, length, Stayvoid, 2012/03/13
- Re: [Gnewsense-dev] Debderiver: _do2, print, length, Karl Goetz, 2012/03/13
- Re: [Gnewsense-dev] Debderiver: _do2, print, length, Sam Geeraerts, 2012/03/15