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