rupdater2 is a simple Go-based program that downloads files from a remote server (the ROSE SWE download page), verifies their MD5 hashes, and re-downloads files with mismatches. Optionally, it can delete files that do not match the expected MD5 hash.
This is the successor of rupdater, a bash script https://github.com/roseswe/rupdater
Currently, there is no integrated automated update mechanism for the programs from ROSE SWE. To address this, we provide a shell script, rupdater
, to facilitate updates from the following sites:
As rupdater (v1, shell script) has some shortcomings (Issue #2) we decided to program a complete new version in Go(lang) -> rupdater2
rupdater2 supports beside Linux also Windows environments, which the first version (rupdater) does not. Porting to other platforms like ARM64 etc. is possible.
- Downloads files listed in a remote
md5sums.md5
file. - Verifies MD5 hashes of the downloaded files.
- Re-downloads files with mismatched MD5 hashes.
- Optionally deletes the file md5sums.md5 after processing.
- Supports cross-compilation for both Windows, WSL, MacOS and Linux. Other platforms on request!
The Darwin64 binary included in this package is not signed by us (ROSE SWE). Due to macOS security features, you may encounter a warning when trying to run it. However, if you trust this application and want to run it, you can do so. macOS Gatekeeper is a security feature designed to ensure that only trusted software runs on your Mac, enhancing the overall safety of the operating system. When you attempt to open an application that is not signed, like this Darwin64 binary that lacks the necessary digital signature, Gatekeeper triggers a warning. This is a precautionary measure to protect your system from potentially harmful software. If you trust the source of the unsigned application and wish to proceed, you can bypass Gatekeeper's restrictions.
- Go to
System Preferences > Security & Privacy
. - In the "General" tab, you should see a message about the blocked application. Click on "Open Anyway."
- Go version 1.18 or higher installed on your machine. e.g. golang-1.18-go/jammy-updates,jammy-security,now 1.18.1-1ubuntu1.1 amd64 [installed,automatic] - tested successfully also with go 1.23
make
(optional, if using the Makefile for building).- if you want to (re)create the distribution ZIP archive you need additional tools like UPX, gitchangelog, pandoc, goversioninfo, describe (rose_swe) etc.
To get started with the project, clone the repository to your local machine:
git clone https://github.com/roseswe/rupdater2.git
cd rupdater2
You can build the project for Windows and Linux (32-bit) by running the following make
command, which will cross-compile the program for both platforms:
make
This will generate the following executables in the build
directory:
build/rupdater32.exe
32-bit Windows executable, PE32 executable (console) Intel 80386build/rupdater64.exe
64-bit Windows executable, PE32+ executable (console) x86-64build/rupdater_i586
32-bit Linux executable, static linked, should run on all Linux platforms that provide a 32bit runtimebuild/rupdater_amd64
64-bit Linux exetutable, ELF 64-bit LSB executable, x86-64, version 1 (SYSV)build/rupdater-darwin64
macOS: Mach-O 64-bit x86_64 executable, flags:<|DYLDLINK|PIE>
Alternatively, if you don't have make
, you can manually cross-compile the project for each platform using Go:
-
For Windows 32-bit:
GOOS=windows GOARCH=386 go build -o build/rupdater.exe main.go
-
For Linux 32-bit:
GOOS=linux GOARCH=386 go build -o build/rupdater main.go
-d
,--delete
Delete themd5sums.md5
file after processing.-k
,--keep
Keep files that did not match the MD5 hash.-h
,--help
,-?
Show the (detailed) help message.-V
,--version
Show the program version.-u
,--url=URL
Specify the base URL. If not provided, default URL will be used.
-
Download files, keep mismatched files, and delete the
md5sums.md5
file:./rupdater -d -k
-
Check program version:
./rupdater -V
-
Show help message:
./rupdater -h ---=[ rupdater by ROSE SWE, (c) 2024 by Ralph Roth ]=------------------ Automatic update program to always get the newest files from ROSE SWE! Usage: rupdater [option[s]] Options: -d, --delete Delete the md5sums.md5 file after processing. -k, --keep Keep files that did not match the MD5 hash. -h, --help, -? Show help message. -V, --version Show program version. Description: This program downloads files from the ROSE SWE download page listed in the remote file: md5sums.md5, verifies their MD5 checksums, and re-downloads (updates) files with mismatched MD5sums. You can choose to delete the md5sums.md5 file after processing, and optionally keep (broken) files even if their MD5 hash does not match. Exit Codes: 0 - Success: The program completed without errors. 1 - File Download Error: Unable to download the md5sums.md5 file. 2 - File Open Error: Failed to open the md5sums.md5 file. 3 - File Read Error: Error reading the md5sums.md5 file. 4 - File Deletion Error: Error deleting the md5sums.md5 file after processing. 5 - MD5 Mismatch Found: MD5 mismatches were detected and files were deleted (if applicable). Example: rupdater -d -k Downloads files, keeps mismatched files, and deletes the md5sums.md5 file when done.
-
Downloading/Mirroring www.cfg2html.com
All websites that have been created using ROSE_SWE's dir2html package can be mirrored:
./rupdater --url https://www.cfg2html.com
0
: Success - Program completed without errors.1
: File Download Error - Unable to download themd5sums.md5
file.2
: File Open Error - Failed to open themd5sums.md5
file.3
: File Read Error - Error reading themd5sums.md5
file.4
: File Deletion Error - Error deleting themd5sums.md5
file after processing.5
: MD5 Mismatch Found - MD5 mismatches were detected, and files were deleted (if applicable).
Both rupdater2 Linux binaries tested successfully under Windows Subsystem Linux (WSL)
Feel free to fork the repository and submit pull requests. If you have any suggestions or bug reports, open an issue.
If you find any bugs or have feature requests, please open an issue on the GitHub repository.
This project is open-source and available under the MIT License.
// END //