|
2 | 2 |
|
3 | 3 | # Update the fetch-poky.sh script |
4 | 4 | FILE="scripts/fetch-poky.sh" |
5 | | -TMP_FILE="tmp.txt" |
6 | | -tail -n +6 $FILE > $TMP_FILE |
7 | | - |
8 | | -echo "#!/bin/bash" > $FILE |
9 | | -echo "" >> $FILE |
10 | | - |
11 | | -git clone --depth 1 --filter=blob:none --sparse https://github.com/yoctoproject/poky.git |
12 | | -cd poky |
13 | | -git fetch --tags |
14 | | -TMP_TAG=$(git tag | grep "yocto-" | tail -n 1) # There is a tag: yocto_1.5_M5.rc8 which will take the tail, thus adding a hyphen |
15 | | -LASTEST_RELEASE=$(git show $TMP_TAG | grep commit | sed "s/^commit //") |
16 | | -echo "# Tag: $TMP_TAG" >> ../$FILE |
17 | | -echo "COMMIT=$LASTEST_RELEASE" >> ../$FILE |
18 | | -echo "" >> ../$FILE |
19 | | -cd .. |
20 | | -rm -rf poky |
21 | | - |
22 | | -cat $TMP_FILE >> $FILE |
23 | | -rm $TMP_FILE |
| 5 | +LATEST_REF=$(git ls-remote --tags https://github.com/yoctoproject/poky.git | grep "yocto-" | tail -n 1) |
| 6 | +LATEST_COMMIT=$(echo $LATEST_REF | awk '{print $1}') |
| 7 | +LATEST_TAG=$(echo $LATEST_REF | awk '{print $2}' | sed -e "s/refs\\/tags\\///" -e "s/\^.*//") |
| 8 | +sed -i $FILE \ |
| 9 | + -e "s/^\(# Tag: \).*/\1$LATEST_TAG/" \ |
| 10 | + -e "s/^\(COMMIT=\).*/\1$LATEST_COMMIT/" |
24 | 11 |
|
25 | 12 | # Update the version.ts |
26 | | -DEST="integration-tests/src/utils/version.ts" |
27 | | - |
28 | | -# Keep the header |
29 | | -TOTAL_LINES=$(wc -l < $DEST) |
30 | | -LINES_TO_KEEP=$(($TOTAL_LINES - 2)) |
31 | | -TMP="tmp.ts" |
32 | | -head -n $LINES_TO_KEEP $DEST > $TMP |
| 13 | +FILE="integration-tests/src/utils/version.ts" |
33 | 14 |
|
34 | | -git clone --depth 1 --filter=blob:none --sparse https://github.com/bash-lsp/bash-language-server |
35 | | -cd bash-language-server |
36 | | -git fetch --tags |
37 | | -echo "export const bashVersion = '$(git tag --sort=-v:refname | head -n 1 | sed "s/^vscode-client-//")'" >> ../$TMP |
38 | | -cd .. |
39 | | -rm -rf bash-language-server |
| 15 | +LATEST_COMMIT=$(git ls-remote --refs --sort=-v:refname https://github.com/bash-lsp/bash-language-server | grep client | head -n 1 | awk '{print $2}' | sed s/refs\\/tags\\/vscode-client-//) |
| 16 | +sed -e "s/^\(export const bashVersion =\).*/\1 '$LATEST_COMMIT'/" -i $FILE |
40 | 17 |
|
41 | | -git clone --depth 1 --filter=blob:none --sparse https://github.com/Microsoft/vscode-python |
42 | | -cd vscode-python |
43 | | -git fetch --tags |
44 | | -echo "export const pythonVersion = '$(git tag --sort=-v:refname | head -n 1 | sed "s/^v//")'" >> ../$TMP |
45 | | -cd .. |
46 | | -rm -rf vscode-python |
47 | | - |
48 | | -cp $TMP $DEST |
49 | | -rm $TMP |
| 18 | +LATEST_COMMIT=$(git ls-remote --refs --sort=-v:refname https://github.com/Microsoft/vscode-python | head -n 1 | awk '{print $2}' | sed s/refs\\/tags\\/v//) |
| 19 | +sed -e "s/^\(export const pythonVersion =\).*/\1 '$LATEST_COMMIT'/" -i $FILE |
50 | 20 |
|
51 | 21 | # Update the fetch-docs.sh script |
52 | 22 | FILE="scripts/fetch-docs.sh" |
53 | | -TMP_FILE="tmp.txt" |
54 | | -tail -n +8 $FILE > $TMP_FILE |
55 | | - |
56 | | -echo "#!/bin/bash" > $FILE |
57 | | -echo "" >> $FILE |
58 | 23 |
|
59 | | -git clone --depth 1 --filter=blob:none --sparse https://github.com/openembedded/bitbake.git |
60 | | -cd bitbake |
61 | | -git fetch --tags |
62 | | -TMP_TAG=$(git tag --sort=-v:refname | head -n 1) |
63 | | -LASTEST_RELEASE=$(git show $TMP_TAG | grep commit | sed "s/^commit //") |
64 | | -echo "# Tag: $TMP_TAG" >> ../$FILE |
65 | | -echo "BITBAKE_DOCS_COMMIT=$LASTEST_RELEASE" >> ../$FILE |
66 | | -cd .. |
67 | | -rm -rf bitbake |
| 24 | +LATEST_REF=$(git ls-remote --refs --sort=-v:refname https://github.com/openembedded/bitbake.git | head -n 1) |
| 25 | +LATEST_COMMIT=$(echo $LATEST_REF | awk '{print $1}') |
| 26 | +LATEST_TAG=$(echo $LATEST_REF | awk '{print $2}' | sed s/refs\\/tags\\///) |
| 27 | +sed -i $FILE \ |
| 28 | + -e "s/^\(# Tag: \).*/\1$LATEST_TAG/" \ |
| 29 | + -e "s/^\(BITBAKE_DOCS_COMMIT=\).*/\1$LATEST_COMMIT/" |
68 | 30 |
|
69 | | -git clone --depth 1 --filter=blob:none --sparse https://git.yoctoproject.org/yocto-docs |
70 | | -cd yocto-docs |
71 | | -git fetch --tags |
72 | | -TMP_TAG=$(git tag --sort=-v:refname | head -n 1) |
73 | | -LASTEST_RELEASE=$(git show $TMP_TAG | grep commit | sed "s/^commit //") |
74 | | -echo "# Tag: $TMP_TAG" >> ../$FILE |
75 | | -echo "YOCTO_DOCS_COMMIT=$LASTEST_RELEASE" >> ../$FILE |
76 | | -echo "" >> ../$FILE |
77 | | -cd .. |
78 | | -rm -rf yocto-docs |
| 31 | +LATEST_REF=$(git ls-remote --refs --sort=-v:refname https://git.yoctoproject.org/yocto-docs | head -n 1) |
| 32 | +LATEST_COMMIT=$(echo $LATEST_REF | awk '{print $1}') |
| 33 | +LATEST_TAG=$(echo $LATEST_REF | awk '{print $2}' | sed s/refs\\/tags\\///) |
| 34 | +sed -i $FILE \ |
| 35 | + -e "s/^\(# Tag: \).*/\1$LATEST_TAG/" \ |
| 36 | + -e "s/^\(YOCTO_DOCS_COMMIT=\).*/\1$LATEST_COMMIT/" |
79 | 37 |
|
80 | | -git clone --depth 1 --filter=blob:none --sparse https://github.com/microsoft/vscode.git |
81 | | -cd vscode |
82 | | -git fetch --tags |
83 | | -TMP_TAG=$(git tag --sort=-v:refname | grep -E '^[0-9.]+$' | head -n 1) |
84 | | -sed -e "s/vscodeVersion = '.*'/vscodeVersion = '$TMP_TAG'/" -i ../integration-tests/src/runTest.ts |
85 | | -cd .. |
86 | | -rm -rf vscode |
| 38 | +# Update vscodeVersion in runTest.ts |
| 39 | +FILE="integration-tests/src/runTest.ts" |
87 | 40 |
|
88 | | -cat $TMP_FILE >> $FILE |
89 | | -rm $TMP_FILE |
| 41 | +LATEST_TAG=$(git ls-remote --tags --sort=-v:refname https://github.com/microsoft/vscode.git | grep "refs/tags/[0-9.]" | head -n 1 | awk '{print $2}' | sed s/refs\\/tags\\///) |
| 42 | +sed -e "s/vscodeVersion = '.*'/vscodeVersion = '$LATEST_TAG'/" -i $FILE |
90 | 43 |
|
91 | 44 | # Update the fetch-spdx-licenses.sh script |
92 | 45 | FILE="scripts/fetch-spdx-licenses.sh" |
93 | | -TMP_FILE="tmp.txt" |
94 | | -tail -n +5 $FILE > $TMP_FILE |
95 | | - |
96 | | -echo "#!/bin/bash" > $FILE |
97 | | -echo "" >> $FILE |
98 | 46 |
|
99 | | -git clone --depth 1 --filter=blob:none --sparse https://github.com/spdx/license-list-data.git |
100 | | -cd license-list-data |
101 | | -git fetch --tags |
102 | | -TMP_TAG=$(git tag --sort=-v:refname | head -n 1) |
103 | | -LATEST_RELEASE=$(git show $TMP_TAG | grep commit -m 1 | sed "s/^commit //") |
104 | | -echo "# Tag: $TMP_TAG" >> ../$FILE |
105 | | -echo "SPDX_LICENSES_COMMIT=$LATEST_RELEASE" >> ../$FILE |
106 | | -cd .. |
107 | | -rm -rf license-list-data |
| 47 | +LATEST_REF=$(git ls-remote --refs --sort=-v:refname https://github.com/spdx/license-list-data.git | head -n 1) |
| 48 | +LATEST_COMMIT=$(echo $LATEST_REF | awk '{print $1}') |
| 49 | +LATEST_TAG=$(echo $LATEST_REF | awk '{print $2}' | sed s/refs\\/tags\\///) |
| 50 | +sed -i $FILE \ |
| 51 | + -e "s/^\(# Tag: \).*/\1$LATEST_TAG/" \ |
| 52 | + -e "s/^\(SPDX_LICENSES_COMMIT=\).*/\1$LATEST_COMMIT/" |
108 | 53 |
|
109 | | -cat $TMP_FILE >> $FILE |
110 | | -rm $TMP_FILE |
0 commit comments