Re: [ANNOUNCE] debpartial-mirror Alioth project
dann frazier <dannf@debian.org> writes:
> On Wed, Jun 30, 2004 at 04:58:01PM -0300, Otavio Salvador wrote:
>>
>> This can resolved deps, virtual-packages, have regexp filter support,
>> can get files, whole directories, ... so on ;-)
>
> Having obviously not done due-diligence to look for a similar project,
> I wrote something for a similar purpose as a wrapper around debmirror
> a couple weeks ago - here's a brief description.
>
> I can post bits somewhere if anyone is interested.
>
> #
> # bucketbrigade is a rule-based system for creating a subset of a package pool.
> #
> # The bucket.d directory contains a set of executables, each implementing a
> # rule. Each executable receives the current working list of packages on its
> # standard input, does whatever processing is necessary to fulfill its rule,
> # and outputs the result to its standard output.
> #
> # The output of each script can be either binary packages or source packages,
> # or a combination of both. Rules may emit any kind of package (virtual, meta,
> # etc). They may also emit expressions (exim | mail-transport-agent, for
> # example). Just keep in mind that the end of the chain will emit a list
> # of source packages, so you'll need rules to evaluate virtual packages and
> # expressions if you generate them earlier on.
> #
> # As an example, lets take the following rule chain:
> #
> # essential | standard | vimsucks | emacsrules | depends | > pkglist
> #
> # The essential and standard executables would probably just calculate the
> # Essential: yes and Priority: standard package lists, respectively, and
> # write those lists to standard output. They would also pass their standard
> # input unmodified to their standard output, because they don't care about
> # packages added by earlier rules.
> #
> # vimsucks would dump every line on its standard input to its standard output,
> # except for any line that says 'vim'.
> #
> # emacsrules would write its standard input to its standard output, and will
> # tack emacs21 to the end of it (or beginning, order doesn't matter).
> #
> # depends would analyze each package on its standard input,
> # calculate its dependencies, and write the resulting set of packages
> # to its standard output.
> #
This comes close to what I'm experimenting for the debmirror V2
package.
For debmirror V2 a filter is defined as follows:
A filter reads a Packages/Sources file on stdin and outputs the
result to stdout.
When a filter is called the following environment will be set (only
for read-only use):
ORIG_PACKAGES / ORIG_SOURCES:
Orig designates a list of original Packages/Sources file that was used to
start the filter chain. This can be used to pull in previously
filtered packages from the same source, e.g. to complete Depends.
OTHER_PACKAGES / OTHER_SOURCES:
Other designates an original Packages/Sources file from a different
source than this filter chain. This can be used to check if another
source has Packages, e.g. a filter for contrib would get the main
Packages file as other.
EXTRA_PACKAGES / EXTRA_SOURCES:
Extra designates an already filtered Packages/Sources file from a
different source than this filter chain. This can be used to check if
another source requires Packages, e.g. a filter for main would get
the already filtered contrib Packages file as --extra to include
depends for contrib.
I'm also toying with multifilters that handle multiple files at
once. Those would have four extra vars:
IN_PACKAGES / IN_SOURCES: The input files
OUT_PACKAGES / OUT_SOURCES: The out files
If OUT_PACKAGES / OUT_SOURCES has only one entry the output files
would be joined into one.
The reason why I use env variables is that you can easily build new
filters by combining old filters without the need to pass on
commandline options that might need quoting.
Your example filter could look like this:
Dist: main
Filter: zero-filter
Filter: add-essential --orig
Filter: add-standard --orig
Filter: vimsucks
Filter: emacsrules --orig
Filter: add-depends --orig --extra contrib,non-free
or
Dist: main
Filter: myfilter --orig --extra contrib,non-free
with myfilter:
#!/bin/sh
zero-filter | add-essential | add-standard | vimsucks | emacsrules | add-depends
A simple filter looks like this: (vimsucks)
#!/bin/sh
grep-dctrl -P -v vim
MfG
Goswin
Reply to: