Skip to content

Instantly share code, notes, and snippets.

@tuxarch
Created December 2, 2017 22:38
Show Gist options
  • Save tuxarch/70eab38117ba582db1eddd598f12482c to your computer and use it in GitHub Desktop.
Save tuxarch/70eab38117ba582db1eddd598f12482c to your computer and use it in GitHub Desktop.
#!/bin/bash
# Retrieves the installed `pacman` package lists and syncs them with my remote git repo
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Local directory must exist
# mkdir $HOME/Documents/archpackages
# Get the packages
sudo pacman -Qq > $HOME/Documents/archpackages/packages-all.txt
sudo pacman -Qnq > $HOME/Documents/archpackages/packages-native.txt
sudo pacman -Qmq > $HOME/Documents/archpackages/packages-foreign.txt
# Copy to dotfiles
# NOTE it is assumed this directory already exists
#cp $HOME/Documents/archpackages/* $HOME/dotfiles/archpackages/expanded/
# Perform git operations
#cd dotfiles
#git add archpackages
#git commit -m "Update package lists"
#git push -u origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment