Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/contrib/updpkgsums.sh.in
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2016-10-09 22:52:27 +1000
committerAllan McRae <allan@archlinux.org>2016-10-10 10:38:05 +1000
commit0c99eabd50752310f42ec808c8734a338122ec86 (patch)
tree499801a8c046001ddab0b11439e9e948b257d726 /contrib/updpkgsums.sh.in
parent2e76c184aac74c4848fa5ee092fe54c9954c4054 (diff)
Remove contrib
The contrib directory takes too much of the pacman developer's limited time, which could be better spent developing and reviewing patches for the primary projects. The community can pick this up in a separate repository if wanted. Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'contrib/updpkgsums.sh.in')
-rw-r--r--contrib/updpkgsums.sh.in115
1 files changed, 0 insertions, 115 deletions
diff --git a/contrib/updpkgsums.sh.in b/contrib/updpkgsums.sh.in
deleted file mode 100644
index c571d297..00000000
--- a/contrib/updpkgsums.sh.in
+++ /dev/null
@@ -1,115 +0,0 @@
-#!/bin/bash
-#
-# updpkgsums - update source checksums in-place in PKGBUILDs
-#
-# Copyright (C) 2012-2013 Dave Reisner <dreisner@archlinux.org>
-#
-# 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 2
-# 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.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-shopt -s extglob
-
-declare -r myname='updpkgsums'
-declare -r myver='@PACKAGE_VERSION@'
-
-usage() {
- printf "%s (pacman) v%s\n" "${myname}" "${myver}"
- echo
- printf "%s will perform an in place update of the checksums in the\n" "${myname}"
- echo "path specified by [build file], defaulting to PKGBUILD in the current"
- echo "working directory."
- echo
- printf "Usage: %s [options] [build file]\n" "${myname}"
- echo
- echo " -h, --help display this help message and exit"
- echo " -V, --version display version information and exit"
- echo
- echo "These options can be passed to makepkg:"
- echo " -m, --nocolor disable colorized output messages"
-}
-
-version() {
- printf "%s %s\n" "$myname" "$myver"
- echo 'Copyright (C) 2012-2013 Dave Reisner <dreisner@archlinux.org>'
-}
-
-die() {
- printf "==> ERROR: $1\n" "${@:2}" >&2
- exit 1
-}
-
-MAKEPKG_OPTS=()
-buildfile='PKGBUILD'
-
-while (( "$#" )); do
- case "$1" in
- -h|--help) usage; exit ;;
- -m|--nocolor) MAKEPKG_OPTS+=("$1"); shift ;;
- -V|--version) version; exit ;;
- *) buildfile="$1"; break 2 ;;
- esac
-done
-
-if [[ ! -f $buildfile ]]; then
- die "%s not found or is not a file" "$buildfile"
-fi
-
-# Resolve any symlinks to avoid replacing the symlink with a file. But, we
-# have to do this portably -- readlink's flags are inconsistent across OSes.
-while [[ -L $buildfile ]]; do
- buildfile=$(readlink "$buildfile")
- if [[ $buildfile = */* ]]; then
- cd "${buildfile%/*}"
- buildfile=${buildfile##*/}
- fi
-done
-
-# cd into the directory with the build file. This avoids creating random src/
-# directories scattered about the filesystem, and avoids cases where we might
-# not be able to write in the $PWD.
-if [[ $buildfile = */* ]]; then
- cd "${buildfile%/*}"
- buildfile=${buildfile##*/}
-fi
-
-# Check $PWD/ for permission to unlink the $buildfile and write a new one
-if [[ ! -w . ]]; then
- die "No write permission in '%s'" "$PWD"
-fi
-
-# Generate the new sums
-export BUILDDIR=$(mktemp -d "${TMPDIR:-/tmp}/updpkgsums.XXXXXX")
-newbuildfile=$(mktemp "${TMPDIR:-/tmp}/updpkgsums.XXXXXX")
-
-trap "rm -rf '$BUILDDIR' '$newbuildfile'" EXIT
-newsums=$(makepkg -g -p "$buildfile" "${MAKEPKG_OPTS[@]}") || die 'Failed to generate new checksums'
-awk -v newsums="$newsums" '
- /^[[:blank:]]*(md|sha)[[:digit:]]+sums(_[^=]+)?=/,/\)[[:blank:]]*(#.*)?$/ {
- if (!w) {
- print newsums
- w++
- }
- next
- }
-
- 1
- END { if (!w) print newsums }
-' "$buildfile" > "$newbuildfile" || die 'Failed to write new PKGBUILD'
-
-# Rewrite the original buildfile. Use cat instead of mv/cp to preserve
-# permissions implicitly.
-if ! cat -- "$newbuildfile" >"$buildfile"; then
- die "Failed to update %s. The file has not been modified." "$buildfile"
-fi
-
-# vim: set noet: