Add sys/meson.py --nosudo (use sudo by default)

This commit is contained in:
pancake 2018-08-01 03:12:33 +02:00
parent 0043a7c1e2
commit 0d6647e4f0
2 changed files with 7 additions and 3 deletions

View file

@ -17,7 +17,6 @@ int sdb_js0n(const ut8 *js, RangstrType len, RangstrType *out) {
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
#pragma GCC diagnostic ignored "-Wpragmas"
#pragma GCC diagnostic ignored "-Winitializer-overrides"
#pragma GCC diagnostic ignored "-Woverride-init"
#define HAVE_RAWSTR 0
#define PUSH(i) if(depth == 1) prev = *out++ = ((cur+i) - js)

View file

@ -253,6 +253,8 @@ def main():
help='Adds support for Windows XP')
parser.add_argument('--pull', action='store_true',
help='git pull before building')
parser.add_argument('--nosudo', action='store_true',
help='Do not use sudo for install/symstall/uninstall')
parser.add_argument('--uninstall', action='store_true',
help='Uninstall')
parser.add_argument('--symstall', action='store_true',
@ -307,15 +309,18 @@ def main():
PATH_FMT.update(R2_PATH)
sudo = 'sudo '
if args.nosudo:
sudo = ''
# Build it!
log.debug('Arguments: %s', args)
build(args)
if args.uninstall:
os.system('make uninstall PWD="$PWD/build" BTOP="$PWD/build/binr"')
os.system(sudo + 'make uninstall PWD="$PWD/build" BTOP="$PWD/build/binr"')
if args.install:
install(args)
if args.symstall:
os.system('make symstall PWD="$PWD/build" BTOP="$PWD/build/binr"')
os.system(sudo + 'make symstall PWD="$PWD/build" BTOP="$PWD/build/binr"')
if __name__ == '__main__':
main()