Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Gathub22 authored Aug 27, 2024
2 parents 1f81e1e + 11f6eeb commit 7c61328
Show file tree
Hide file tree
Showing 316 changed files with 1,187 additions and 295 deletions.
94 changes: 74 additions & 20 deletions .github/validate-rapps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,56 @@
PROJECT: ReactOS rapps-db validator
LICENSE: MIT (https://spdx.org/licenses/MIT)
PURPOSE: Validate all rapps-db files
COPYRIGHT: Copyright 2020-2023 Mark Jansen <[email protected]>
COPYRIGHT: Copyright 2020-2024 Mark Jansen <[email protected]>
'''
import os
from pathlib import Path
import sys
from enum import Enum, unique
import struct;


# TODO: make this even nicer by using https://github.com/pytorch/add-annotations-github-action

REPO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
REPO_ROOT = Path(__file__).parents[1]

ALL_KEYS = [
REQUIRED_SECTION_KEYS = [
b'Name',
b'Category',
b'URLDownload',
]

OPTIONAL_SECTION_KEYS = [
b'Version',
b'License',
b'Description',
b'Category',
b'URLSite',
b'URLDownload',
b'SHA1',
b'SizeBytes',
b'Icon',
b'Screenshot1',
b'LicenseType',
b'Languages',
b'RegName',
b'Publisher',
b'Installer',
b'Scope',
]


REQUIRED_KEYS = [
b'Name',
b'Category',
b'URLDownload',
]

KEYS = {
b'Section': REQUIRED_SECTION_KEYS + OPTIONAL_SECTION_KEYS,
b'Generate': [
b'Files',
b'Dir',
b'Lnk',
b'Icon',
b'DelFile',
b'DelDir',
b'DelDirEmpty',
b'DelReg',
b'DelRegEmpty',
],
}

ALL_ARCH = [
b'x86',
Expand All @@ -52,9 +68,12 @@
3, # Trial/Demo
]

def get_valid_keys(section_name):
return KEYS[section_name]

all_names = {}
all_urls = {}
g_current_section = None


HEXDIGITS = b'0123456789abcdef'
Expand All @@ -78,6 +97,10 @@ def add(self, line, column, problem):
idx = column - 1 + len("b'") # Offset the b' prefix
print(' ' * idx + '^')

def add_file(self, file, problem):
self._problems += 1
print('{file}: {problem}'.format(file=file, problem=problem))

def problems(self):
return self._problems > 0

Expand Down Expand Up @@ -129,8 +152,10 @@ def _parse_section(self, reporter, stripped):
stripped = stripped + b']' # Add it so we can continue

section_name, locale, extra_locale, arch = self._extract_section_info(stripped, reporter)
global g_current_section
g_current_section = section_name

if section_name != b'Section':
if section_name not in KEYS:
help = 'should always be "Section"'
reporter.add(self, self._text.index(section_name) + 1,
'Invalid section name: "{sec}", {msg}'.format(sec = section_name, msg = help))
Expand Down Expand Up @@ -178,7 +203,7 @@ def _parse_key_value(self, reporter, parts):
textkey = self.key.decode()
textval = self.val.decode()

if self.key not in ALL_KEYS:
if self.key not in get_valid_keys(g_current_section):
reporter.add(self, 0, 'Unknown key: "{key}"'.format(key = textkey))

if self.key in [b'LicenseType']:
Expand All @@ -193,6 +218,11 @@ def _parse_key_value(self, reporter, parts):
# reporter.add(self, 0, 'Invalid value: "{val}" in {key}'.format(val = v, key = textkey))
print('Warning: {key} is "{val}" ({file})'.format(val = v, key = textkey, file = self._file.filename))

if self.key in [b'Scope']:
v = textval
if v.casefold() not in ['user', 'machine']:
print('Warning: {key} is "{val}" ({file})'.format(val = v, key = textkey, file = self._file.filename))

def location(self, column):
return '{file}({line}:{col})'.format(file = self._file.filename, line = self._lineno, col = column)

Expand All @@ -203,11 +233,11 @@ def text(self):
class RappsFile:
def __init__(self, fullname):
self.path = fullname
self.filename = os.path.basename(fullname)
self.filename = fullname.name
self._sections = []

def parse(self, reporter):
with open(self.path, 'rb') as f:
with open(str(self.path), 'rb') as f:
lines = [RappsLine(self, idx + 1, line) for idx, line in enumerate(f.readlines())]

# Create sections from all lines, and add keyvalue entries in their own section
Expand Down Expand Up @@ -237,7 +267,7 @@ def parse(self, reporter):
all_sections.append(uniq_section)
if not main_section and section.main_section:
main_section = section
for key in REQUIRED_KEYS:
for key in REQUIRED_SECTION_KEYS:
if not section[key]:
reporter.add(section, 0, 'Main section has no {key} key!'.format(key = key))
if section[b'URLDownload'] and not section[b'SizeBytes']:
Expand Down Expand Up @@ -274,14 +304,38 @@ def verify_unique(reporter, lines, line, name):
else:
lines[name] = line


def validate_repo(dirname):
def validate_single_icon(icon, reporter):
try:
with open(str(icon), 'rb') as f:
header = f.read(4)
# First we validate the header
if header != b'\x00\x00\x01\x00':
reporter.add_file('icons/' + icon.name, 'Bad icon header')
return
# Check that there is at least one icon
num_icons, = struct.unpack('<H', f.read(2))
if num_icons == 0:
reporter.add_file('icons/' + icon.name, 'Empty icon?')
return
# Should we validate / display individual icons?
# See https://en.wikipedia.org/wiki/ICO_(file_format)#Structure_of_image_directory
except Exception as e:
reporter.add_file('icons/' + icon.name, 'Exception while reading icon: ' + str(e))

def validate_icons(ico_dir, reporter):
for icon in ico_dir.glob('*.ico'):
validate_single_icon(icon, reporter)


def validate_repo(check_dir):
reporter = Reporter()

all_files = [RappsFile(filename) for filename in os.listdir(dirname) if filename.endswith('.txt')]
all_files = [RappsFile(file) for file in check_dir.glob('*.txt')]
for entry in all_files:
entry.parse(reporter)

validate_icons(check_dir / 'icons', reporter)

if reporter.problems():
print('Please check https://reactos.org/wiki/RAPPS for details on the file format.')
sys.exit(1)
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/validate-rapps.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
# This workflow will install Python dependencies, lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: rapps-db validation

Expand All @@ -15,11 +15,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: 3.8
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.venv
3 changes: 3 additions & 0 deletions 7kaa.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ URLSite = https://7kfans.com/
URLDownload = https://github.com/the3dfxdude/7kaa/releases/download/v2.15.5/7kaa-install-win32-2.15.5.exe
SHA1 = f802798bda5ede67c3ec72e3d699b5daa03583d3
SizeBytes = 66934971

[Section.041f]
Description = Seven Kingdoms Ancient Adversaries, Trevor Chan tarafından tasarlanan bir gerçek zamanlı strateji oyunudur, şimdi özgür olarak kullanılabilir ve topluluk tarafından bakımı yapılmaktadır.
16 changes: 8 additions & 8 deletions 7zip.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
[Section]
Name = 7-Zip
Version = 23.01
Version = 24.07
License = LGPL
Description = A file archiving utility with support for 7zip, zip, tar, rar and many other archive formats.
Category = 12
URLSite = https://www.7-zip.org/
URLDownload = https://www.7-zip.org/a/7z2301.exe
SHA1 = d5d00e6ea8b8e68ce7a704fd478dc950e543c25c
SizeBytes = 1301195
URLDownload = https://www.7-zip.org/a/7z2407.exe
SHA1 = 6132b1cbb8b81a587d3eda3c9ac3a1c434fb13b0
SizeBytes = 1331365
Icon = 7zip.ico

[Section.amd64]
Version = 23.01
URLDownload = https://www.7-zip.org/a/7z2301-x64.msi
SHA1 = bcfc5c64d9847f74ca41b94ad98f0b9eff0e2e93
SizeBytes = 1933312
Version = 24.07
URLDownload = https://www.7-zip.org/a/7z2407-x64.msi
SHA1 = 33610432a1288537b5afbd403dac55f040f05fbe
SizeBytes = 1966592

[Section.0001]
Description = .برنامج لضغط وفك ضغط الملفات يدعم تنسيقات متعددة مثل زيب و 7زيب و رار و غيرها
Expand Down
4 changes: 4 additions & 0 deletions Chromium-XP_49_0_2623_113-R2_VS2015_SSE2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ URLDownload = https://github.com/Alex313031/chromium-xp/releases/download/M49.0.
SHA1 = 29fe5f8e02adfe44fe5bdbeb749fa93f97fc2aaf
SizeBytes = 47201792
Icon = chromium.ico

[Section.041f]
License = BSD (3 cümlecikli)
Description = Pepperflash 21.0.0.213 ile önceden paketlenmiştir. html5test.com sonucu 489/555. Çalıştırmak için şimdilik --no-sandbox komut satırı seçeneğine ihtiyaç duyar.
4 changes: 4 additions & 0 deletions Chromium-XP_49_0_2623_113_VS2013_SSE3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ URLDownload = https://github.com/Alex313031/chromium-xp/releases/download/M49.0.
SHA1 = 17204758da42ea5e30f463392ff37368a6f3929e
SizeBytes = 44779008
Icon = chromium.ico

[Section.041f]
License = BSD (3 cümlecikli)
Description = Pepperflash 21.0.0.213 ile önceden paketlenmiştir. html5test.com sonucu 489/555. Çalıştırmak için şimdilik --no-sandbox komut satırı seçeneğine ihtiyaç duyar.
4 changes: 4 additions & 0 deletions Clementine.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ URLDownload = https://github.com/clementine-player/Clementine/releases/download/
SHA1 = 81908dfe1866be5441abf9131ac7f5a261974731
SizeBytes = 22011528
Icon = clementine.ico

[Section.041f]
License = GPL sürüm 3
Description = Clementine, çoklu platform bir müzik oynatıcısıdır. Amarok 1.4'ten esinlenilmiştir, müziklerinizi aramak ve çalmak için hızlı ve kolay kullanımlı bir arayüze odaklanmıştır.
3 changes: 3 additions & 0 deletions Cygne.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ URLDownload = http://cygne.emuunlim.com/files/cygne21a-win.zip
SHA1 = 4119a3b1f8cba6c663e04d6f4eb60116485a112a
SizeBytes = 100197
Icon = cygne.ico

[Section.041f]
Description = Cygne bir açık kaynak WonderSwan/Color emülatorüdür. Bugüne kadar ilk herkese açık yayınlanan WonderSwan/Color emülatorüdür.
3 changes: 3 additions & 0 deletions Folder2Iso.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ URLDownload = https://ia802807.us.archive.org/27/items/folder2iso_202001/Folder2
SHA1 = 07c1641ada57f31964eb4327d5753ab310fc5975
SizeBytes = 2736100
Icon = folder2iso.ico

[Section.041f]
Description = Folder2Iso, herhangi bir dizinden bir ISO oluşturan bir taşınabilir Windows ve Linux uygulamasıdır.
4 changes: 4 additions & 0 deletions GrafX2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ URLDownload = https://gitlab.com/GrafX2/grafX2/-/jobs/3140386057/artifacts/raw/i
SHA1 = df7ec1ee27dd509c484a277aa33546adc3616817
SizeBytes = 2198528
Icon = GrafX2.ico

[Section.041f]
License = GPL sürüm 2
Description = GrafX2, Amiga programları olan Deluxe Paint ve Brilliance'dan esinlenilmiş bir bit eşlem boyama programıdır. 256 renk çizim üzerine özelleşmiştir; özellikle piksel sanatı, oyun grafikleri ve fareyle yapılan herhangi bir ayrıntılı genel grafikler için uygun kılan çok büyük sayıda araçlar ve efektler barındırır.
5 changes: 4 additions & 1 deletion QtEmu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ Description = QtEmu 是一款以 Qt4 編寫的 QEMU 圖形用戶界面。

[Section.0415]
Description = QtEmu to graficzny interfejs użytkownika dla QEMU napisany w Qt4.


[Section.041f]
License = GPL sürüm 2
Description = QtEmu, Qt4 ile yazılmış bir QEMU için grafik kullanıcı arayüzüdür.
15 changes: 11 additions & 4 deletions SNES9x.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
[Section]
Name = SNES9x
Version = 1.60
Version = 1.62.3
License = GPL
Description = A portable, freeware Super Nintendo Entertainment System (SNES) emulator. You'll need to change the video renderer to OpenGL in the video settings or in the ini file.
Category = 4
URLSite = https://github.com/snes9xgit/snes9x/
URLDownload = https://github.com/snes9xgit/snes9x/releases/download/1.60/snes9x-1.60-win32.zip
SHA1 = a67156f159405c73be86df49818f9984dfee218d
SizeBytes = 2619607
URLDownload = https://github.com/snes9xgit/snes9x/releases/download/1.62.3/snes9x-1.62.3-win32.zip
SHA1 = 5c18dfca2d5512d0c14c6ce23b193cf5f09b42a3
SizeBytes = 2914318

[Section.amd64]
URLDownload = https://github.com/snes9xgit/snes9x/releases/download/1.62.3/snes9x-1.62.3-win32-x64.zip
SHA1 = 705c7a3a550ca416f5c78d4e19259366a428d920
SizeBytes = 4485201

[Section.0a]
Description = Un emulador de Super Nintendo Entertainment System (SNES) portátil y gratuito. Deberá cambiar el renderizador de video a OpenGL en la configuración de video o en el archivo ini.
Expand All @@ -18,3 +23,5 @@ Description = 一款免費,輕便的超級任天堂(SNES/SFC)模擬器。
[Section.040c]
Description = Un émulateur portable et gratuit de Super Nintendo Entertainment System (SNES). Vous devrez utiliser OpenGL comme moteur de rendu dans les paramètres vidéo ou dans le fichier .ini.

[Section.041f]
Description = Taşınabilir bir freeware Super Nintendo Entertainment System (SNES) emülatorü. ini dosyasında ya da video ayarlarında video işleyicisini OpenGL olarak değiştirmeye ihtiyaç duyacaksınız.
13 changes: 13 additions & 0 deletions TinySnake.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Section]
Name = TinySnake
Version = 1.0
License = MIT
Description = A simple console game of "Snake". Play with English keyboard!
Category = 4
URLSite = https://github.com/DosX-dev/TinySnake-game
URLDownload = https://github.com/DosX-dev/TinySnake-game/releases/download/Builds/TinySnake.x32.exe
SizeBytes=3584

[Section.0419]
Description = Простая консольная игра в "Змейку". Играть с английской раскладки!

4 changes: 4 additions & 0 deletions WAtomic.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ URLSite = https://watomic.sourceforge.net/
URLDownload = https://master.dl.sourceforge.net/project/watomic/watomic/1.2.3/WAtomic_1_2_3_257.msi
SHA1 = 62e531f3bbfed7a9893ef49c20ff1826dffee09f
SizeBytes = 964608

[Section.041f]
License = GPL sürüm 2
Description = WAtomic, Delphi için GLScene OpenGL tabanlı kitaplık kullanılarak geliştirilen, Linux KATomic mantık oyununun bir Windows klonudur.
2 changes: 2 additions & 0 deletions ZinjaI.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ Description = ZinjaI es un entorno de desarrollo IDE para programar en C y C++.
[Section.0416]
Description= ZinjaI é um ambiente de desenvolvimento IDE para programar em C e C++.

[Section.041f]
Description = ZinjaI, C ve C++ ile programlama için bir IDE'dir.
2 changes: 1 addition & 1 deletion abiword.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Description = Procesor de text.
Description = Текстовый процесор.

[Section.041f]
Description = Canlı ve açık kaynak sözcük işlemcisi.
Description = Canlı ve açık kaynak kelime işlemcisi.

[Section.0422]
Description = Текстовий процесор.
Expand Down
3 changes: 2 additions & 1 deletion abiword26.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Version = 2.6.8
License = GPL
Description = Snappy and open source word processor.
Category = 6
Icon = abiword.ico
URLSite = https://www.abisource.com/
URLDownload = http://www.nl.abisource.com/downloads/abiword/2.6.8/Windows/abiword-setup-2.6.8.exe
SHA1 = 50d9d952cd159b7e7f7aa19c57d448ebc9cb422f
Expand Down Expand Up @@ -37,7 +38,7 @@ Description = Procesor de text, rapid, cu surse deschise.
Description = Текстовый процесор.

[Section.041f]
Description = Canlı ve açık kaynak sözcük işlemcisi.
Description = Canlı ve açık kaynak kelime işlemcisi.

[Section.0422]
Description = Текстовий процесор.
Expand Down
Loading

0 comments on commit 7c61328

Please sign in to comment.