Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

does not work on fedora #162

Closed
asmacdo opened this issue May 8, 2023 · 5 comments · Fixed by #163
Closed

does not work on fedora #162

asmacdo opened this issue May 8, 2023 · 5 comments · Fixed by #163
Assignees

Comments

@asmacdo
Copy link
Member

asmacdo commented May 8, 2023

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
Copy link
Member

yarikoptic commented May 8, 2023

For this need two ways

  • native Fedora support: yum install datalad
  • extracting of .deb using ar and tar directly (without dpkg -x support).

@yarikoptic
Copy link
Member

@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

  • if a Linux, but no dpkg-query present (I don't think we should try to identify the system), crash with some more informative exception e.g. , "Since not running a Debian-based system (no dpkg-query), you can only install available .deb package in a specific path, so provide --path option".

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

@jwodder
Copy link
Member

jwodder commented May 11, 2023

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

@yarikoptic
Copy link
Member

yarikoptic commented May 11, 2023

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

@yarikoptic
Copy link
Member

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

yarikoptic added a commit that referenced this issue May 16, 2023
dpkg-based methods now raise MethodNotSupportedError when called on non-dpkg systems without `--install-dir`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants