[Rpm-metadata] createrepo patch to optionally use /usr/bin/file to detect rpms
Florian La Roche
laroche at redhat.com
Mon Sep 11 12:29:58 UTC 2006
On Mon, Sep 11, 2006 at 08:06:50AM -0400, Jay Soffian wrote:
> I have a repository of RPMs whose names do not contain an .rpm
> extension, but that I still need to index with createrepo.
>
> I put together a quick patch that allows genpkgmetadata to optionally
> call out to /usr/bin/file to examine any files it encounters that
> don't have the normal .rpm extension (files which do have .rpm are
> assumed to be rpms and are not passed to /usr/bin/file).
>
> This behavior is optional and is enabled with -m or --magic.
>
> Requires a version of /usr/bin/file that supports -f (files-from), -i
> (mime output) and -b (brief mode). Lightly tested on RHEL AS 3.
>
> I seem to recall that Python has a module which provides similar
> functionality to /usr/bin/file but it's not jumping out at me right
> now and this patch took all of 15 minutes.
Maybe adding an option to read the filelist from a new file or
stdin would also be a good idea? Then you can script whatever you
want to outside of createrepo.
regards,
Florian La Roche
More information about the Rpm-metadata
mailing list