Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with CORE_INTERNAL_NAME for some cores #57

Open
stefanerwinmayer opened this issue Jan 5, 2021 · 6 comments
Open

Issues with CORE_INTERNAL_NAME for some cores #57

stefanerwinmayer opened this issue Jan 5, 2021 · 6 comments

Comments

@stefanerwinmayer
Copy link

stefanerwinmayer commented Jan 5, 2021

SD card created with: Mr. Fusion v2.2

There seems to be an issue with how the internal names of cores are built (Line 809 presumably the culprit). Running the updater for the first time on a new sd card produces partially the following in the logs:

Checking ao486
Downloading ao486_20210103.rbf to /media/fat/_Computer/ao486_20210103.rbf
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   149  100   149    0     0    445      0 --:--:-- --:--:-- --:--:--   450

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   160  100   160    0     0    174      0 --:--:-- --:--:-- --:--:--  156k

 28 4116k   28 1157k    0     0   793k      0  0:00:05  0:00:01  0:00:04  793k
100 4116k  100 4116k    0     0  2181k      0  0:00:01  0:00:01 --:--:-- 6913k
Deleting old ao486 files
Creating /media/fat/games/AO486UART115200:4000000(Turbo 115200),MIDI directory
mkdir: cannot create directory ‘/media/fat/games/AO486UART115200:4000000(Turbo 115200),MIDI’: Invalid argument
Checking Gameboy
Downloading Gameboy_20210103.rbf to /media/fat/_Console/Gameboy_20210103.rbf
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   153  100   153    0     0    481      0 --:--:-- --:--:-- --:--:--   487

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   164    0   164    0     0    196      0 --:--:-- --:--:-- --:--:--  160k

100 3657k  100 3657k    0     0  2167k      0  0:00:01  0:00:01 --:--:-- 2167k
Deleting old Gameboy files
Creating /media/fat/games/GAMEBOYSS3E000000:100000 directory
mkdir: cannot create directory ‘/media/fat/games/GAMEBOYSS3E000000:100000’: Invalid argument
Checking GBA
Downloading GBA_20201120.rbf to /media/fat/_Console/GBA_20201120.rbf
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   145  100   145    0     0    434      0 --:--:-- --:--:-- --:--:--   438

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   156  100   156    0     0    177      0 --:--:-- --:--:-- --:--:--  152k

  9 4132k    9  373k    0     0   269k      0  0:00:15  0:00:01  0:00:14  269k
100 4132k  100 4132k    0     0  2142k      0  0:00:01  0:00:01 --:--:-- 6897k
Deleting old GBA files
Creating /media/fat/games/GBASS3E000000:100000 directory
mkdir: cannot create directory ‘/media/fat/games/GBASS3E000000:100000’: Invalid argument

Thank you very much for all your efforts!

@stefanerwinmayer
Copy link
Author

Aside: The error messages come from the shell and do not contain the word 'error' like other errors. Makes them hard to spot.

@Firebrandx
Copy link

I found a 4th one in the cheats installation:

error: cannot create /media/fat/cheats/TGFX16/Ranma ? (CD)(Jpn) [].zip Invalid argument

I believe all 4 invalid arguments are due to using characters not allowed.

@stefanerwinmayer
Copy link
Author

@Firebrandx I reported that one here:
#58

@Firebrandx
Copy link

Since it's the same type of error (invalid argument), I figured it didn't need a separate report. No worries either way.

@cdewit
Copy link

cdewit commented Feb 16, 2021

The issue is indeed with the value assigned to the CORE_INTERNAL_NAME variable:
CORE_INTERNAL_NAME="$(curl $CURL_RETRY $SSL_SECURITY_OPTION -sSLf "${CORE_SOURCE_URL}?raw=true" | awk '/CONF_STR[^=]*=/,/;/' | grep -oE -m1 '".*?;' | sed 's/[";]//g')"

The non-greedy/lazy matching in the regular expression of the grep command seems to be unsupported and causes the issue (despite the -E (PATTERN is an extended regexp) option).
Update: It seems that neither BRE (Basic Regular Expressions) nor ERE (Extended Regular Expressions) support non-greedy/lazy matching. PCRE (Perl-Compatible Regular Expressions) should support non-greedy/lazy matching but the used grep seems to lack the -P (Perl) option.

Example command that reproduces the issue:
echo '"AO486;UART115200:4000000(Turbo 115200),MIDI;' | grep -oE -m1 '".*?;'
Result:
"AO486;UART115200:4000000(Turbo 115200),MIDI;

A possible fix could be avoiding non-greedy/lazy matching in the regular expression of the grep command, e.g.:
echo '"AO486;UART115200:4000000(Turbo 115200),MIDI;' | grep -oE -m1 '"[^;]*;'
Result:
"AO486;

@theypsilon
Copy link
Member

The fixes from @cdewit have been merged, I think this issue can be closed @stefanerwinmayer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants