-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathclone-src.sh
41 lines (31 loc) · 1.12 KB
/
clone-src.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
VERSION=$(cat ~/bromite/build/RELEASE)
CURRENT_RELEASE=$(git -C ~/chromium/src/ rev-parse --verify refs/tags/$VERSION)
for file in $(git -C ~/chromium/src/ show --pretty="" --name-only $CURRENT_RELEASE...HEAD); do
DIRNAME=$(dirname $file)
mkdir -p ~/mytests/$DIRNAME
git -C ~/chromium/src/ show $CURRENT_RELEASE:$file > ~/mytests/$file
done
git -C ~/mytests/ add .
git -C ~/mytests/ commit -m "$VERSION"
ALLPATCHS_E=$(git -C ~/chromium/src/ rev-list --reverse $CURRENT_RELEASE...HEAD)
for patch in $ALLPATCHS_E; do
for file in $(git -C ~/chromium/src/ show --pretty="" --name-only $patch); do
DIRNAME=$(dirname $file)
mkdir -p ~/mytests/$DIRNAME
#cp ~/chromium/src/$file ~/mytests/$file
#echo $file
OK=0
git -C ~/chromium/src/ show $patch:$file > ~/mytests/$file && OK=1
if [[ OK -eq 0 ]]; then
echo " Removing ~/mytests/$file"
rm ~/mytests/$file
fi
done
#echo $ALLFILES_E
#read -n 1
MESSAGE=$(git -C ~/chromium/src/ log --pretty=format:%s -n 1 $patch)
git -C ~/mytests/ add .
git -C ~/mytests/ commit -m "$MESSAGE"
#read -n 1
done