[opensuse-project] [gsoc] osc2 client - summary of week 5
![](https://seccdn.libravatar.org/avatar/8f947802c8278f7de589d948d49d1c97.jpg?s=120&d=mm&r=g)
Hi, here's a small summary of the 5th (coding) week. Last week I spent most of my time with working on the cpio module. Finally I ended up with a complete rewrite of osc's "old" cpio module. The cpio implementation details are taken from the cpio 2.11 package. Currently only the "new ascii" format is supported and we can only handle regular files (this is sufficient for our needs). Here's a small example how to use it: # cpio_open is just a convenience method for CpioArchive(filename=fname) with cpio_open(fname) as archive: for archive_file in archive: # print filename print archive_file.hdr.name # print contents print archive_file.read() It's also possible to pass a file-like object to a CpioArchive instance (in this case we do not need to use the with statement). Also it can be "easily" enhanced to support different cpio formats (one just have to write the specific ArchiveReader and ArchiveWriter classes:) ). The code is available at [1] and the testcases at [2]. Todo for this week: * finish the build module * start with working on the package fetching code Marcus [1] https://github.com/openSUSE/osc2/blob/master/osc/util/cpio.py [2] https://github.com/openSUSE/osc2/blob/master/test/util/test_cpio.py -- To unsubscribe, e-mail: opensuse-project+unsubscribe@opensuse.org To contact the owner, email: opensuse-project+owner@opensuse.org
participants (1)
-
Marcus Hüwe