Skip to content

fix: sync -c effective config + --cn Gitee mirror fixes to v1 - #98

Merged
cavonlee merged 2 commits into
v1from
feat/sync-fixes-to-v1
Aug 7, 2026
Merged

fix: sync -c effective config + --cn Gitee mirror fixes to v1#98
cavonlee merged 2 commits into
v1from
feat/sync-fixes-to-v1

Conversation

@cavonlee

@cavonlee cavonlee commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Sync two fixes from the frozen 1.3.x line to v1 (the current main branch). These were originally merged to 1.3.x but v1 (newer main line) still lacks them.

  1. -c effective config fix (original PR cli: fix -c to show effective config instead of raw file content #96): pironman5 -c now shows the effective config (defaults + file merge) via build_effective_config() instead of printing raw config.json; fixes empty-file JSONDecodeError.
  2. --cn Gitee mirror flag (original PR feat: add --cn flag to install from Gitee mirror (China) #97): forces all installer downloads (framework, version probes, git clone, dtbo) to the Gitee mirror for users in mainland China where raw.githubusercontent.com is unreliable.

Changes

  • install.sh: --cn flag, pre-scan args, parameterized GIT_REPO / GIT_RAW_BASE / GIT_RAW_SEP / PIPOWER5_DTBO_URL
  • pironman5/_cli.py, pironman5/pironman5.py, pironman5/utils.py: effective-config logic
  • tests/test_cli_show_config.py: tests for -c

Cherry-picked cleanly (no conflicts) from 50fd044d and 72301ef1.

How to test

# Syntax checks
bash -n install.sh

# -c shows effective config (not raw file content)
pironman5 -c

# Empty config file no longer crashes
touch ~/.config/pironman5/config.json && pironman5 -c

# --cn mode install report shows "Source: Gitee (--cn)"
curl -sSL https://gitee.com/sunfounder/pironman5/raw/v1/install.sh | sudo bash -s -- --cn

Note: Gitee mirror may lag; the branch is being pushed to Gitee as well.

铁锤 added 2 commits August 7, 2026 12:08
Add a --cn flag that forces all downloads to the Gitee mirror for
users in mainland China where raw.githubusercontent.com is unreliable.

Changes:
- Pre-scan args for --cn before downloading the installer framework
  (framework URL itself must use the correct source)
- Switch INSTALLER_URL to Gitee when --cn is set
- Parameterize GIT_REPO / GIT_RAW_BASE / GIT_RAW_SEP / PIPOWER5_DTBO_URL
  (Gitee raw URL format needs a /raw/ segment)
- Replace all hardcoded GitHub URLs in install.sh with the variables
- Fix install report label to show Gitee (--cn)

Usage:
  curl -sSL https://gitee.com/sunfounder/pironman5/raw/1.3.x/install.sh | sudo bash -s -- --cn
- Extract build_effective_config() to utils.py (shared by app & CLI)
- Fix empty-file JSONDecodeError (missing else in content=='' branch)
- -c now outputs effective config: defaults + file overrides + auto→system migration
- Remove Pironman5.upgrade_config (now handled by shared function)
- Update test_cli_show_config.py to test the real shared function (7 scenarios)
@cavonlee
cavonlee merged commit 44d8f97 into v1 Aug 7, 2026
@cavonlee
cavonlee deleted the feat/sync-fixes-to-v1 branch August 7, 2026 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant