source: scripts/patch/ncurses-patch.sh@ b1a59a0

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since b1a59a0 was 2803d79, checked in by Jim Gifford <clfs@…>, 16 years ago

Fixes to Patch Creaters

  • Property mode set to 100755
File size: 3.1 KB
RevLine 
[06dcdf6]1#!/bin/bash
2# Create a Ncuruses Patch
3
4# Get Version #
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"
13fi
14
15# Get Patch Names
16#
17cd /usr/src
18wget ftp://invisible-island.net/ncurses/${VERSION}/ --no-remove-listing
19ROLLUP=$(cat index.html | grep bz2 | cut -f2 -d'>' | cut -f1 -d'<' | tail -n 1)
20ROLLPATCH=$(echo ${ROLLUP} | cut -f3 -d-)
21FILES=$(cat index.html | grep ${VERSION}-2 | grep patch.gz | cut -f2 -d'>' | cut -f1 -d'<')
22rm -f .listing
23rm -f index.html
24
25# Download Ncurses Source
26#
27if ! [ -e ncurses-${VERSION}.tar.gz ]; then
28 wget ftp://invisible-island.net/ncurses/ncurses-${VERSION}.tar.gz
29fi
30
31# Cleanup Directory
32#
33rm -rf ncurses-${VERSION} ncurses-${VERSION}.orig
34tar xvf ncurses-${VERSION}.tar.gz
35cp -ar ncurses-${VERSION} ncurses-${VERSION}.orig
36cd ncurses-${VERSION}
37
38# Download and Apply Rollup Patch
39#
40CURRENTDIR=$(pwd -P)
41mkdir /tmp/ncurses-${VERSION}
42cd /tmp/ncurses-${VERSION}
43if [ "${ROLLUP}" != "" ]; then
44 echo "Getting Rollup ${ROLLUP} Patch..."
45 wget --quiet ftp://invisible-island.net/ncurses/${VERSION}/${ROLLUP}
46 cd ${CURRENTDIR}
47 echo "Applying Rollup ${ROLLUP} Patch..."
48 cp /tmp/ncurses-${VERSION}/${ROLLUP} ${CURRENTDIR}/${ROLLUP}
49 bunzip2 ${ROLLUP}
50 ROLLUP2=$(echo ${ROLLUP} | sed -e 's/.bz2//g')
51 sh ${ROLLUP2}
52fi
53
54# Download and Apply Patches
55#
56for file in ${FILES}; do
57 if [ "${ROLLPATCH}" != "" ]; then
58 TEST=$(echo ${file} | grep -c ${ROLLPATCH})
59 else
60 TEST=0
61 fi
62 if [ "${TEST}" = "0" ]; then
63 cd /tmp/ncurses-${VERSION}
64 echo "Getting Patch ${file}..."
65 wget --quiet ftp://invisible-island.net/ncurses/${VERSION}/${file}
66 cd ${CURRENTDIR}
67 gunzip -c /tmp/ncurses-${VERSION}/${file} | patch --dry-run -s -f -Np1
68 if [ "$?" = "0" ]; then
69 echo "Apply Patch ${file}..."
70 gunzip -c /tmp/ncurses-${VERSION}/${file} | patch -Np1
71 LASTFILE=$(echo ${file} | cut -f2 -d. | cut -f2 -d-)
72 fi
73 fi
74done
75
76# Cleanup Directory
77#
[c0d5090]78# Cleanup Directory
79#
80for dir in $(find * -type d); do
81 cd /usr/src/ncurses-${VERSION}/${dir}
[2803d79]82 for file in $(find . -name '*~'); do
[c0d5090]83 rm -f ${file}
84 done
[2803d79]85 for file in $(find . -name '*.orig'); do
[c0d5090]86 rm -f ${file}
87 done
[06dcdf6]88done
[e91eb56]89cd /usr/src/ncurses-${VERSION}
[2803d79]90rm -f *~ *.orig
[06dcdf6]91
92# Create Patch
93#
94cd /usr/src
[c94176e]95echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > ncurses-${VERSION}-branch_update-x.patch
[06dcdf6]96echo "Date: `date +%m-%d-%Y`" >> ncurses-${VERSION}-branch_update-x.patch
97echo "Initial Package Version: ${VERSION}" >> ncurses-${VERSION}-branch_update-x.patch
98echo "Origin: Upstream" >> ncurses-${VERSION}-branch_update-x.patch
99echo "Upstream Status: Applied" >> ncurses-${VERSION}-branch_update-x.patch
100echo "Description: This is a branch update for NCurses-${VERSION}, and should be" >> ncurses-${VERSION}-branch_update-x.patch
101echo " rechecked periodically. This patch covers up to ${VERSION}-${LASTFILE}." >> ncurses-${VERSION}-branch_update-x.patch
102echo "" >> ncurses-${VERSION}-branch_update-x.patch
103diff -Naur ncurses-${VERSION}.orig ncurses-${VERSION} >> ncurses-${VERSION}-branch_update-x.patch
104echo "Created /usr/src/ncurses-${VERSION}-branch_update-x.patch."
Note: See TracBrowser for help on using the repository browser.