Skip to content

Commit 79a2e68

Browse files
committed
First commit.
0 parents  commit 79a2e68

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+4177
-0
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text eol=lf

.github/pack_launcher.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2021 José Manuel Barroso Galindo <[email protected]>
3+
4+
set -euo pipefail
5+
6+
if ! gh release list | grep -q "latest" ; then
7+
gh release create "latest" || true
8+
sleep 15s
9+
fi
10+
11+
zip "MiSTer_Downloader.zip" downloader.sh
12+
gh release upload "latest" "MiSTer_Downloader.zip" --clobber

.github/release.sh

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2021 José Manuel Barroso Galindo <[email protected]>
3+
4+
set -euo pipefail
5+
6+
git add dont_download.sh
7+
git commit -m "BOT: New dont_download.sh" > /dev/null 2>&1 || true
8+
git fetch origin main
9+
10+
set +e
11+
CHANGES="$(git diff main:dont_download.sh origin/main:dont_download.sh | sed '/^[+-]export COMMIT/d' | sed '/^+++/d' | sed '/^---/d' | grep '^[+-]' | wc -l)"
12+
set -e
13+
14+
if [ ${CHANGES} -ge 1 ] ; then
15+
echo "There are changes to push."
16+
echo
17+
git push origin main
18+
echo
19+
echo "New dont_download.sh can be used."
20+
echo "::set-output name=NEW_RELEASE::yes"
21+
else
22+
echo "Nothing to be updated."
23+
echo "::set-output name=NEW_RELEASE::no"
24+
fi

.github/workflows/all_tests.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: All Tests
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-20.04
10+
11+
steps:
12+
- name: Install sharutils
13+
run: sudo apt-get install sharutils
14+
15+
- uses: actions/setup-python@v2
16+
with:
17+
python-version: '3.5'
18+
19+
- uses: actions/checkout@v2
20+
21+
- name: Unit Tests
22+
run: cd src && python3 -m unittest discover -s test/unit
23+
24+
- name: Integration Tests
25+
run: cd src && python3 -m unittest discover -s test/integration
26+
27+
- name: System Quick Tests
28+
run: cd src && python3 -m unittest discover -s test/system/quick
29+
30+
- name: System Slow Tests
31+
run: cd src && python3 -m unittest discover -s test/system/slow

.github/workflows/build.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build
2+
3+
on: push
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-20.04
8+
9+
steps:
10+
- name: Install sharutils
11+
run: sudo apt-get install sharutils
12+
13+
- uses: actions/setup-python@v2
14+
with:
15+
python-version: '3.5'
16+
17+
- uses: actions/checkout@v2
18+
19+
- name: Unit Tests
20+
run: cd src && python3 -m unittest discover -s test/unit
21+
22+
- name: Integration Tests
23+
run: cd src && python3 -m unittest discover -s test/integration
24+
25+
- name: System Quick Tests
26+
run: cd src && python3 -m unittest discover -s test/system/quick
27+
28+
- name: Build
29+
run: ./src/build.sh > dont_download.sh
30+
31+
- name: Release
32+
id: release
33+
run: |
34+
git config --global user.email "[email protected]"
35+
git config --global user.name "The CI/CD Bot"
36+
./.github/release.sh
37+
38+
- name: System Slow Tests
39+
if: steps.release.outputs.NEW_RELEASE == 'yes'
40+
run: cd src && python3 -m unittest discover -s test/system/slow

.github/workflows/pack_launcher.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Pack Launcher
2+
3+
on:
4+
push:
5+
paths:
6+
- 'downloader.sh'
7+
workflow_dispatch:
8+
9+
jobs:
10+
pack:
11+
runs-on: ubuntu-20.04
12+
13+
steps:
14+
15+
- uses: actions/checkout@v2
16+
17+
- name: Pack Launcher
18+
run: ./.github/pack_launcher.sh
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.idea
2+
venv
3+
__pycache__
4+
mister.ip
5+
dont_download.ini

README.md

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# MiSTer Downloader
2+
3+
This tool installs and **updates all the cores** and other extra files for your *MiSTer*. It also updates the menu core, the MiSTer firmware and the Linux system. The source for all downloads is the [MiSTer Distribution](https://github.com/MiSTer-devel/Distribution_MiSTer) repository.
4+
5+
The **MiSTer Downloader** is a substitute for the [MiSTer Updater](https://github.com/MiSTer-devel/Updater_script_MiSTer), and is meant to offer a more safe and robust experience, while being much faster.
6+
7+
As a drawback, the **Downloader** is not backwards compatible with the old INI files that were configured for the [MiSTer Updater](https://github.com/MiSTer-devel/Updater_script_MiSTer). In fact, as of today, this tool doesn't implement many fine-grained features that allow you to customize the updating process in depth. In case you value these features, consider to keep using the [MiSTer Updater](https://github.com/MiSTer-devel/Updater_script_MiSTer) as usual. Both tools will coexist in the near future.
8+
9+
### Setup and Usage
10+
11+
Download this [ZIP file](https://github.com/MiSTer-devel/Downloader_MiSTer/releases/download/latest/MiSTer_Downloader.zip) and extract `downloader.sh` to your `/Scripts` folder on your primary SD card (create that folder if it doesn't exist). You only need to perform this operation once, since this tool self-updates itself.
12+
13+
To use it, on your MiSTer main menu, go to the *Scripts* screen, and select `downloader`.
14+
15+
### Options
16+
17+
You may create a `downloader.ini` file to tweak some parameters.
18+
19+
Here you can see the default parameters and the options that you may change:
20+
21+
```ini
22+
[MiSTer]
23+
; base_path is where most files will be installed
24+
; Useful for setups with USB storage, for example: '/media/usb0/'
25+
base_path = '/media/fat/'
26+
27+
; base_system_path is where system files such as 'MiSTer' and 'menu.rbf' will be installed.
28+
; Warning: It is recommended to NOT change this setting regardless of your setup.
29+
base_system_path = '/media/fat/'
30+
31+
; allow_delete options:
32+
; 0 -> Don't allow this tool to delete anything at all.
33+
; 1 -> Allow this tool to delete any old file from previous updates.
34+
; 2 -> Allow this tool to delete only old cores that receive a new version.
35+
allow_delete = 1
36+
37+
; allow_reboot options:
38+
; 0 -> Don't allow this tool to ever reboot automatically.
39+
; 1 -> Allow this tool to reboot the system after any system file has been updated.
40+
; 2 -> Allow this tool to reboot the system only after Linux has been updated.
41+
allow_reboot = 1
42+
43+
; update_linux options:
44+
; true -> Updates Linux when there is a new update (very recommended).
45+
; false -> Doesn't update Linux.
46+
update_linux = true
47+
48+
; parallel_update options:
49+
; true -> Tries to more than one file simultaneously.
50+
; false -> Will only download one file at a time.
51+
parallel_update = true
52+
53+
; downloader_timeout: Can be tweaked to increase the timeout time in seconds
54+
; It is useful to increase this value for users with slow connections.
55+
downloader_timeout = 300
56+
57+
; downloader_retries: Can be tweaked to increase the retries per failed download
58+
; It is useful to increase this value for users with very unstable connections.
59+
downloader_retries = 3
60+
```
61+
62+
### Roadmap
63+
64+
- [x] Initial Release
65+
- [ ] [Cheats](https://gamehacking.org/mister/) fetching
66+
- [ ] First-run optimisations
67+
- [ ] Configurable custom download filters
68+
- [ ] Handle duplicated `games` folders through symlinks (*GBA* <-> *GBA2P*, and *GAMEBOY* <-> *GAMEBOY2P*)
69+
- [ ] Integration with *MiSTer* binary

0 commit comments

Comments
 (0)