Changeset 1fedc31 in rattail-fabric2
- Timestamp:
- 11/27/2022 06:47:43 PM (2 months ago)
- Branches:
- master
- Children:
- a3339ac
- Parents:
- a9bbee5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
rattail_fabric2/backup.py
ra9bbee5 r1fedc31 3 3 # 4 4 # Rattail -- Retail Software Framework 5 # Copyright © 2010-20 19Lance Edgar5 # Copyright © 2010-2022 Lance Edgar 6 6 # 7 7 # This file is part of Rattail. … … 56 56 python_exe='/usr/bin/python3', 57 57 install_borg=False, 58 pyfuse3=False, 58 59 link_borg_to_bin=True, 59 60 install_luigi=False, … … 92 93 if mkvirtualenv and not exists(c, envpath): 93 94 python.mkvirtualenv(c, envname, python=python_exe, runas_user=user) 94 # TODO: this should not be necessary, right? 95 c.sudo('chown -R {}: {}'.format(user, envpath)) 95 # TODO: this should not be necessary, right? 96 c.sudo('chown -R {}: {}'.format(user, envpath)) 97 c.sudo("bash -c 'PIP_CONFIG_FILE={0}/pip.conf {0}/bin/pip install -U pip setuptools wheel'".format(envpath), 98 user=user) 96 99 mkdir(c, os.path.join(envpath, 'src'), use_sudo=True, runas_user=user) 97 c.sudo("bash -c 'PIP_CONFIG_FILE={0}/pip.conf {0}/bin/pip install -U pip setuptools wheel'".format(envpath),98 user=user)99 100 100 101 if install_rattail: … … 132 133 # borg 133 134 if install_borg: 134 if install_rattail: 135 packages = [ 136 'rattail[backup]', 137 ] 138 else: 139 # TODO: these should be same as rattail[backup] 140 packages = [ 141 'msgpack', 142 'borgbackup[fuse]', 143 ] 144 c.sudo("bash -c 'PIP_CONFIG_FILE={0}/pip.conf {0}/bin/pip install {1}'".format(envpath, ' '.join(packages)), 135 if isinstance(install_borg, list): 136 packages = install_borg 137 elif isinstance(install_borg, str): 138 packages = [install_borg] 139 else: 140 packages = ['msgpack'] 141 if pyfuse3: 142 apt.install(c, 'libfuse3-dev') 143 packages.append('borgbackup[pyfuse3]') 144 else: 145 # TODO: this is legacy and should stop being default 146 packages.append('borgbackup[fuse]') 147 c.sudo("bash -c 'PIP_CONFIG_FILE={0}/pip.conf {0}/bin/pip install {1}'".format(envpath, ' '.join(packages)), 145 148 user=user) 146 149 if link_borg_to_bin:
Note: See TracChangeset
for help on using the changeset viewer.