[3139927] | 1 | #!/bin/bash
|
---|
| 2 | # Create a uClibc Patch
|
---|
| 3 |
|
---|
| 4 | # Get Version #
|
---|
| 5 | #
|
---|
| 6 | VERSION=$1
|
---|
[f5994ee] | 7 | SOURCEVERSION=$2
|
---|
[3139927] | 8 |
|
---|
| 9 | # Check Input
|
---|
| 10 | #
|
---|
[f5994ee] | 11 | if [ "${VERSION}" = "" -o "${SOURCEVERSION}" = "" ]; then
|
---|
[3139927] | 12 | echo "$0 - uClibc_Version"
|
---|
[f5994ee] | 13 | echo "This will Create a Patch for uClibc uClibc_Series uClibc_Version"
|
---|
| 14 | echo "Example $0 0.9.30 0.9.30.1"
|
---|
[3139927] | 15 | exit 255
|
---|
| 16 | fi
|
---|
| 17 |
|
---|
| 18 | # Download uClibc Source
|
---|
| 19 | #
|
---|
| 20 | cd /usr/src
|
---|
[f5994ee] | 21 | if ! [ -e uClibc-${SOURCEVERSION}.tar.bz2 ]; then
|
---|
| 22 | wget http://www.uclibc.org/downloads/uClibc-${SOURCEVERSION}.tar.bz2
|
---|
[3139927] | 23 | fi
|
---|
| 24 |
|
---|
[ea546c8] | 25 | # Set Patch Number
|
---|
| 26 | #
|
---|
| 27 | cd /usr/src
|
---|
| 28 | wget http://svn.cross-lfs.org/svn/repos/cross-lfs/branches/clfs-embedded/patches/ --no-remove-listing
|
---|
[f5994ee] | 29 | PATCH_NUM=$(cat index.html | grep uClibc | grep "${SOURCEVERSION}" | grep branch_update | cut -f2 -d'"' | cut -f1 -d'"'| cut -f4 -d- | cut -f1 -d. | tail -n 1)
|
---|
[ea546c8] | 30 | PATCH_NUM=$(expr ${PATCH_NUM} + 1)
|
---|
| 31 | rm -f index.html
|
---|
| 32 |
|
---|
[3139927] | 33 | # Cleanup Directory
|
---|
| 34 | #
|
---|
[f5994ee] | 35 | rm -rf uClibc-${SOURCEVERSION} uClibc-${SOURCEVERSION}.orig
|
---|
| 36 | tar xvf uClibc-${SOURCEVERSION}.tar.bz2
|
---|
| 37 | mv uClibc-${SOURCEVERSION} uClibc-${SOURCEVERSION}.orig
|
---|
[3139927] | 38 | CURRENTDIR=$(pwd -P)
|
---|
| 39 |
|
---|
| 40 | # Get Current Updates from SVN
|
---|
| 41 | #
|
---|
| 42 | cd /usr/src
|
---|
| 43 | FIXEDVERSION=$(echo ${VERSION} | sed -e 's/\./_/g')
|
---|
[f5994ee] | 44 | svn export svn://uclibc.org/branches/uClibc_${FIXEDVERSION} uClibc-${SOURCEVERSION}
|
---|
[3139927] | 45 |
|
---|
| 46 | # Create Patch
|
---|
| 47 | #
|
---|
| 48 | cd /usr/src
|
---|
[f5994ee] | 49 | echo "Submitted By: Jim Gifford (jim at cross-lfs dot org)" > uClibc-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
|
---|
| 50 | echo "Date: `date +%m-%d-%Y`" >> uClibc-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
|
---|
| 51 | echo "Initial Package Version: ${SOURCEVERSION}" >> uClibc-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
|
---|
| 52 | echo "Origin: Upstream" >> uClibc-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
|
---|
| 53 | echo "Upstream Status: Applied" >> uClibc-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
|
---|
| 54 | echo "Description: This is a branch update for uClibc-${SOURCEVERSION}, and should be" >> uClibc-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
|
---|
| 55 | echo " rechecked periodically." >> uClibc-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
|
---|
| 56 | echo "" >> uClibc-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
|
---|
| 57 | diff -Naur uClibc-${SOURCEVERSION}.orig uClibc-${SOURCEVERSION} >> uClibc-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch
|
---|
| 58 | echo "Created /usr/src/uClibc-${SOURCEVERSION}-branch_update-${PATCH_NUM}.patch."
|
---|