35 lines
946 B
Bash
Executable File
35 lines
946 B
Bash
Executable File
#!/bin/sh
|
|
|
|
## Create lists of system- and TeX Live packages.
|
|
|
|
## Variables
|
|
PKG_ROOT="$HOME/.pkg"
|
|
mkdir -p "$PKG_ROOT"
|
|
|
|
## Arch Linux
|
|
if command -v pacman >/dev/null 2>&1; then
|
|
pacman -Qnq | sort >"$PKG_ROOT/arch-official"
|
|
pacman -Qmq | sort >"$PKG_ROOT/arch-aur"
|
|
fi
|
|
|
|
## FreeBSD
|
|
if [ "$(uname)" = "FreeBSD" ]; then
|
|
pkg_info | cut -f1 -d' ' >"$PKG_ROOT/freebsd"
|
|
fi
|
|
|
|
## TeXlive
|
|
## TODO: Use tlctl.
|
|
if command -v tlmgr >/dev/null 2>&1; then
|
|
## We use <TAB> in the sed expressions.
|
|
TEXLIVE_BASIC="$(mktemp)"
|
|
tlmgr info collection-basic --list | sed -n '/^ /{s/ //g;p;}' | sort >"$TEXLIVE_BASIC"
|
|
|
|
TEXLIVE_ALL="$(mktemp)"
|
|
tlmgr info --only-installed | grep -v 'x86_64\|amd64' | cut -d' ' -f2 | cut -f1 -d':' | sort >"$TEXLIVE_ALL"
|
|
|
|
comm -3 "$TEXLIVE_BASIC" "$TEXLIVE_ALL" | sed 's/ //g' | \
|
|
grep -vi 'collection-basic\|scheme-minimal\|texlive-common\|texlive-docindex\|texlive-en' >"$PKG_ROOT/texlive"
|
|
|
|
rm "$TEXLIVE_ALL" "$TEXLIVE_BASIC"
|
|
fi
|