Re: [Gnewsense-dev] Debderiver: purging

2012-03-13 Thread Stayvoid
Sam,

 It should do the same for supplementary suites. It's pretty much the
 same code, with a different codename...
According to your pseudocode example, it should be something like this:

for suppl_suite in dist.suppl_suites:
command = ['-T', 'dsc', 'listfilter', dist.codename,
   '($Source (==' + suppl_suite.codename +
   '), $Version (% *' + self._op_sys.name.lower() +
   '*))']

But I'm not sure.
The whole picture is missing from me. I understand the small parts,
but I can't make them work together.

Could you split this task to several subtasks?

___
gNewSense-dev mailing list
gNewSense-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/gnewsense-dev


Re: [Gnewsense-dev] Debderiver: purging

2012-03-06 Thread Sam Geeraerts

(Subject was getting a bit long in the tooth; specified.)

Stayvoid wrote:

You're on the right track. The class needs a purge_list. Some hints:

- in _purge_purge_lists you should loop over the supplementary suites;

I've got stuck again. I need more information.


First some background info: look up distribution and suite in the 
Debian glossary [1]. Reprepro considers each suite separately. 
Debderiver ties subsuites a.k.a. supplementary suites (e.g. 
parkes-security) to a main suite a.k.a. distribution (e.g. parkes).



Should it loop over dist.suppl_suites?


Yes.


What should it do with those? Could you provide an example in pseudocode?


Currently, _purge_purge_lists loops over all packages that should be 
excluded (for each distribution), checks whether there's a gNS version 
of it (which we want to keep) and, if not, delete the package.


It should do the same for supplementary suites. It's pretty much the 
same code, with a different codename, so:


for dist...:
for src_pkg...:
... # existing code
for every supplementar suite:
# Check
command = ...codename...
if not...:
self._do...


Could you show me the output of _do2? I've read some docs on
subprocess, but it's unclear to me.


subprocess.Popen runs a shell command. _do2 just returns what reprepro 
would output to the shell when you run the command, e.g.:


$ reprepro -b base/ -T dsc listfilter parkes '($Source (==apt))'
parkes|main|source: apt 0.8.10.3+squeeze1


What is the purpose of ($Source (==iceweasel), $Version (%
*gnewsense*)) (_purge_purge_lists function)? This syntax looks
strange. I suppose it has something to do with the execution of
reprepro, but I'm not sure.


Read reprepro's man page. The listfilter subcommand lists all packages 
that satisfy the conditions: source package name equals iceweasel, 
version contains 'gnewsense'.



# TODO: add pocket name for supplementary suites (short term).
# TODO: give each suite its own description (long term).
# TODO: replace this function with _do2, i.e. use subprocess instead of
# os.system.

Could you comment on these TODOs?
What is the pocket name?


It's the second part of the suite name, e.g. 'security' for 
parkes-security. Check Ubuntu's glossary (URL in README).



What does description mean?


Check the Description fields in distribution Release files (e.g. below 
[2]) and conf/distributions in reprepro's man page. Currently, 
debderiver gives all suites the same description, the top level one in 
the config file. Distributions and suites should have their own 
descriptions (either independent from the top level one, or as a suffix 
to the parent level, e.g. os - 'gNewSense', dist - 'Parkes', suite - 
'security updates').



Should I replace every _do call with _do2 or it will be enough to
replace os.system with subprocess in _do?


Replace _do with _do2.

[1] http://wiki.debian.org/Glossary
[2] http://ftp.debian.org/debian/dists/

___
gNewSense-dev mailing list
gNewSense-dev@nongnu.org
https://lists.nongnu.org/mailman/listinfo/gnewsense-dev