From e8f5d6d0d95833e4bcb9af6225eebde0a000fe8d Mon Sep 17 00:00:00 2001 From: brent s Date: Fri, 24 Jun 2016 20:32:39 -0400 Subject: [PATCH] about to test the package fetching.. --- _bin/sign.pkg.sh | 0 _bin/submodule.update.sh | 42 +++++++++++++++++++++++++++++----------- 2 files changed, 31 insertions(+), 11 deletions(-) mode change 100644 => 100755 _bin/sign.pkg.sh mode change 100644 => 100755 _bin/submodule.update.sh diff --git a/_bin/sign.pkg.sh b/_bin/sign.pkg.sh old mode 100644 new mode 100755 diff --git a/_bin/submodule.update.sh b/_bin/submodule.update.sh old mode 100644 new mode 100755 index a7a2988..540039b --- a/_bin/submodule.update.sh +++ b/_bin/submodule.update.sh @@ -34,19 +34,39 @@ function freshenrepo () { REPO="${1}" # Check to see if it exists. https://stackoverflow.com/questions/12641469/list-submodules-in-a-git-repository - git config --file .gitmodules --get-regexp path | awk '{ print $2 }' | egrep -Eq "^${REPO}" + # We COULD use 'if git submodule status "${REPO}"' but we don't because regexes are cooler. so there. deal with it. /me puts on cool guy sunglasses. + git config --file .gitmodules --get-regexp path | awk '{ print $2 }' | egrep -Eq "^${REPO}$" if [[ "${?}" -eq '0' ]]; then # We remove it so we can grab a fresh copy directly from the AUR. - #https://stackoverflow.com/questions/1260748/how-do-i-remove-a-submodule - git rm --cached ${REPO} - git submodule deinit ${REPO} - - + #https://stackoverflow.com/questions/1260748/how-do-i-remove-a-submodule and others + git submodule deinit -f "${REPO}" + git rm -f "${REPO}" + git config -f .gitmodules --remove-section "submodule.${REPO}" > /dev/null 2>&1 # probably not necessary,... + rm -rf .git/modules/${REPO} + fi + touch .gitmodules + git add .gitmodules + git submodule add ${URI}:${REPO} + cat >> .git/modules/${REPO}/hooks/pre-commit << EOF +#!/bin/bash +/usr/bin/mksrcinfo + +git add .SRCINFO +EOF + chmod 700 .git/modules/${REPO}/hooks/pre-commit + } -if -for i in $(ssh aur@aur.archlinux.org list-repos | sed -e 's/[[:space:]]*//g' | sort); -do - freshenrepo ${i} -done +if [[ "${PKGNAME}" =~ [Aa][Ll]{2} ]]; +then + for i in $(ssh aur@aur.archlinux.org list-repos | sed -e 's/[[:space:]]*//g' | sort); + do + freshenrepo ${i} + done +elif [ -n "${PKGNAME}" ]; +then + freshenrepo ${PKGNAME} +fi + +git submodule update