47 lines
999 B
Python
Executable File
47 lines
999 B
Python
Executable File
#!/usr/bin/python
|
|
# -*- coding: utf-8 -*-
|
|
#
|
|
# Copyright (C) 2006, TUBITAK/UEKAE
|
|
#
|
|
# This program is free software; you can redistribute it and/or modify it under
|
|
# the terms of the GNU General Public License as published by the Free
|
|
# Software Foundation; either version 2 of the License, or (at your option)
|
|
# any later version.
|
|
#
|
|
# Please read the COPYING file.
|
|
|
|
import sys
|
|
|
|
from pisi.archive import ArchiveZip
|
|
from pisi.zipfileext import BadZipfile
|
|
|
|
def usage(errmsg):
|
|
print """
|
|
Error: %s
|
|
|
|
Usage:
|
|
unpisi PiSi_package.PiSi
|
|
""" % (errmsg)
|
|
|
|
sys.exit(1)
|
|
|
|
def main():
|
|
|
|
if len(sys.argv) < 2:
|
|
usage("PiSi package required..")
|
|
|
|
try:
|
|
arc = ArchiveZip(sys.argv[1], 'zip', 'r')
|
|
except BadZipfile, e:
|
|
print e
|
|
sys.exit(1)
|
|
|
|
arc.unpack_files(['files.xml', 'metadata.xml'], '.')
|
|
arc.unpack_dir_flat('comar','comar')
|
|
arc.unpack_dir_flat('install','.')
|
|
|
|
return 0
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|