packaging: Let eris install on Fedora distributions
This commit is contained in:
parent
13345232d9
commit
d5122f833a
8 changed files with 42 additions and 26 deletions
|
|
@ -6,13 +6,12 @@ Eris maintains an up-to-date set of reports for every file in a codebase.
|
|||
|
||||
## Installation
|
||||
|
||||
#### Debian / Ubuntu
|
||||
#### Debian / Ubuntu / Fedora
|
||||
|
||||
Install eris directly using pipx, and apt install the tools eris relies on:
|
||||
Install eris with pipx, then install all the tools eris uses:
|
||||
|
||||
sudo apt install pipx
|
||||
pipx install --system-site-packages git+https://gitlab.com/ahamilton/eris@v2023.09.11#subdirectory=eris
|
||||
eris --apt-install-tools
|
||||
eris --install-all-tools
|
||||
|
||||
Or install from source: (including tools)
|
||||
|
||||
|
|
@ -22,7 +21,7 @@ Or install from source: (including tools)
|
|||
|
||||
Then to run:
|
||||
|
||||
eris -h
|
||||
eris
|
||||
eris-webserver <project> # Or a simple web interface.
|
||||
|
||||
## Tools
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ Usage:
|
|||
eris [options] <directory>
|
||||
eris -h | --help
|
||||
eris -i | --info
|
||||
eris -a | --apt-install-tools
|
||||
eris -a | --install-all-tools
|
||||
eris --version
|
||||
|
||||
Example:
|
||||
|
|
@ -60,7 +60,7 @@ Example:
|
|||
Options:
|
||||
-h, --help Show the full help.
|
||||
-i, --info Show information about the available tools.
|
||||
-a, --apt-install-tools Install all tools. Ubuntu only.
|
||||
-a, --install-all-tools Install all tools.
|
||||
-w COUNT, --workers=COUNT The number of processes working in parallel.
|
||||
By default it is the number of cpus minus 1.
|
||||
-e "COMMAND", --editor="COMMAND" The command used to start the editor, in
|
||||
|
|
@ -1142,9 +1142,17 @@ def check_arguments():
|
|||
sys.exit(1)
|
||||
os.environ["ERIS_CONFIG"] = config_path
|
||||
import eris.tools as tools
|
||||
if arguments["--apt-install-tools"]:
|
||||
if arguments["--install-all-tools"]:
|
||||
print("Installing all tools… (requires sudo)")
|
||||
subprocess.run(["sudo", "apt", "-y", "install"] + sorted(tools.dependencies()), check=True)
|
||||
tools_ = tools.dependencies()
|
||||
package_manager = "apt"
|
||||
if "ID=fedora\n" in open("/etc/os-release"):
|
||||
tools_.remove("lua-check")
|
||||
fedora_rename = {"lua5.3": "lua", "python3-bandit": "bandit",
|
||||
"ruby3.1": "ruby", "xz-utils": "xz"}
|
||||
tools_ = [fedora_rename.get(tool, tool) for tool in tools_]
|
||||
package_manager = "dnf"
|
||||
subprocess.run(["sudo", package_manager, "-y", "install"] + sorted(tools_), check=True)
|
||||
print("Done.")
|
||||
sys.exit(0)
|
||||
if arguments["--info"]:
|
||||
|
|
|
|||
|
|
@ -379,7 +379,7 @@ MAX_IMAGE_SIZE = 200
|
|||
|
||||
|
||||
def _resize_image(image, new_width):
|
||||
import PIL.Image # Here to avoid 'Segmentation Fault' in apt-install-tools
|
||||
import PIL.Image # Here to avoid 'Segmentation Fault' in install-all-tools
|
||||
scale = new_width / image.width
|
||||
return image.resize((int(image.width * scale), int(image.height * scale)), PIL.Image.LANCZOS)
|
||||
|
||||
|
|
|
|||
|
|
@ -148,12 +148,12 @@ tools_for_extensions = [
|
|||
[unrar]
|
||||
dependencies = ["unrar"]
|
||||
url = "http://www.rarlabs.com/"
|
||||
command = "unrar-nonfree l"
|
||||
command = "unrar l"
|
||||
|
||||
[7z]
|
||||
dependencies = ["p7zip"]
|
||||
url = "http://p7zip.sourceforge.net/"
|
||||
command = "7zr l"
|
||||
command = "7za l"
|
||||
|
||||
[unxz]
|
||||
dependencies = ["xz-utils"]
|
||||
|
|
@ -237,7 +237,7 @@ tools_for_extensions = [
|
|||
[lua_syntax]
|
||||
dependencies = ["lua5.3"]
|
||||
url = "http://www.lua.org"
|
||||
command = "luac5.3 -p"
|
||||
command = "luac -p"
|
||||
|
||||
[js_syntax]
|
||||
dependencies = ["nodejs"]
|
||||
|
|
|
|||
9
install
9
install
|
|
@ -2,13 +2,8 @@
|
|||
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
|
||||
sudo apt install -y python3.11 pipx
|
||||
pipx install --system-site-packages $1 ./eris
|
||||
eris --apt-install-tools
|
||||
# When developing...
|
||||
# python3.11 -m pip install -e ./eris
|
||||
# python3.11 -m pip install -e ./fill3
|
||||
# python3.11 -m pip install -e ./termstr
|
||||
# python3.11 -m pip install -e ./lscolors
|
||||
eris --install-all-tools
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ COPY . eris
|
|||
RUN PIPX_BIN_DIR=/bin pipx install --system-site-packages ./eris/eris
|
||||
RUN chmod a+rwx -R /root
|
||||
RUN apt-get install -y sudo
|
||||
RUN eris --apt-install-tools
|
||||
RUN eris --install-all-tools
|
||||
|
||||
ENTRYPOINT ["eris"]
|
||||
|
||||
|
|
|
|||
15
packaging/Dockerfile.fedora
Normal file
15
packaging/Dockerfile.fedora
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
|
||||
|
||||
FROM fedora
|
||||
|
||||
RUN dnf -y install python3.11 python3-pip pipx gcc python3.11-devel
|
||||
COPY . eris
|
||||
RUN PIPX_BIN_DIR=/bin pipx install --system-site-packages ./eris/eris
|
||||
RUN chmod a+rwx -R /root
|
||||
RUN dnf -y install sudo
|
||||
RUN eris --install-all-tools
|
||||
|
||||
ENTRYPOINT ["eris"]
|
||||
|
||||
|
||||
# docker build -t eris -f packaging/Dockerfile.fedora .
|
||||
|
|
@ -22,13 +22,12 @@ Eris maintains an up-to-date set of reports for every file in a codebase.
|
|||
|
||||
## Installation
|
||||
|
||||
#### Debian / Ubuntu
|
||||
#### Debian / Ubuntu / Fedora
|
||||
|
||||
Install eris directly using pipx, and apt install the tools eris relies on:
|
||||
Install eris with pipx, then install all the tools eris uses:
|
||||
|
||||
sudo apt install pipx
|
||||
pipx install --system-site-packages git+https://gitlab.com/ahamilton/eris@v2023.09.11#subdirectory=eris
|
||||
eris --apt-install-tools
|
||||
eris --install-all-tools
|
||||
|
||||
Or install from source: (including tools)
|
||||
|
||||
|
|
@ -38,7 +37,7 @@ Or install from source: (including tools)
|
|||
|
||||
Then to run:
|
||||
|
||||
eris -h
|
||||
eris
|
||||
eris-webserver <project> # Or a simple web interface.
|
||||
|
||||
## Tools
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue