File: git-annex-install

package info (click to toggle)
git-annex 7.20190129-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 56,292 kB
  • sloc: haskell: 59,105; sh: 1,255; makefile: 225; perl: 136; ansic: 44
file content (58 lines) | stat: -rwxr-xr-x 1,454 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/sh
# 
# Installs git-annex in termux on android.
# 
# This is only a convenience script to avoid the user needing to type much
# in termux. The standalone tarball automatically adapts itself to the termux
# environment, so this script should stay as mininal as possible.
#
# This script needs to be sourced into the current termux shell, rather
# than run with a new shell, so it can set the PATH to include git-annex.

set -e

case $(uname -m) in
	aarch64)
		arch=arm64
		;;
	arm)
		arch=armel
		;;
	armv71)
		arch=armel
		;;
	x86_64)
		arch=amd64
		;;
	x86_32)
		arch=i386
		;;
	*) 
		echo "unknown architecture $(uname -m), cannot install" >&2
		exit 1
		;;
esac

url=https://downloads.kitenet.net/git-annex/linux/current/git-annex-standalone-"$arch".tar.gz
# uncomment to use latest autobuild
#url=https://downloads.kitenet.net/git-annex/autobuild/"$arch"/git-annex-standalone-"$arch".tar.gz

echo "Installing dependencies with termux pkg manager..."
pkg install git wget tar coreutils proot

echo "Downloading git-annex..."
cd
wget -O- "$url" | tar zx

# This lets runshell finish the installation.
git-annex.linux/git-annex version
echo "git-annex is successfully installed."

echo "Now running termux-setup-storage, to let git-annex access system storage."
termux-setup-storage

# Add to PATH of shell that sourced this, so the user can immediately
# start using git-annex.
PATH="$PATH:`pwd`/git-annex.linux"

echo "Installation complete."