datalad / datalad-installer

Installation script for Datalad and related components
MIT License
6 stars 3 forks source link

does not work on fedora #162

Closed asmacdo closed 1 year ago

asmacdo commented 1 year ago

Looks like it will not work on any non-debian distro if it needs dpkg?

$ datalad-installer git-annex -m datalad/git-annex:release

2023-05-08T12:05:00-0400 [INFO    ] datalad_installer Writing environment modifications to /tmp/dl-env-jp2td3fi.sh
2023-05-08T12:05:00-0400 [INFO    ] datalad_installer Installing git-annex via datalad/git-annex:release
2023-05-08T12:05:00-0400 [INFO    ] datalad_installer Version: None
2023-05-08T12:05:01-0400 [INFO    ] datalad_installer Downloading https://github.com/datalad/git-annex/releases/download/10.20230407/git-annex-standalone_10.20230407-1.ndall%2B1_amd64.deb
Traceback (most recent call last):
  File "/home/austin/.venvs/m/bin/datalad-installer", line 8, in <module>
    sys.exit(main())
  File "/home/austin/.venvs/m/lib64/python3.10/site-packages/datalad_installer.py", line 2778, in main
    return manager.main(argv)
  File "/home/austin/.venvs/m/lib64/python3.10/site-packages/datalad_installer.py", line 763, in main
    self.addcomponent(name=cr.name, **cr.kwargs)
  File "/home/austin/.venvs/m/lib64/python3.10/site-packages/datalad_installer.py", line 802, in addcomponent
    component(self).provide(**kwargs)
  File "/home/austin/.venvs/m/lib64/python3.10/site-packages/datalad_installer.py", line 1264, in provide
    bins = self.get_installer(method).install(self.NAME, **kwargs)
  File "/home/austin/.venvs/m/lib64/python3.10/site-packages/datalad_installer.py", line 1392, in install
    bindir = self.install_package(package, **kwargs)
  File "/home/austin/.venvs/m/lib64/python3.10/site-packages/datalad_installer.py", line 1946, in install_package
    if install_dir is None and deb_pkg_installed("git-annex"):
  File "/home/austin/.venvs/m/lib64/python3.10/site-packages/datalad_installer.py", line 2757, in deb_pkg_installed
    r = subprocess.run(
  File "/usr/lib64/python3.10/subprocess.py", line 501, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib64/python3.10/subprocess.py", line 966, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib64/python3.10/subprocess.py", line 1842, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'dpkg-query'
yarikoptic commented 1 year ago

For this need two ways

yarikoptic commented 1 year ago

@jwodder, since we are not building .rpm's for fedora and I am not sure if any conversion (via smth like alien I used in debian) would work, for now let's

@asmacdo -- you are welcome to try (redo your invocation, but add --path some-path option) -- I think it should work.

jwodder commented 1 year ago

@yarikoptic I believe you mean --install-dir, not --path.

yarikoptic commented 1 year ago

correct! I forgot that we used already --path --install-dir for some path to .dmg image

yarikoptic commented 1 year ago

the script I use to install any wanted version within ~/git-annexes:

#!/bin/bash

set -eu

v="${1:-}"
annexes=$HOME/git-annexes

if [ -n "$v" ]; then
    ~/proj/datalad/datalad-installer/src/datalad_installer.py -E $annexes/$v.env git-annex=$v -m datalad/git-annex:release --install-dir $annexes/$v
else
    # install current one, deduce version and rename accordingly
    if [ ! -e ~/git-annexes/current ]; then
        ~/proj/datalad/datalad-installer/src/datalad_installer.py -E $annexes/current.env git-annex -m datalad/git-annex --install-dir $annexes/current
    fi
    v=$(source $annexes/current.env; git annex version | head -n 1 | sed -e 's,.*: *,,g' -e 's,-[0-9]~.*,,g')
    if [ -e $annexes/$v ] ; then
        echo "$annexes/$v already exists!" >&2
        exit 1
    fi
    mv "$annexes/current" "$annexes/$v"
    mv "$annexes/current.env" "$annexes/$v.env"
    sed -i -e "s,current,$v,g" "$annexes/$v.env"
fi
echo "I: use  source $annexes/$v.env"

and it should work on fedora in principle