@@ -34,10 +34,10 @@ echo "===check env end==="
34
34
PLAT=$2
35
35
ARCH=$3
36
36
37
- if [[ " $ARCH " == ' all' || " x$ARCH " == ' x' ]]; then
37
+ if [[ " $ARCH " == ' all' || " x$ARCH " == ' x' ]]; then
38
38
iOS_ARCHS=" x86_64 arm64"
39
39
macOS_ARCHS=" x86_64 arm64"
40
- elif [[ " $ARCH " == ' x86_64' || " $ARCH " == ' arm64' ]]; then
40
+ elif [[ " $ARCH " == ' x86_64' || " $ARCH " == ' arm64' ]]; then
41
41
iOS_ARCHS=" $ARCH "
42
42
macOS_ARCHS=" $ARCH "
43
43
else
47
47
48
48
function pull_common() {
49
49
echo " == pull $REPO_DIR base =="
50
- if [[ -d " $GIT_LOCAL_REPO " ]]; then
50
+ if [[ -d " $GIT_LOCAL_REPO " ]]; then
51
51
cd " $GIT_LOCAL_REPO "
52
52
[[ -d .git/rebase-apply ]] && git am --skip
53
53
git reset --hard
54
-
54
+
55
55
local origin=$( git remote get-url origin)
56
56
if [[ " $origin " != " $GIT_UPSTREAM " ]]; then
57
57
git remote remove origin
58
58
git remote add origin " $GIT_UPSTREAM "
59
59
echo " force update origin to: $GIT_UPSTREAM "
60
60
fi
61
- if [[ " $SKIP_PULL_BASE " ]]; then
61
+ if [[ " $SKIP_PULL_BASE " ]]; then
62
62
echo " skip pull $REPO_DIR because you set SKIP_PULL_BASE env."
63
63
else
64
64
git fetch --all --tags
65
65
fi
66
66
else
67
- if [[ " $SKIP_PULL_BASE " ]]; then
67
+ if [[ " $SKIP_PULL_BASE " ]]; then
68
68
echo " == local repo $REPO_DIR not exist,must clone by net firstly. =="
69
69
echo " try:unset SKIP_PULL_BASE"
70
70
exit -1
@@ -73,29 +73,28 @@ function pull_common() {
73
73
cd " $GIT_LOCAL_REPO "
74
74
fi
75
75
fi
76
-
76
+
77
77
# fix fatal: 'stable' is not a commit and a branch 'localBranch' cannot be created from it
78
- git checkout ${GIT_COMMIT} -B localBranch
79
- cd - > /dev/null
78
+ git checkout ${GIT_COMMIT} -B localBranch
79
+ cd - > /dev/null
80
80
}
81
81
82
- function apply_patches()
83
- {
84
- if [[ " $SKIP_FFMPEG_PATHCHES " && $REPO_DIR == ' ffmpeg' ]]; then
82
+ function apply_patches() {
83
+ if [[ " $SKIP_FFMPEG_PATHCHES " && $REPO_DIR == ' ffmpeg' ]]; then
85
84
echo " skip apply $REPO_DIR patches,because you set SKIP_FFMPEG_PATHCHES env."
86
- return
85
+ return
87
86
fi
88
87
89
88
local plat=" $1 "
90
89
local patch_dir=" ${TOOLS} /../extra/patches/$REPO_DIR "
91
90
92
- if [[ -d " ${patch_dir} _${plat} " ]]; then
91
+ if [[ -d " ${patch_dir} _${plat} " ]]; then
93
92
patch_dir=" ${patch_dir} _${plat} "
94
93
fi
95
- if [[ -d " $patch_dir " ]]; then
94
+ if [[ -d " $patch_dir " ]]; then
96
95
echo
97
96
echo " == Applying patches: $( basename $patch_dir ) → $( basename $PWD ) =="
98
- git am $patch_dir /* .patch
97
+ git am --keep $patch_dir /* .patch
99
98
if [[ $? -ne 0 ]]; then
100
99
echo ' Apply patches failed!'
101
100
git am --skip
@@ -110,12 +109,16 @@ function make_arch_repo() {
110
109
echo " == copy $REPO_DIR → $dest_repo =="
111
110
$TOOLS /copy-local-repo.sh $GIT_LOCAL_REPO $dest_repo
112
111
cd $dest_repo
113
- if [[ " $GIT_WITH_SUBMODULE " ]]; then
112
+ if [[ " $GIT_WITH_SUBMODULE " ]]; then
114
113
git submodule update --init --depth=1
115
114
fi
116
115
echo " last commit:" $( git log -1 --pretty=format:" [%h] %s:%ce %cd" )
116
+ if [[ -n " $IJK_VERSION " ]]; then
117
+ git tag " ff${GIT_COMMIT##*/ } -ijk$IJK_VERSION "
118
+ fi
117
119
apply_patches $1
118
- cd - > /dev/null
120
+ echo " tag:$( git describe --tags) "
121
+ cd - > /dev/null
119
122
}
120
123
121
124
function usage() {
@@ -125,55 +128,51 @@ function usage() {
125
128
126
129
function main() {
127
130
case " $1 " in
128
- iOS|ios)
129
- pull_common
130
- found=0
131
- for arch in $iOS_ARCHS
132
- do
133
- if [[ " $2 " == " $arch " || " x$2 " == " x" || " $2 " == " all" ]]; then
134
- found=1
135
- make_arch_repo ' ios' $arch
136
- fi
137
- done
138
-
139
- if [[ found -eq 0 ]]; then
140
- echo " unknown arch:$2 for $1 "
131
+ iOS | ios)
132
+ pull_common
133
+ found=0
134
+ for arch in $iOS_ARCHS ; do
135
+ if [[ " $2 " == " $arch " || " x$2 " == " x" || " $2 " == " all" ]]; then
136
+ found=1
137
+ make_arch_repo ' ios' $arch
141
138
fi
139
+ done
140
+
141
+ if [[ found -eq 0 ]]; then
142
+ echo " unknown arch:$2 for $1 "
143
+ fi
142
144
;;
143
-
144
- macOS|macos)
145
-
146
- pull_common
147
- found=0
148
- for arch in $macOS_ARCHS
149
- do
150
- if [[ " $2 " == " $arch " || " x$2 " == " x" || " $2 " == " all" ]]; then
151
- found=1
152
- make_arch_repo ' macos' $arch
153
- fi
154
- done
155
-
156
- if [[ found -eq 0 ]]; then
157
- echo " unknown arch:$2 for $1 "
145
+
146
+ macOS | macos)
147
+
148
+ pull_common
149
+ found=0
150
+ for arch in $macOS_ARCHS ; do
151
+ if [[ " $2 " == " $arch " || " x$2 " == " x" || " $2 " == " all" ]]; then
152
+ found=1
153
+ make_arch_repo ' macos' $arch
158
154
fi
155
+ done
156
+
157
+ if [[ found -eq 0 ]]; then
158
+ echo " unknown arch:$2 for $1 "
159
+ fi
159
160
;;
160
-
161
- all)
162
- pull_common
163
- for arch in $iOS_ARCHS
164
- do
165
- make_arch_repo ' ios' $arch
166
- done
167
-
168
- for arch in $macOS_ARCHS
169
- do
170
- make_arch_repo ' macos' $arch
171
- done
161
+
162
+ all)
163
+ pull_common
164
+ for arch in $iOS_ARCHS ; do
165
+ make_arch_repo ' ios' $arch
166
+ done
167
+
168
+ for arch in $macOS_ARCHS ; do
169
+ make_arch_repo ' macos' $arch
170
+ done
172
171
;;
173
-
174
- * )
175
- usage
176
- exit 1
172
+
173
+ * )
174
+ usage
175
+ exit 1
177
176
;;
178
177
esac
179
178
}
0 commit comments