diff options
author | dorianpb | 2020-04-21 11:58:43 -0400 |
---|---|---|
committer | dorianpb | 2020-04-21 11:58:43 -0400 |
commit | 9af866f3f0415221a7fd097fa152609e221ab891 (patch) | |
tree | a3b005998608d95da5d6cfdb835f100baf16ba5e | |
parent | 3a18a9addbd2e3c073ff2e1ae1a89abd4022f8b1 (diff) | |
download | aur-9af866f3f0415221a7fd097fa152609e221ab891.tar.gz |
Added arguments and help message
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | PKGBUILD | 6 | ||||
-rw-r--r-- | script.py | 26 | ||||
-rwxr-xr-x | script.sh | 2 |
4 files changed, 31 insertions, 9 deletions
@@ -1,6 +1,6 @@ pkgbase = mcpelauncher-hx-script pkgdesc = A script that downloads ChristopherHX's mcpelauncher fork. Doesn't check for updates, so just run it every once and a while. - pkgver = v1.2 + pkgver = v1.3 pkgrel = 1 url = https://github.com/ChristopherHX/mcpelauncher-manifest arch = any @@ -11,8 +11,8 @@ pkgbase = mcpelauncher-hx-script depends = python source = script.sh source = script.py - sha256sums = 1f13579b702c4ece07253cfa5a96c85a8f27854464ea7c8d127a143c5e215ec6 - sha256sums = 200441f4095266168667ccc405760c9f5a7fb28d0db7f69698b34f2e54d760c0 + sha256sums = ab79172ff9fc5e4e8c72ff9a1fe008e5b8666baa70065fe1d4eb040342bfed87 + sha256sums = 82937b6f0fbf38a899175381a95109adbb18a36a70bdf57579295125c5f4cc5c pkgname = mcpelauncher-hx-script @@ -1,6 +1,6 @@ # Maintainer: dorianpb <dorian.peanut.butter@gmail.com> pkgname='mcpelauncher-hx-script' -pkgver=v1.2 +pkgver=v1.3 pkgrel=1 #epoch= pkgdesc="A script that downloads ChristopherHX's mcpelauncher fork. Doesn't check for updates, so just run it every once and a while." @@ -22,8 +22,8 @@ options=() source=("script.sh" "script.py") noextract=() sha256sums=( - '1f13579b702c4ece07253cfa5a96c85a8f27854464ea7c8d127a143c5e215ec6' - '200441f4095266168667ccc405760c9f5a7fb28d0db7f69698b34f2e54d760c0' + 'ab79172ff9fc5e4e8c72ff9a1fe008e5b8666baa70065fe1d4eb040342bfed87' + '82937b6f0fbf38a899175381a95109adbb18a36a70bdf57579295125c5f4cc5c' ) package() { diff --git a/script.py b/script.py index 2cb4dae110d6..3730fa43d66e 100644 --- a/script.py +++ b/script.py @@ -1,8 +1,30 @@ -import os -pkglist = { +import os, sys +argv = sys.argv[1:] +defpkglist = { "https://aur.archlinux.org/":['lib32-check','lib32-libevdev'], "https://github.com/ChristopherHX/":['mcpelauncher-linux-git','mcpelauncher-ui-git'] } +pkglist = { + "https://aur.archlinux.org/":[], + "https://github.com/ChristopherHX/":[] + } +if "-h" in argv or "--help" in argv: + print("""Downloads and installs packages from ChristopherHX's fork of mcpelauncher-linux and their dependencies. + Use -h or --help to display this message. + If package names are provided as arguments only those packages will be downloaded.""") + sys.exit() +if len(argv) > 0: + for i,arg in enumerate(argv): + for (url,pkgs) in defpkglist.items(): + if arg in pkgs: + pkglist[url] += [arg] + argv[i] = 0 +if len(argv) == 0: + pkglist = defpkglist +for x in argv: + if x: + sys.exit("Unreconized package'" + str(x) + "'") + os.system('mkdir -p /tmp/mcpelauncher-hx') os.chdir("/tmp/mcpelauncher-hx") for (url,pkgs) in pkglist.items(): diff --git a/script.sh b/script.sh index 1f8ed6a5efa9..5c090dcf03a1 100755 --- a/script.sh +++ b/script.sh @@ -1,2 +1,2 @@ #!/bin/bash -python /usr/share/mcpelauncher-hx-script/script.py +python /usr/share/mcpelauncher-hx-script/script.py "$@" |