pastebin - collaborative debugging tool
eckelmann.kpaste.net RSS

Difference between
modified post 77d by Anonymous on Fri 7th Feb 2020 16:22
original post c0b73 by Anonymous on Fri 7th Feb 2020 15:29
Download diff
Show old version | new version | both versions

    
11
#!/bin/ksh93
22
33
#
44
# merge Rauchs Subversion tree into our git,
55
# one patch at the time
66
#
77
88
set -o xtrace
99
set -o errexit
1010
set -o pipefail
1111
1212
which bunzip2	|| exit 1
1313
which git	|| exit 1
1414
which realpath	|| exit 1
1515
which svn	|| exit 1
1616
which svnadmin	|| exit 1
1717
which svnrdump	|| exit 1
1818
1919
2020
builtin chmod	|| exit 1
2121
#builtin ln	|| exit 1 # broken Debian ksh93 package config, grrr...
2222
builtin mkdir	|| exit 1
2323
builtin printf	|| exit 1
2424
#builtin rm	|| exit 1 # broken Debian ksh93 package config, grrr...
2525
builtin wc	|| exit 1
2626
2727
2828
# clean data from previous run
2929
rm -Rf gitsvnclone1 svnstore convertedsrc compare_oldnew
3030
3131
3232
# squish locale settings, we need the POSIX defaults
3333
if [[ "${!LC_*}" != '' ]] ; then
3434
	unset "${!LC_@}"
3535
fi
3636
unset LANG
3737
export LANG='POSIX'
3838
3939
typeset -r infile='rauch_svndump20200128.svndump.bz2'
4040
4141
typeset -r basedir="$PWD"
4242
compound svninfo
4343
4444
[[ ! -f "${infile}" ]] && exit 1
4545
[[ ! -r "${infile}" ]] && exit 1
4646
4747
# create empty SVN repository
4848
svnadmin create svnstore
4949
# add dummy hook to allow property changes for "svnrdump load"
5050
printf '#!/bin/sh\nexit 0\n' >'svnstore/hooks/pre-revprop-change'
5151
chmod a+x 'svnstore/hooks/pre-revprop-change'
5252
5353
bunzip2 -c <"${infile}" | svnrdump load "file://$basedir/svnstore/"
5454
5555
# get HEAD revision (number) from svn repository
5656
integer svninfo.revision
5757
svninfo.cmdout="$(svn info "file://$basedir/svnstore")"
5858
dummy="${svninfo.cmdout/~(E)Revision:[[:space:]]+([[:digit:]]+)/ }"
5959
(( svninfo.revision=.sh.match[1] ))
6060
6161
printf '# Subversion info:\n'
6262
print -v svninfo
6363
6464
mkdir 'gitsvnclone1'
6565
cd 'gitsvnclone1'
6666
git svn clone "file://$basedir/svnstore"
6767
6868
ls -lad 'svnstore/trunk/projekt/ptxdist/'
6969
7070
7171
cd 'svnstore/trunk/projekt/ptxdist/'
7272
7373
# extract all patches from git repository previously
7474
# stored by "git svn" there
7575
git format-patch -$(( svninfo.revision+1 ))
7676
7777
# remove patch files which are empty
7878
(for i in *.patch ; do if [[ ! -s "$i" ]] ; then rm -- "$i" ; fi ; done)
7979
8080
# list remaining patches
8181
IFS=$'\n' ; typeset -a patchlist=( $(ls -1ad $PWD/*.patch ) )
8282
printf '\n#### Patches:\n'
8383
printf '%q\n' "${patchlist[@]}"
8484
printf '\n#### Number of patches: %d\n' "$(wc -l <<<"$patchlist")"
8585
8686
cd "$basedir"
8787
mkdir 'convertedsrc'
8888
cd 'convertedsrc'
8989
9090
printf '%s\n' "${patchlist[@]}" | sort -n | while read i ; do
9191
	# 1. use "|| true" to circumvent -o errexit for now since
9292
	# GNU patch does not support GIT binary patches and returns
9393
	# a non-0 exit code for such patches
94-
	# 2. use --force to avoid interactive queries about binary patches
94+
	# 2. use --force to avoid interactive queries about GIT binary patches
9595
	patch -p3 --force <"$i" || true
9696
done
9797
9898
cd "$basedir"
9999
mkdir 'compare_oldnew'
100100
cd 'compare_oldnew'
101101
(mkdir 'old' && cd 'old' && svn export "file://$basedir/svnstore/trunk/projekt/ptxdist")
102102
mkdir new
103103
ln -s '../../convertedsrc/ptxdist' 'new/.'
104104
105105
cd "$basedir"
106106
(diff -r -u 'compare_oldnew/old/ptxdist/' 'compare_oldnew/new/ptxdist/' || true) 2>&1 |
107-
	egrep -v '^Only in .+(barebox-image|bareboxenv|libEMC|lin|\.(app|png|jpg|jpeg|gz|bin|iop|pdf|so\..+|crc|vtg))$'
107+
	egrep -v '^Only in compare_oldnew/old/.+: (ecu-jobctl-demo|barebox-image|bareboxenv|libEMC|lin|.+\.(app|png|jpg|jpeg|gz|bin|iop|pdf|so\.[[:digit:]]+.+|crc|vtg))$'
108108
109109
110110
printf '# DONE!\n'
111111
exit 0
112112
# EOF.
113113

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at