-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathimport.sh
executable file
·78 lines (68 loc) · 1.46 KB
/
import.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
FROM=$(pwd)
# defaults. Override where necessary.
linus()
{
GIT_AUTHOR_EMAIL="[email protected]"
GIT_AUTHOR_NAME="Linus Torvalds"
GIT_COMMITTER_EMAIL="[email protected]"
GIT_COMMITTER_NAME="Linus Torvalds"
}
import()
{
VERSION=$1
if [ ! -z "$2" ]; then
DATE=$2
else
# This is just placeholder stuff until every import is annotated.
DATE=$(date -R)
fi
echo importing $VERSION
git apply --whitespace=nowarn $FROM/diffs/linux-$VERSION.diff
if [ $? -ne "0" ]; then
echo something bad happened.
exit
fi
git add --all
for i in $(git status | grep deleted: |sed s/#// | sed s/deleted://)
do
git rm --ignore-unmatch --quiet $i
done
find . -type f -empty -exec git rm -f "{}" \;
git update-index --add
git update-index --remove
if [ -f $FROM/changelogs/$VERSION.txt ]; then
git commit -F $FROM/changelogs/$VERSION.txt --date="$DATE"
else
git commit -m "Import $VERSION" --date="$DATE"
fi
git tag $VERSION
echo
}
if [ ! -d unpack ]; then
echo run from wrong dir.
exit
else
cd unpack
fi
# Set up the initial tree.
rm -rf linux-git
cp -rl linux-0.01 linux-git
cd linux-git
linus
git init .
git add --all
git commit -a -F $FROM/changelogs/0.01.txt --date="Tue Sep 17 17:29:55 1991 +0000"
# Now start applying patches.
. $FROM/import-0.x.sh
. $FROM/import-1.x.sh
. $FROM/import-2.0.sh
. $FROM/import-2.1.sh
. $FROM/import-2.2.sh
. $FROM/import-2.3.sh
import_0_x
import_1_x
import_2_0
import_2_1
import_2_2
import_2_3