source: scripts/patch/vim-patch.sh@ d2e8cd1

clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since d2e8cd1 was ff1e2f9, checked in by Jonathan Norman <jon@…>, 13 years ago

Updated Vim Branch Update to -3 and replaced vim-patch.sh with new shell script

  • Property mode set to 100644
File size: 2.0 KB
Line 
1#!/bin/sh
2# Jonathan Norman
3
4# Vim branch update patch generator
5
6VERSION=$1
7
8# Check Input
9#
10if [ "${VERSION}" = "" ]; then
11 echo "$0 [Vim_version]"
12 echo "This will Create a Patch for Vim Vim_Version"
13 exit 255
14fi
15
16TMP=~/tmp/vim-${VERSION}
17PATCHDIR=${TMP}/patches
18PATCHURL=ftp://ftp.vim.org/pub/vim/patches
19SERIES=$(echo ${VERSION} | sed -e 's/\.//g')
20CLFS_PATCHS=http://patches.cross-lfs.org/dev/
21
22# Figure out patch number
23UPDATE_NUM=$(curl -ls http://patches.cross-lfs.org/dev/ | grep vim-${VERSION} | cut -d . -f 3 | cut -d - -f 3-)
24UPDATE_NUM=$(expr ${UPDATE_NUM} + 1)
25
26# Download patches
27echo "Downloading patches for VIM ${VERSION}"
28PATCH_NUM=$(curl -s $PATCHURL/${VERSION}/ | grep " ${VERSION}." | cut -f 3- -d . | tail -n1)
29mkdir -p $PATCHDIR
30cd $PATCHDIR
31curl -O -# $PATCHURL/$VERSION/$VERSION.[001-$PATCH_NUM]
32
33echo "Downloading source for VIM $VERSION"
34cd $TMP
35curl -sO ftp://ftp.vim.org/pub/vim/unix/vim-${VERSION}.tar.bz2
36tar -xvf vim-${VERSION}.tar.bz2
37cp -R vim${SERIES} vim${SERIES}.orig
38
39echo -n "Generating Patch..."
40cd vim${SERIES}/src
41
42for PATCH in $(ls $PATCHDIR); do
43 patch -Np0 -i $PATCHDIR/$PATCH
44 # echo $PATCHDIR/$PATCH
45done
46
47cd $TMP
48
49# Create patch
50echo "Submitted By: Jonathan Norman (jonathan at bluesquarelinux dot co dot uk)" > vim-${VERSION}-branch_update-$UPDATE_NUM.patch
51echo "Date: `date +%Y-%m-%d`" >> vim-${VERSION}-branch_update-$UPDATE_NUM.patch
52echo "Initial Package Version: ${VERSION}" >> vim-${VERSION}-branch_update-$UPDATE_NUM.patch
53echo "Origin: Upstream" >> vim-${VERSION}-branch_update-$UPDATE_NUM.patch
54echo "Upstream Status: Applied" >> vim-${VERSION}-branch_update-$UPDATE_NUM.patch
55echo "Description: Contains all upstream patches up to ${VERSION}.${UPDATE_NUM}" >> vim-${VERSION}-branch_update-$UPDATE_NUM.patch
56echo "" >> vim-${VERSION}-branch_update-$UPDATE_NUM.patch
57
58LC_ALL=C TZ=UTC0 diff -Naur vim${SERIES}.orig vim${SERIES} >> vim-${VERSION}-branch_update-$UPDATE_NUM.patch
59
60echo "Done"
61echo "Cleaning up"
62rm -rf vim${SERIES} vim${SERIES}.orig #vim-${VERSION}.tar.bz2
63
64echo "Created: vim-${VERSION}-branch_update-$UPDATE_NUM.patch"
Note: See TracBrowser for help on using the repository browser.