Commit faa906a9 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

Merge branch 'erp5'

parents 90c309fe f0153580
......@@ -25,10 +25,10 @@ download-only = true
[mariadb]
recipe = hexagonit.recipe.cmmi
version = 5.5.29
version = 5.5.30
revision = 1
url = http://downloads.askmonty.org/f/mariadb-${:version}/kvm-tarbake-jaunty-x86/mariadb-${:version}.tar.gz/from/http://ftp.osuosl.org/pub/mariadb
md5sum = 643cca7f07f7b00ca3ae1515e6f245d6
md5sum = 39d4da4dabc8bda012517b3587dee6f8
# compile directory is required to build mysql plugins.
keep-compile-dir = true
patch-options = -p0
......
......@@ -3,6 +3,7 @@ parts =
rpm2cpio
[rpm2cpio]
# https://github.com/ruda/rpm2cpio
recipe = slapos.recipe.build:download
url = https://raw.github.com/ruda/rpm2cpio/e196173f1f6b746463b7398e381b94a42edfa345/rpm2cpio.py
url = ${:_profile_base_location_}/${:_buildout_section_name_}
md5sum = c5bb6227d99e1ff5df880f997cbed2e3
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Standalone RPM to CPIO converter
# Copyright (c) 2012 Rudá Moura
#
'''Extract cpio archive from RPM package.
rpm2cpio converts the RPM on standard input or first parameter to a CPIO archive on standard output.
Usage:
rpm2cpio < adjtimex-1.20-2.1.i386.rpm | cpio -it
./sbin/adjtimex
./usr/share/doc/adjtimex-1.20
./usr/share/doc/adjtimex-1.20/COPYING
./usr/share/doc/adjtimex-1.20/COPYRIGHT
./usr/share/doc/adjtimex-1.20/README
./usr/share/man/man8/adjtimex.8.gz
133 blocks
'''
import sys
import StringIO
import gzip
RPM_MAGIC = '\xed\xab\xee\xdb'
GZIP_MAGIC = '\x1f\x8b'
def rpm2cpio(stream_in=sys.stdin, stream_out=sys.stdout):
lead = stream_in.read(96)
if lead[0:4] != RPM_MAGIC:
raise IOError, 'the input is not a RPM package'
data = stream_in.read()
idx = data.find(GZIP_MAGIC)
if idx == -1:
raise IOError, 'could not find compressed cpio archive'
gzstream = StringIO.StringIO(data[idx:])
gzipper = gzip.GzipFile(fileobj=gzstream)
data = gzipper.read()
stream_out.write(data)
if __name__ == '__main__':
if sys.argv[1:]:
try:
fin = open(sys.argv[1])
rpm2cpio(fin)
fin.close()
except IOError, e:
print 'Error:', sys.argv[1], e
else:
try:
rpm2cpio()
except IOError, e:
print 'Error:', e
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment