source: scripts/patch/ncurses-patch.sh@ 21de86b

sysvinit
Last change on this file since 21de86b was 20a0aa0, checked in by Jonathan Norman <jon@…>, 13 years ago

Updated Ncurses branch update script generator

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