xref: /minix3/releasetools/netbsd-resync.sh (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc#!/bin/sh
2*0a6a1f1dSLionel Sambuc: ${BUILDSH=build.sh}
3*0a6a1f1dSLionel Sambuc
4*0a6a1f1dSLionel Sambucif [ ! -f ${BUILDSH} ]
5*0a6a1f1dSLionel Sambucthen
6*0a6a1f1dSLionel Sambuc	echo "Please invoke me from the root source dir, where ${BUILDSH} is."
7*0a6a1f1dSLionel Sambuc	exit 1
8*0a6a1f1dSLionel Sambucfi
9*0a6a1f1dSLionel Sambuc
10*0a6a1f1dSLionel Sambucif [ -z "${NETBSD_BRANCH}" ]
11*0a6a1f1dSLionel Sambucthen
12*0a6a1f1dSLionel Sambuc	echo "NETBSD_BRANCH is undefined."
13*0a6a1f1dSLionel Sambuc	exit 1
14*0a6a1f1dSLionel Sambucfi
15*0a6a1f1dSLionel Sambuc
16*0a6a1f1dSLionel Sambucfind . -type f    | cut -c 3-   | grep -v '\.git' | grep -v '\./minix' | sort -u > files.all
17*0a6a1f1dSLionel Sambucgit grep -i minix | cut -d: -f1 | grep -v '\.git' | grep -v '\./minix' | sort -u > files.minix
18*0a6a1f1dSLionel Sambucdiff files.all files.minix |grep '^<'| cut -c 3- > files.netbsd
19*0a6a1f1dSLionel Sambuc
20*0a6a1f1dSLionel Sambucwhile read file
21*0a6a1f1dSLionel Sambucdo
22*0a6a1f1dSLionel Sambuc    git checkout ${NETBSD_BRANCH} ${file}
23*0a6a1f1dSLionel Sambucdone < files.netbsd
24*0a6a1f1dSLionel Sambuc
25