From 9172a2bb60163fa7b0d880f458689e6c27463725 Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Mon, 8 May 2006 17:31:14 +0000 Subject: [PATCH] Basit unpack araci. --- tools/unpisi | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 tools/unpisi diff --git a/tools/unpisi b/tools/unpisi new file mode 100755 index 00000000..e48700e4 --- /dev/null +++ b/tools/unpisi @@ -0,0 +1,40 @@ +#!/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 + +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..") + + arc = ArchiveZip(sys.argv[1], 'zip', 'r') + 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())