From 9df01863feac767ebe01e99cfc597632416ca27a Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Wed, 29 Jan 2003 09:19:25 +0000 Subject: Version 0.21 from Andreas Gruenbacher --- importpatch.in | 194 --------------------------------------------------------- 1 file changed, 194 deletions(-) delete mode 100755 importpatch.in (limited to 'importpatch.in') diff --git a/importpatch.in b/importpatch.in deleted file mode 100755 index 2e0c8cf..0000000 --- a/importpatch.in +++ /dev/null @@ -1,194 +0,0 @@ -#! /bin/bash - -# This script is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2 as -# published by the Free Software Foundation. -# -# See the COPYING and AUTHORS files for more details. - -# Read in library functions -if ! [ -r @LIB@/patchfns ] -then - echo "Cannot read library @LIB@/patchfns" >&2 - exit 1 -fi -. @LIB@/patchfns - -usage() -{ - echo "Usage: importpatch [-f] [-p num] [-n patchname] [patchfile]" - if [ x$1 = x-h ] - then - cat < $tmp - then - echo "Cannot read from standard input." - exit 1 - fi - input_file=$tmp ;; -*.gz) - tmp=$(mktemp /tmp/patch-scripts.XXXXXX) - if ! gzip -cd "$input_file" > $tmp - then - echo "Cannot decompress file $input_file" - exit 1 - fi - input_file=$tmp ;; -*.bz2) - tmp=$(mktemp /tmp/patch-scripts.XXXXXX) - if ! bzip2 -cd "$input_file" > $tmp - then - echo "Cannot decompress file $input_file" - exit - fi - input_file=$tmp ;; -*) - if ! [ -r "$input_file" ] - then - echo "Cannot read from file $input_file" - exit 1 - fi -esac - -if [ -e "$patch_file" ] -then - if [ -z "$opt_force" ] - then - echo "Patch $patch exists. Replace with -f." - exit 1 - fi - - if grep -q '^%patch$' "$patch_file" && - ! grep -q '^%patch$' "$input_file" - then - echo "Updating %patch section of patch $patch" - if ! @LIB@/parse-patch -u patch $patch_file< "$input_file" - then - echo "Failed to update %patch section of patch $patch" - exit 1 - fi - else - echo "Replacing patch $patch with new version" - if ! cat "$input_file" > "$patch_file" - then - echo "Failed to replace patch $patch" - exit 1 - fi - fi -else - echo "Importing patch $patch (stored as $patch_file)" - if ! grep -q '^%patch$' "$input_file" - then - echo "%patch" >> "$patch_file" - fi - if ! cat "$input_file" >> "$patch_file" - then - echo "Failed to import patch $patch" - exit 1 - fi -fi - -rm -rf .pc/$patch - -if ! patch_in_series $patch && - ! insert_in_series $opt_patch "$patch_args" -then - echo "Failed to insert $patch in file series." -fi - -if [ -n "$tmp" ] -then - rm -f $tmp -fi -- cgit