keys or fingerprints instead of donwloading it from somewhere, in which case it could
be easily tampered.
+## Hoarder
+
+Hoarder is trashman's companion, an equivalent script intended to install packages
+locally, at the current user's folder:
+
+ hoarder install <package>
+
## Features
* Multi-arch, multi-OS: you might code packages for any distro,
TODO
====
-* Multi-licensing and note on the lack of licensing for some scripts.
* Support more OSes at `__trashman_distro()`.
* Argument passing to distro/action scripts as `--param=value`.
+* Run check action (if available) before testing/installing/removing.
+* Multi-licensing and note on the lack of licensing for some scripts.
--- /dev/null
+trashman
\ No newline at end of file
--- /dev/null
+terminal based youtube player and downloader
--- /dev/null
+#!/usr/bin/env sh
+#
+# Install mps-youtube
+# https://github.com/mps-youtube/mps-youtube
+
+# Requirements
+trashman_apt_install_packages python3-pip mpv
+pip3 install --user youtube-dl
+
+# Install
+pip3 install --user -U git+https://github.com/mps-youtube/mps-youtube.git
--- /dev/null
+a smart and nice twitter client on terminal written in python
--- /dev/null
+#!/usr/bin/env sh
+#
+# Install rainbowstream
+# https://github.com/orakaro/rainbowstream
+
+# Requirements
+trashman_apt_install_packages python-pip python-dev libjpeg-dev libfreetype6 libfreetype6-dev zlib1g-dev
+
+# Install
+pip install --user rainbowstream
# Custom functions for debian-like systems.
#
+trashman_apt_update() {
+ $SUDO apt-get update
+}
+
trashman_apt_install() {
if [ -z "$1" ]; then
return
fi
- LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y $*
+ LC_ALL=C DEBIAN_FRONTEND=noninteractive $SUDO apt-get install -y $*
}
# Machine architecture
return
fi
+ trashman_apt_update
+
for package in $*; do
trashman_apt_check $package
if [ "$?" = "1" ]; then
trashman_echo "Installing package $package..."
- DEBIAN_FRONTEND=noninteractive apt-get install $package -y || exit 1
+ DEBIAN_FRONTEND=noninteractive $SUDO apt-get install $package -y || exit 1
fi
done
}
exit 1
fi
- cp $orig /etc/apt/trusted.gpg.d/$dest || exit 1
- chown root.root /etc/apt/trusted.gpg.d/$dest && chmod 644 /etc/apt/trusted.gpg.d/$dest || exit 1
+ $SUDO cp $orig /etc/apt/trusted.gpg.d/$dest || exit 1
+ $SUDO chown root.root /etc/apt/trusted.gpg.d/$dest && $SUDO chmod 644 /etc/apt/trusted.gpg.d/$dest || exit 1
}
exit 1
fi
}
+
+# Check for sudo
+trashman_check_sudo () {
+ if [ "`whoami`" != "root" ]; then
+ SUDO="sudo"
+ fi
+}
#!/usr/bin/env sh
#
-# Provision: install stuff using scripts.
+# trashman handles junky software
#
# Copyright (C) 2017 Silvio Rhatto - rhatto at riseup.net
#
# Set shared files location
if [ -e "`dirname $(readlink -f $0)`/share/$NAME" ]; then
# Development or local installation layout
- SHARE="`dirname $(readlink -f $0)`/share/$NAME"
+ LIB="`dirname $(readlink -f $0)`/share/$NAME"
+ SHARE="`dirname $(readlink -f $0)`/share/$BASENAME"
else
# System installation layout
- SHARE="`dirname $(readlink -f $0)`/../share/$NAME"
+ LIB="`dirname $(readlink -f $0)`/../share/$NAME"
+ SHARE="`dirname $(readlink -f $0)`/../share/$BASENAME"
fi
# Include basic functions
-. $SHARE/trashman/functions || exit 1
+. $LIB/trashman/functions || exit 1
# Display usage
trashman_usage() {
folder="`trashman_actions_folder $package`"
# Checking for privileges
- trashman_check_root $ACTION
+ if [ "$BASENAME" == "trashman" ]; then
+ trashman_check_root $ACTION
+ else
+ trashman_check_sudo
+ fi
if [ -x "$SHARE/$package/$folder/$ACTION" ]; then
if [ "$ACTION" != "check" ] && [ "$ACTION" != "test" ]; then