On Thursday 16 August 2007 7:50 am, Dr. Peter Poeml wrote:
James,
I have added a get_binary_list() to osc (just checked it into svn).
I also hacked up a "ls --binary" extension to osc (which uses this new method). Not in svn yet.
I am attaching a patch to the script you posted. It uses the new osc function, and I simplified two places where I used two existing functions to pull stuff from the api, and the permissions bitmask fix I mentioned before.
I would like to integrate more stuff into osc, if possible.
It would be nice to be able to get some more metadata from the binary list. It appears that binaries built from projects are listed as <name>.rpm instead of <name>-<version>-<release>.<arch>.rpm. There's no way to tell from the filename alone if it's different from a local copy. An md5sum would solve that problem.
The script as such is not 100% suitable, because it requires some actions to be done as root (chown obsrun, as required by the build service backend). Maybe the download part could be integrated into osc, while the chown business could be deferred to another script... or should osc be run directly by the obsrun user, maybe?
Yeah, there are better solutions to that problem. os.setuid(), for example.
But an interesting part to integrate would be the "get binary" part, from your script -- your agreement provided. What do you think?
I'm thinking of a command to download a binary, one command to download all binaries of a package, and of a command to mirror a project like you do.
Yeah, that would be great.
I am also interested in feedback about friendlyness of using the osc module from external scripts.
It works great, in my experience. This isn't the first script I've written with it. The initialisation isn't as intuitive as it could be, however: conf.get_config() conf.config['apiurl'] = conf.config['scheme'] + '://' + conf.config['apisrv'] conf.config['user'] = conf.config['auth_dict'][conf.config['apisrv']]['user'] conf.init_basicauth(conf.config) It would be nicer if there was one function to call, eg: conf.init(apisrv=None) where the default api server will be used if apisrv is None. Some simple examples in the documentation would help those looking to learn the library as well. -- James Oakley jfunk@funktronics.ca --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org