Skip to content

Commit

Permalink
Merge pull request #200 from arkedge/develop
Browse files Browse the repository at this point in the history
Update main (v4.0.1) on 2023-11-09
  • Loading branch information
sksat authored Nov 9, 2023
2 parents 3481aba + 4a8177a commit 059c679
Show file tree
Hide file tree
Showing 17 changed files with 273 additions and 174 deletions.
4 changes: 4 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@
- name: "WINGS"
description: ""
color: "1503bb"

- name: "Gaia"
description: ""
color: "0052cc"
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

注意: これは既存の C2A core update の「リリースの間の Pull Request を眺めてなんとなく察する」という曖昧な操作を緩和していくための試みであり,C2A user に対するお知らせを行う場として使っていくことを意図しています.初めから c2a-core の全変更を取り扱うと不必要に煩雑になるだけになってしまうため,完全な変更内容の一覧についてはこれまで通り [GitHub Releases](https://github.com/arkedge/c2a-core/releases) などから参照してください.

## v4.0.1 (2023-11-09)

### Fixed

- [#180](https://github.com/arkedge/c2a-core/pull/180): Refactor v4 IfWrapper migration script
- [#182](https://github.com/arkedge/c2a-core/pull/182): Refactor v4 migration script

### Internal

- [#185](https://github.com/arkedge/c2a-core/pull/185): Add Gaia label

## v4.0.0 (2023-11-02)

[arkedge/c2a-core](https://github.com/arkedge/c2a-core) v4.0.0 は ArkEdge Space Inc. による C2A の先行開発のための [ut-issl/c2a-core](https://github.com/ut-issl/c2a-core) の fork 後最初のリリースとなる.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace.package]
version = "4.0.0"
version = "4.0.1"

[workspace]
resolver = "2"
Expand Down
2 changes: 1 addition & 1 deletion c2a_core_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ void C2A_core_main(void);
// 詳細: docs/general/release.md
#define C2A_CORE_VER_MAJOR (4)
#define C2A_CORE_VER_MINOR (0)
#define C2A_CORE_VER_PATCH (0)
#define C2A_CORE_VER_PATCH (1)
#define C2A_CORE_VER_PRE ("")

#endif
10 changes: 9 additions & 1 deletion script/migration/v4-move-db-dir.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/bin/bash

echo "Move tlm-cmd-db to C2A user root directory"

function find_all() {
find . -name "*" -not \( -path "*/.git/*" -o -path "*/src_core/*" -o -path "*.xlsm" \) -type f -print0
}

echo " <C2A user>/src/src_user/settings/tlm_cmd/data_base -> <C2A user>/tlm-cmd-db"
mv ./src/src_user/settings/tlm_cmd/data_base ./tlm-cmd-db

find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#src/src_user/settings/tlm_cmd/data_base#tlm-cmd-db#g"
echo " rename tlmcbddb path ref"
find_all | xargs -0 sed -i -e "s#src/src_user/settings/tlm_cmd/data_base#tlm-cmd-db#g"
51 changes: 32 additions & 19 deletions script/migration/v4-rename-applications.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
#!/bin/bash
# Script -> script
echo "Script -> script migration"

function find_all() {
find . -name "*" -not \( -path "*/.git/*" -o -path "*/src_core/*" -o -path "*.xlsm" \) -type f -print0
}

## c2a-core ref
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#src_core/Applications/TestApp#src_core/applications/test_app#g"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#src_core\\\Applications\\\TestApp#src_core\\\applications\\\test_app#g"
echo "rename c2a-core ref: src_core/Applications/* -> src_core/applications/*"
find_all | xargs -0 sed -i -e "s#src_core/Applications/TestApp#src_core/applications/test_app#g"
find_all | xargs -0 sed -i -e "s#src_core\\\Applications\\\TestApp#src_core\\\applications\\\test_app#g"

find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#src_core/Applications#src_core/applications#g"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#src_core\\\Applications#src_core\\\applications#g"
find_all | xargs -0 sed -i -e "s#src_core/Applications#src_core/applications#g"
find_all | xargs -0 sed -i -e "s#src_core\\\Applications#src_core\\\applications#g"

find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#\${C2A_CORE_DIR}/Applications#\${C2A_CORE_DIR}/applications#g"
find_all | xargs -0 sed -i -e "s#\${C2A_CORE_DIR}/Applications#\${C2A_CORE_DIR}/applications#g"

# C2A user code
user_defined_org=("Aocs" "Cdh" "Com" "Etc" "Mission" "Power" "Prop" "Thermal")
user_defined_new=("aocs" "cdh" "com" "etc" "mission" "power" "prop" "thermal")

echo "rename dir: src_user/Applications/ -> src_user/applications/"
mv src/src_user/Applications src/src_user/applications

echo "rename dir: src_user/applications/*"
mv src/src_user/applications/DriverInstances src/src_user/applications/driver_instances
mv src/src_user/applications/Middleware src/src_user/applications/middleware
mv src/src_user/applications/UserDefined src/src_user/applications/user_defined
Expand All @@ -27,42 +34,48 @@ for ((i=0; i<${#user_defined_org[@]}; i++)); do
mv "src/src_user/applications/user_defined/${user_defined_org[i]}" "src/src_user/applications/user_defined/${user_defined_new[i]}"
done

find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#Applications/DriverInstances#applications/driver_instances#g"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#Applications\\\DriverInstances#applications\\\driver_instances#g"
echo "rename ref: Applications/*"

find_all | xargs -0 sed -i -e "s#Applications/DriverInstances#applications/driver_instances#g"
find_all | xargs -0 sed -i -e "s#Applications\\\DriverInstances#applications\\\driver_instances#g"

find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#Applications/Middleware#applications/middleware#g"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#Applications\\\Middleware#applications\\\middleware#g"
find_all | xargs -0 sed -i -e "s#Applications/Middleware#applications/middleware#g"
find_all | xargs -0 sed -i -e "s#Applications\\\Middleware#applications\\\middleware#g"

find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#Applications/UserDefined#applications/user_defined#g"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#Applications\\\UserDefined#applications\\\user_defined#g"
find_all | xargs -0 sed -i -e "s#Applications/UserDefined#applications/user_defined#g"
find_all | xargs -0 sed -i -e "s#Applications\\\UserDefined#applications\\\user_defined#g"

find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#/Applications#/applications#g"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#\\\Applications#\\\applications#g"
find_all | xargs -0 sed -i -e "s#/Applications#/applications#g"
find_all | xargs -0 sed -i -e "s#\\\Applications#\\\applications#g"

# CMake
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#DriverInstances/#driver_instances/#g"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#Middleware/#middleware/#g"
find_all | xargs -0 sed -i -e "s#DriverInstances/#driver_instances/#g"
find_all | xargs -0 sed -i -e "s#Middleware/#middleware/#g"

echo "rename ref: UserDefined"
for ((i=0; i<${#user_defined_org[@]}; i++)); do
echo " ${user_defined_org[i]} -> ${user_defined_new[i]}"

find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#UserDefined/${drv_org[i]}#user_defined/${drv_new[i]}#g"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#UserDefined\\\${drv_org}#user_defined\\\${drv_new}#g"
find_all | xargs -0 sed -i -e "s#UserDefined/${drv_org[i]}#user_defined/${drv_new[i]}#g"
find_all | xargs -0 sed -i -e "s#UserDefined\\\${drv_org}#user_defined\\\${drv_new}#g"
done

find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#UserDefined/#user_defined/#g"
find_all | xargs -0 sed -i -e "s#UserDefined/#user_defined/#g"

# Settings
echo "rename dir: src_user/Settings/Applications -> src_user/Settings/applications"
mv src/src_user/Settings/Applications src/src_user/Settings/applications

# Test
echo "rename dir: src_user/Test/test/src_core/Applications -> src_user/Test/test/src_core/applications"
mv src/src_user/Test/test/src_core/Applications src/src_user/Test/test/src_core/applications

echo "rename dir: src_user/Test/test/src_user/Applications -> src_user/Test/test/src_user/applications"
mv src/src_user/Test/test/src_user/Applications src/src_user/Test/test/src_user/applications
mv src/src_user/Test/test/src_user/Applications/DriverInstances src/src_user/Test/test/src_user/applications/driver_instances
mv src/src_user/Test/test/src_user/Applications/Middleware src/src_user/Test/test/src_user/applications/middleware
mv src/src_user/Test/test/src_user/Applications/UserDefined src/src_user/Test/test/src_user/applications/user_defined

# Script
echo "rename ref in script: Applications -> applications"
find src/src_user/script -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#Applications#applications#g"
19 changes: 10 additions & 9 deletions script/migration/v4-rename-component-driver-prefix.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash
# driver instances -> Component Service
echo "driver instances -> Component Service migration"

function find_all() {
find . -name "*" -not \( -path "*/.git/*" -o -path "*/src_core/*" -o -path "*.xlsm" \) -type f -print0
}

## c2a-core ref
header_org=("common_tlm_cmd_packet_for_driver_super.h" "eb90_frame_for_driver_super.h" "eb90_packet_for_driver_super.h")
Expand All @@ -8,11 +12,11 @@ header_new=("cdrv_common_tlm_cmd_packet.h" "cdrv_eb90_frame.h" "cdrv_eb90_packet
echo "rename c2a-core header file name prefix & remove _for_driver_super suffix"
for i in ${!header_org[@]}; do
echo " ${header_org[$i]} -> ${header_new[$i]}"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#${header_org[$i]}#${header_new[$i]}#g"
find_all | xargs -0 sed -i -e "s#${header_org[$i]}#${header_new[$i]}#g"
done

echo "rename init func"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#CTCP_init_cdssc(#CDRV_CTCP_init_stream_config(#g"
find_all | xargs -0 sed -i -e "s#CTCP_init_cdssc(#CDRV_CTCP_init_stream_config(#g"

remove_suffix=("_from_cdssc" "_to_cdssc" "_of_cdssc" "_cdssc")
prefix_org=("CTCP_" "CTP_" "CCP_" "EB90_PACKET_" "EB90_FRAME_")
Expand All @@ -21,7 +25,7 @@ for i in ${!remove_suffix[@]}; do
echo "remove suffix: ${remove_suffix[$i]}"
for k in ${!prefix_org[@]}; do
echo " rename function: ${prefix_org[$k]}***${remove_suffix[$i]}(*** -> CDRV_${prefix_org[$k]}***(***"
find . -name "*" -not -path "*/.git/*" -type f -print0 \
find_all \
| xargs -0 sed -i -E "s#${prefix_org[$k]}([0-9a-zA-Z_]*)${remove_suffix[$i]}\((.*)#CDRV_${prefix_org[$k]}\1\(\2#g"
done
done
Expand All @@ -33,17 +37,14 @@ for i in ${!constants[@]}; do
match_new=$(echo "${constants[$i]}" | sed -e "s#(MACRO_ANY)#\\\1#g")

echo " ${match_org} -> CDRV_${match_new}"
find . -name "*" -not -path "*/.git/*" -type f -print0 \
find_all \
| xargs -0 sed -i -E "s#${match_org}#CDRV_${match_new}#g"
done

echo "rename globals"
global=("EB90_FRAME_kStx" "EB90_FRAME_kEtx")
for i in ${!global[@]}; do
echo " ${global[$i]} -> CDRV_${global[$i]}"
find . -name "*" -not -path "*/.git/*" -type f -print0 \
find_all \
| xargs -0 sed -i -E "s#${global[$i]}#CDRV_${global[$i]}#g"
done

git restore src/src_user/Settings/tlm_cmd/data_base/CMD_DB/*.xlsm
git restore src/src_user/Settings/tlm_cmd/data_base/TLM_DB/*.xlsm
15 changes: 8 additions & 7 deletions script/migration/v4-rename-driver-instance.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash
# driver instances -> Component Service
echo "driver instances -> Component Service migration"

function find_all() {
find . -name "*" -not \( -path "*/.git/*" -o -path "*/src_core/*" -o -path "*.xlsm" \) -type f -print0
}

# C2A user code
echo "rename C2A user code: driver_instances -> component_service"
Expand All @@ -16,16 +20,13 @@ for di_src in $di_srcs; do
done

echo "rename path: driver_instances -> component_service"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#driver_instances#component_service#g"
find_all | xargs -0 sed -i -e "s#driver_instances#component_service#g"

echo "rename file path: di_* -> csrv_*"
for di_src in $di_srcs; do
echo " $di_src -> csrv_${di_src#di_}"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#$di_src#csrv_${di_src#di_}#g"
find_all | xargs -0 sed -i -e "s#$di_src#csrv_${di_src#di_}#g"
done

echo "rename source: DI_ -> CSRV_"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#DI_#CSRV_#g"

git restore src/src_user/Settings/tlm_cmd/data_base/CMD_DB/*.xlsm
git restore src/src_user/Settings/tlm_cmd/data_base/TLM_DB/*.xlsm
find_all | xargs -0 sed -i -e "s#DI_#CSRV_#g"
28 changes: 16 additions & 12 deletions script/migration/v4-rename-driver.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
#!/bin/bash
# Script -> script
echo "Script -> script migration"

function find_all() {
find . -name "*" -not \( -path "*/.git/*" -o -path "*/src_core/*" -o -path "*.xlsm" \) -type f -print0
}

## c2a-core ref
echo "rename c2a-core ref: Drivers -> driver"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#src_core/Drivers/Super#src_core/driver#g"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#src_core\\\Drivers\\\Super#src_core\\\driver#g"
find_all | xargs -0 sed -i -e "s#src_core/Drivers/Super#src_core/driver#g"
find_all | xargs -0 sed -i -e "s#src_core\\\Drivers\\\Super#src_core\\\driver#g"

find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#src_core/Drivers/Protocol#src_core/driver#g"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#src_core\\\Drivers\\\Protocol#src_core\\\driver#g"
find_all | xargs -0 sed -i -e "s#src_core/Drivers/Protocol#src_core/driver#g"
find_all | xargs -0 sed -i -e "s#src_core\\\Drivers\\\Protocol#src_core\\\driver#g"

find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#src_core/Drivers#src_core/driver#g"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#src_core\\\Drivers#src_core\\\driver#g"
find_all | xargs -0 sed -i -e "s#src_core/Drivers#src_core/driver#g"
find_all | xargs -0 sed -i -e "s#src_core\\\Drivers#src_core\\\driver#g"

find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#\${C2A_CORE_DIR}/Drivers#\${C2A_CORE_DIR}/driver#g"
find_all | xargs -0 sed -i -e "s#\${C2A_CORE_DIR}/Drivers#\${C2A_CORE_DIR}/driver#g"

# C2A user code
echo "rename C2A user code: Drivers -> driver"
mv src/src_user/Drivers src/src_user/driver

find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#\${C2A_USER_DIR}/Drivers#\${C2A_USER_DIR}/driver#g"
find_all | xargs -0 sed -i -e "s#\${C2A_USER_DIR}/Drivers#\${C2A_USER_DIR}/driver#g"

drv_org=("Aocs" "Cdh" "Com" "Etc" "Mission" "Power" "Prop" "Thermal")
drv_new=("aocs" "cdh" "com" "etc" "mission" "power" "prop" "thermal")
Expand All @@ -33,15 +37,15 @@ echo "rename ref: Drivers -> driver"
for ((i=0; i<${#drv_org[@]}; i++)); do
echo " Driver/${drv_org[i]} -> driver/${drv_new[i]}"

find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#Drivers/${drv_org[i]}#driver/${drv_new[i]}#g"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#Drivers\\\${drv_org}#driver\\\${drv_new}#g"
find_all | xargs -0 sed -i -e "s#Drivers/${drv_org[i]}#driver/${drv_new[i]}#g"
find_all | xargs -0 sed -i -e "s#Drivers\\\${drv_org}#driver\\\${drv_new}#g"
done

# CMake
for ((i=0; i<${#drv_org[@]}; i++)); do
echo "rename ref: ${drv_org[i]} -> ${drv_new[i]}"

find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#${drv_org[i]}/#${drv_new[i]}/#g"
find_all | xargs -0 sed -i -e "s#${drv_org[i]}/#${drv_new[i]}/#g"
done

# Script
Expand Down
24 changes: 14 additions & 10 deletions script/migration/v4-rename-driver2.sh
Original file line number Diff line number Diff line change
@@ -1,38 +1,42 @@
#!/bin/bash
# driver -> component driver
echo "driver -> component driver migration"

function find_all() {
find . -name "*" -not \( -path "*/.git/*" -o -path "*/src_core/*" -o -path "*.xlsm" \) -type f -print0
}

## c2a-core ref
echo "rename c2a-core ref: driver -> component_driver"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#src_core/driver#src_core/component_driver#g"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#src_core\\\driver#src_core\\\component_driver#g"
find_all | xargs -0 sed -i -e "s#src_core/driver#src_core/component_driver#g"
find_all | xargs -0 sed -i -e "s#src_core\\\driver#src_core\\\component_driver#g"

find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#\${C2A_CORE_DIR}/driver#\${C2A_CORE_DIR}/component_driver#g"
find_all | xargs -0 sed -i -e "s#\${C2A_CORE_DIR}/driver#\${C2A_CORE_DIR}/component_driver#g"

# C2A user code
echo "rename dir: driver -> component_driver"
mv src/src_user/driver src/src_user/component_driver
mv src/src_user/Settings/DriverSuper src/src_user/Settings/component_driver_super

find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#\${C2A_USER_DIR}/driver#\${C2A_USER_DIR}/component_driver#g"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#/driver/#/component_driver/#g"
find_all | xargs -0 sed -i -e "s#\${C2A_USER_DIR}/driver#\${C2A_USER_DIR}/component_driver#g"
find_all | xargs -0 sed -i -e "s#/driver/#/component_driver/#g"

## _init_dssc(), _from_dssc(), _to_dssc()
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i "s/dssc/cdssc/g"
find_all | xargs -0 sed -i "s/dssc/cdssc/g"

## Settings
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#/DriverSuper/#/component_driver_super/#g"
find_all | xargs -0 sed -i -e "s#/DriverSuper/#/component_driver_super/#g"

# Script
find src/src_user/script -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#drivers#component_driver#g"

echo "DriverSuper -> ComponentDriverSuper"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i -e "s#DriverSuper#ComponentDriverSuper#g"
find_all | xargs -0 sed -i -e "s#DriverSuper#ComponentDriverSuper#g"

## prefix
prefix_org=("DS_" "DSC_" "DSSC_")
prefix_new=("CDS_" "CDSC_" "CDSSC_")
echo "rename prefix:"
for ((i=0; i<${#prefix_org[@]}; i++)); do
echo " ${prefix_org[i]} -> ${prefix_new[i]}"
find . -name "*" -not -path "*/.git/*" -type f -print0 | xargs -0 sed -i "/CCSDS_/!s/${prefix_org[i]}/${prefix_new[i]}/g"
find_all | xargs -0 sed -i "/CCSDS_/!s/${prefix_org[i]}/${prefix_new[i]}/g"
done
Loading

0 comments on commit 059c679

Please sign in to comment.