Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hust-open-atom-club/hustmirror-cli
hustmirror-cli 帮助快速换源
https://github.com/hust-open-atom-club/hustmirror-cli
Last synced: 3 months ago
JSON representation
hustmirror-cli 帮助快速换源
- Host: GitHub
- URL: https://github.com/hust-open-atom-club/hustmirror-cli
- Owner: hust-open-atom-club
- License: mit
- Created: 2024-03-21T13:41:17.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-05-14T03:01:58.000Z (9 months ago)
- Last Synced: 2024-05-14T03:45:21.173Z (9 months ago)
- Language: Shell
- Homepage: https://mirrors.hust.edu.cn/docs/
- Size: 114 KB
- Stars: 10
- Watchers: 5
- Forks: 5
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hustmirror-cli
## Introduction
`hustmirror-cli` is a CLI posix shell script to replace system repository mirror to HUST Mirror.
## Supported Linux Distributions and Software
- [x] Alpine Linux
- [x] Anolis OS
- [x] Arch Linux
- [x] Black Arch
- [x] crates
- [x] Debian
- [x] Deepin
- [x] Kali
- [x] LinuxMint
- [x] openEuler
- [x] openKylin
- [x] pypi
- [x] Rustup
- [x] Ubuntu
- [x] Oh My ZshIf you would to request supports of new Linux distributions or software, please [submit an issue](https://github.com/hust-open-atom-club/hustmirror-cli/issues/new/choose).
## Usage
```
curl -s https://mirrors.hust.edu.cn/get | sh -s -- autodeploy
```See details about hustmirror-cli usage in the [USAGE.md](docs/USAGE.md).
## Build
Use `GNU make` to process all files and generate them
into a single executable bash.```shell
make
```The output script will be placed in `./output/hustmirror-cli`
## Test
```shell
make test
```## Contract
### Styles
- Syntax of scripts is supposed to POSIX shell compatible.
- Use 4 character tab indent.
- We suppose that user only install `GNU coreutils` or `busybox`.
So prerequisite check is supposed to be made when use other
utils like `gcc` or `make`.### Directories
- src: scripts would packaging into output scripts.
- src/mirrors: scripts subject to mirror script contract.
- src/main.sh.template: template shell file.
- src/checkfile.sh: check file.
- scripts: store scripts used for packaging.### Template
Template file supports following directives:
- `@include file`: include other files.
- `@var(shell code)`: get a string from build process.
- `@mirrors`: include all processed mirror scripts.### Mirror script contract
All files in mirror should implement following functions.
- `check`: (optional) check if target machine is satisfied to replace mirror.
- `install`: install mirror.
- `is_deployed`: (optional) check whether is deployed.
- `can_recover`: (optional) check whether can be recovered.
- `uninstall`: (optional) recover installation.