daf
January 27, 2024, 10:26pm
1
Datomic Pro is packaged as a zip file behind a login screen. With a username and password, it’s possible to download with a single wget.
The zip file is a hodge-podge of executable jars, jar dependencies, python scripts, bash scripts, config files, and a shared library called libprocname.so
.
I want to write a small package for local use. Right now I know I’ll need the following:
a dependency for fetching with wget. (i may be able to write this myself if it doesn’t already exist)
a dependency for correcting hashbangs in scripts.
Can someone help me choose dependencies?
daf
January 27, 2024, 10:35pm
2
Found this .
fetchzip
exists but the document doesn’t mention passwords.
daf
January 28, 2024, 5:07pm
3
Looks like this is the dependency needed for fixing the hash-bangs
# `patchRcPath` hooks {#sec-patchRcPathHooks}
These hooks provide shell-specific utilities (with the same name as the hook) to patch shell scripts meant to be sourced by software users.
The typical usage is to patch initialisation or [rc](https://unix.stackexchange.com/questions/3467/what-does-rc-in-bashrc-stand-for) scripts inside `$out/bin` or `$out/etc`.
Such scripts, when being sourced, would insert the binary locations of certain commands into `PATH`, modify other environment variables or run a series of start-up commands.
When shipped from the upstream, they sometimes use commands that might not be available in the environment they are getting sourced in.
The compatible shells for each hook are:
- `patchRcPathBash`: [Bash](https://www.gnu.org/software/bash/), [ksh](http://www.kornshell.org/), [zsh](https://www.zsh.org/) and other shells supporting the Bash-like parameter expansions.
- `patchRcPathCsh`: Csh scripts, such as those targeting [tcsh](https://www.tcsh.org/).
- `patchRcPathFish`: [Fish](https://fishshell.com/) scripts.
- `patchRcPathPosix`: POSIX-conformant shells supporting the limited parameter expansions specified by the POSIX standard. Current implementation uses the parameter expansion `${foo-}` only.
For each supported shell, it modifies the script with a `PATH` prefix that is later removed when the script ends.
It allows nested patching, which guarantees that a patched script may source another patched script.
Syntax to apply the utility to a script:
This file has been truncated. show original
1 Like