[Rpm-metadata] createrepo patch to optionally use /usr/bin/file to detect rpms

Jay Soffian jay-yum at soffian.org
Mon Sep 11 12:06:50 UTC 2006


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.

j.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: genpkgmetadata-magic.patch
Type: application/octet-stream
Size: 5670 bytes
Desc: not available
Url : http://lists.baseurl.org/pipermail/rpm-metadata/attachments/20060911/ac946d98/attachment.obj 


More information about the Rpm-metadata mailing list