From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id A1C5E138207 for ; Sat, 21 Jul 2012 20:01:58 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1A41FE0748; Sat, 21 Jul 2012 15:41:09 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id DAA54E0748 for ; Sat, 21 Jul 2012 15:41:08 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4BBD41B4115 for ; Sat, 21 Jul 2012 15:41:08 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 144D9E5434 for ; Sat, 21 Jul 2012 15:41:07 +0000 (UTC) From: "Anthony G. Basile" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anthony G. Basile" Message-ID: <1342885256.5090e3d0581d824640b86c7001b97837e22f7aea.blueness@gentoo> Subject: [gentoo-commits] proj/elfix:master commit in: scripts/ X-VCS-Repository: proj/elfix X-VCS-Files: scripts/Makefile.am scripts/pypaxctl X-VCS-Directories: scripts/ X-VCS-Committer: blueness X-VCS-Committer-Name: Anthony G. Basile X-VCS-Revision: 5090e3d0581d824640b86c7001b97837e22f7aea X-VCS-Branch: master Date: Sat, 21 Jul 2012 15:41:07 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 4779a2fc-c455-48cf-b8d2-94f0f189c6c8 X-Archives-Hash: 9c90dca1577d68a332dcf1b838505f7f commit: 5090e3d0581d824640b86c7001b97837e22f7aea Author: Anthony G. Basile gentoo org> AuthorDate: Sat Jul 21 15:40:56 2012 +0000 Commit: Anthony G. Basile gentoo org> CommitDate: Sat Jul 21 15:40:56 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/elfix.git;a=commit;h=5090e3d0 scripts/pypaxctl: frontend to pypax module --- scripts/Makefile.am | 2 +- scripts/pypaxctl | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletions(-) diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 5cbc314..c4eef37 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -1,2 +1,2 @@ dist_sbin_SCRIPTS = revdep-pax -EXTRA_DIST = paxmodule.c setup.py +EXTRA_DIST = paxmodule.c setup.py pypaxctl diff --git a/scripts/pypaxctl b/scripts/pypaxctl new file mode 100755 index 0000000..266a571 --- /dev/null +++ b/scripts/pypaxctl @@ -0,0 +1,48 @@ +#!/usr/bin/env python + +import sys +import getopt +import pax + +def main(): + try: + opts, args = getopt.getopt(sys.argv[1:], 's:g') + except getopt.GetoptError as err: + print(err) + sys.exit(1) + + if len(opts) == 0: + print('Provide either -s xor -g ') + sys.exit(1) + + binary = None + + do_set = 0 + do_get = 0 + + for o, a in opts: + if o == '-s': + #pax.setflags(a, flags) + flags = a + do_set = 1 + elif o == '-g': + #( str_flags, bin_flags ) = pax.getflags(a) + do_get = 1 + + if( (do_set + do_get) != 1 ): + print('Provide either -s xor -g ') + sys.exit(1) + + if( len(args) < 1 ): + print('Provide either -s xor -g ') + sys.exit(1) + + if( do_set == 1 ): + for binary in args: + print('set %s on %s' % (flags,binary)) + else: + for binary in args: + print('get on %s' % binary) + +if __name__ == '__main__': + main()