From 190707f9aff29b96cd99fb5144343a19a8200166 Mon Sep 17 00:00:00 2001 From: Ryan McGuire Date: Fri, 15 Apr 2016 07:02:28 -0400 Subject: [PATCH] Adds global update function Adds update docs --- README.md | 10 ++++++++++ arch-ppa | 14 +++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b0b74c8..cbb527a 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,16 @@ packages in the correct order. Additionally, you can specify individual package names after the repository name if you only wish to build certain packages. +Update packages: + + ./arch-ppa update [optional package names] + +The update command will download new PKGBUILDs for the specified +packages (or all if not specified.) The update will complain if you +haven't added the existing packages to a git repository or have +uncommited changes. Always review changes to PKGBUILD files before +committing them. That's the point of this thing. Use `git diff src`. + The repository directory can be listed in your `/etc/pacman.conf` like this: [ryan] diff --git a/arch-ppa b/arch-ppa index aeac29d..ffa6306 100755 --- a/arch-ppa +++ b/arch-ppa @@ -40,6 +40,7 @@ install_system_deps() { } pkg_dep devtools pkg_dep git + pkg_dep findutils ) } @@ -137,10 +138,17 @@ update() { # Update a package and it's dependencies from the AUR ( set -e - if [ ! -d $basedir/src/$1 ]; then - echo "No package called $1 found in src" - return 1 + if [ "$#" -eq 0 ]; then + cd $basedir/src + update * + return fi + for pkg in "$@"; do + if [ ! -d $basedir/src/$pkg ]; then + echo "No package called $pkg found in src" + return 1 + fi + done for pkg in "$@"; do check_in_git() { (