summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Bachmann2023-09-23 21:14:22 +0200
committerTobias Bachmann2023-09-23 21:14:22 +0200
commit6f3a35e780e4ca352abcacce92b49d76b9e84fd8 (patch)
tree1773074394e95b7193024e756f2db1cd93546ccb
parent6023a8ac9dcc7f26c769978b667278965bddf2be (diff)
downloadaur-6f3a35e780e4ca352abcacce92b49d76b9e84fd8.tar.gz
Version bump
-rw-r--r--.SRCINFO4
-rwxr-xr-xPKGBUILD4
-rw-r--r--fslinstaller.py23
3 files changed, 19 insertions, 12 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 633bd96ed51a..7c90168a6e77 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,12 +1,12 @@
pkgbase = fsl
pkgdesc = A comprehensive library of analysis tools for FMRI, MRI and DTI brain imaging data
- pkgver = 6.0.7.2
+ pkgver = 6.0.7.3
pkgrel = 1
url = http://www.fmrib.ox.ac.uk/fsl/
arch = x86_64
license = custom
depends = python
source = fslinstaller.py
- sha256sums = 9e8d1b9178a7b29b5a1f5594101a68372d3633c0fa09052f2b96822e6e8483f2
+ sha256sums = 97aa9b7524cc18a28ca658d6cacf9ab017a386d16484e67fed5ebd824d4c5e7f
pkgname = fsl
diff --git a/PKGBUILD b/PKGBUILD
index 3d43ad4338a3..3acc40cd928d 100755
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
# Contributor: fishburn <frankthefishburn@gmail.com>
pkgname=fsl
-pkgver=6.0.7.2
+pkgver=6.0.7.3
pkgrel=1
pkgdesc="A comprehensive library of analysis tools for FMRI, MRI and DTI brain imaging data"
arch=("x86_64")
@@ -11,7 +11,7 @@ license=('custom')
depends=('python')
source=("fslinstaller.py")
-sha256sums=('9e8d1b9178a7b29b5a1f5594101a68372d3633c0fa09052f2b96822e6e8483f2')
+sha256sums=('97aa9b7524cc18a28ca658d6cacf9ab017a386d16484e67fed5ebd824d4c5e7f')
build() {
export TMPFSLDIR="${srcdir}/fsl"
diff --git a/fslinstaller.py b/fslinstaller.py
index 428ffbb16cdf..e2a9acf320a7 100644
--- a/fslinstaller.py
+++ b/fslinstaller.py
@@ -69,7 +69,7 @@ log = logging.getLogger(__name__)
__absfile__ = op.abspath(__file__).rstrip('c')
-__version__ = '3.5.5'
+__version__ = '3.5.7'
"""Installer script version number. This must be updated
whenever a new version of the installer script is released.
"""
@@ -1077,6 +1077,9 @@ class Context(object):
:arg action: Passed to get_admin_password as a prompt.
"""
+ if destdir is not None:
+ destdir = op.abspath(destdir)
+
self.args = args
self.shell = op.basename(os.environ.get('SHELL', 'sh')).lower()
@@ -1298,13 +1301,13 @@ class Context(object):
def admin_password(self):
"""Returns the user's administrator password, prompting them if needed.
"""
- if self.__admin_password is not None:
- return self.__admin_password
# need_admin may be None or False,
# so don't rely on truthiness.
- if self.__need_admin == False:
+ if not self.need_admin:
return None
- self.__admin_password = get_admin_password(self.__action)
+ if self.__admin_password is None:
+ self.__admin_password = get_admin_password(self.__action)
+ return self.__admin_password
@property
@@ -2028,7 +2031,7 @@ def overwrite_destdir(ctx):
'mv {} {}'.format(ctx.destdir, ctx.old_destdir))
-def parse_args(argv=None, include=None):
+def parse_args(argv=None, include=None, parser=None):
"""Parse command-line arguments, returns an argparse.Namespace object.
:arg argv: Command-line arguments.
@@ -2037,8 +2040,14 @@ def parse_args(argv=None, include=None):
which re-use some of the routines defined in this script.
The resulting argparse.Namespace object will contain values
of None for all arguments that are not included.
+
+ :arg parser: `argparse.ArgumentParser` to configure. If not provided,
+ one is created.
"""
+ if parser is None:
+ parser = argparse.ArgumentParser()
+
uid = os.getuid()
if uid != 0: destdir = DEFAULT_INSTALLATION_DIRECTORY
@@ -2181,7 +2190,6 @@ def parse_args(argv=None, include=None):
}
# parse args
- parser = argparse.ArgumentParser()
for option in include:
shortflag, kwargs = options[option]
flags = ['--{}'.format(option)]
@@ -2203,7 +2211,6 @@ def parse_args(argv=None, include=None):
EMPHASIS)
sys.exit(1)
-
# add placeholder values for excluded args
for option in options.keys():
if option not in include: