Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to build and release #15

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
moved build script to pkg
  • Loading branch information
dszryan committed Oct 7, 2020
commit 458d99707821b40be1d8e835e791a315f2bc62a1
2 changes: 1 addition & 1 deletion pacmanity.hook
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ Target = *
Description = Running Pacmanity hook...
Depends = coreutils
When = PostTransaction
Exec = /usr/bin/bash -c "source /usr/lib/pacmanity/pacmanity.sh && pacmanity_update"
Exec = /usr/lib/pacmanity/pacmanity.sh
42 changes: 8 additions & 34 deletions pacmanity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,11 @@
# Pacmanity
# Keeps a list of installed packages in a Gist at your GitHub account.

pacmanity_build() {
echo "A list of installed packages will be automatically maintained"
echo "by Pacmanity in a private Gist at your GitHub account."

echo -e "\n- Step 1: Log in to Gist using your GitHub account:"
[[ -f ~/.gist ]] || gist --login # dont save login details in package, due to securiry concerns

# if file is present, assume it is maanged externally (via a build system)
[[ -r /etc/pacmanity ]] && source /etc/pacmanity
if [ -z "$GIST_ID" ]; then
echo -e "\n- Step 2: Save list of currently installed packages to Gist:"
GIST_URL=$(echo . | gist -p -f $HOSTNAME.pacmanity -d "$HOSTNAME: List of installed packages")
GIST_ID=$(echo "$GIST_URL" | sed "s|https://gist.github.com/||g")
echo "GIST_ID=$GIST_ID" > "$srcdir/gist_id"
else
pacmanity_update
fi

echo "An automatically mantained list of installed packages"
echo "has been successfully created in your GitHub Gist."
echo "Visit https://gist.github.com or the direct link below:"
echo "$GIST_URL"
}

pacmanity_update() {
[[ -n "$GIST_ID" ]] || source /etc/pacmanity
if (pacman -Qqen; echo; pacman -Qqem) | gist -u "$GIST_ID" -f $HOSTNAME.pacmanity; then
echo "Pacmanity: Gist successfully updated."
else
echo "Pacmanity: ERROR!"
echo "1. Try running 'sudo gist --login'"
echo "2. Ensure the gist exists, if specified"
fi
}
[[ -n "$GIST_ID" ]] || source /etc/pacmanity
if (pacman -Qqen; echo; pacman -Qqem) | gist -u "$GIST_ID" -f $HOSTNAME.pacmanity; then
echo "Pacmanity: Gist successfully updated."
else
echo "Pacmanity: ERROR!"
echo "1. Try running 'sudo gist --login'"
echo "2. Ensure the gist exists, if specified"
fi