2012-03-30 01:25:15 +04:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
2017-12-07 21:24:41 +03:00
|
|
|
# assume $1 is the directory with a checkout of the libsctp source
|
2012-03-30 01:25:15 +04:00
|
|
|
#
|
2017-12-07 21:24:41 +03:00
|
|
|
# sctp usrlib source was available (via svn) at:
|
2012-03-30 01:25:15 +04:00
|
|
|
# svn co https://sctp-refimpl.googlecode.com/svn/trunk sctpSVN
|
2017-12-07 21:24:41 +03:00
|
|
|
# now available via git:
|
|
|
|
# git clone https://github.com/sctplab/usrsctp.git
|
2012-03-30 01:25:15 +04:00
|
|
|
#
|
|
|
|
# also assumes we've made *NO* changes to the SCTP sources! If we do, we have to merge by
|
|
|
|
# hand after this process, or use a more complex one.
|
|
|
|
#
|
|
|
|
# For example, one could update an sctp library import head, and merge back to default. Or keep a
|
|
|
|
# separate repo with this in it, and pull from there to m-c and merge.
|
|
|
|
if [ "$1" ] ; then
|
|
|
|
export date=`date`
|
2017-12-07 21:24:41 +03:00
|
|
|
export revision=`(cd $1; git rev-parse HEAD)`
|
2012-03-30 01:25:15 +04:00
|
|
|
|
2017-12-07 21:24:41 +03:00
|
|
|
cp $1/usrsctplib/*.c $1/usrsctplib/*.h netwerk/sctp/src
|
|
|
|
cp $1/usrsctplib/netinet/*.c $1/usrsctplib/netinet/*.h netwerk/sctp/src/netinet
|
|
|
|
cp $1/usrsctplib/netinet6/*.c $1/usrsctplib/netinet6/*.h netwerk/sctp/src/netinet6
|
2012-03-30 01:25:15 +04:00
|
|
|
|
|
|
|
hg addremove netwerk/sctp/src --include "**.c" --include "**.h" --similarity 90
|
|
|
|
|
2017-12-07 21:24:41 +03:00
|
|
|
echo "sctp updated to version $revision from git on $date" >> netwerk/sctp/sctp_update.log
|
|
|
|
echo "sctp updated to version $revision from git on $date"
|
|
|
|
echo "reapplying local patches:"
|
|
|
|
patch -p1 < netwerk/sctp/android.patch
|
2012-03-30 01:25:15 +04:00
|
|
|
else
|
2017-12-07 21:24:41 +03:00
|
|
|
echo "usage: $0 path_to_sctp_directory"
|
2012-03-30 01:25:15 +04:00
|
|
|
echo "run from the root of your m-c clone"
|
2017-12-07 21:24:41 +03:00
|
|
|
echo "example: sh netwerk/sctp/update.sh ../../sctp"
|
2012-03-30 01:25:15 +04:00
|
|
|
fi
|