autopkg / MLBZ521-recipes

AutoPkg Recipes
MIT License
14 stars 22 forks source link

OfflineApps.py won't create new folders to download in #39

Closed mforrest-tmu closed 2 years ago

mforrest-tmu commented 2 years ago

I'm looking at your Matlab recipes rather than write my own and have some questions/suggestions for the OfflineApps processor.

When I'm using a version_separator like '-' with a filename like 'Matlab-R2021a-maci64.dmg' it wants to throw the file into a folder like 'RECIPE_CACHE/downloads/Matlab-R2021a-maci64.dmg/Matlab-R2021a-maci64.dmg'

When the folder 'downloads/Matlab-R2021a-maci64.dmg' doesn't exist, it won't be created. Can you add code to create the directory if needed?

What naming format are you saving your files in? With the file above, I get the following which is not very helpful: OfflineApps: Matched: Matlab-R2021a-maci64.dmg OfflineApps: Found major version: maci64 OfflineApps: Latest version found: maci64.dmg

Would it make sense to remove the search_string and the file extension before trying to get the version?

MLBZ521 commented 2 years ago

@mforrest-rye Sorry for the delay, I was OOO the other day.

So a few things:

  1. Mathwork's "Offline Installer" (the one labeled as an "ISO") for Matlab that I utilize in this recipe has been broken since around 2019b or so. I've opened a ticket with them and there are other reports on their forums regarding the same thing and they do not seem to care. I keep meaning to post an issue on it here, but I keep forgetting since we haven't traditionally packaged it but on the initial a/b releases. While I could utilize their other "offline installer method" (which is download the "downloader app" to download the installer media to use for offline installation) in this....that was so much work already, I just kept using my previous manual workflow to package Matlab that I was doing before I created the recipe......which I initially only kept doing as I was hoping Mathworks would fix the true "Offline Installer" that they offer. I will note, I have not tested it since 2021a though. I do need to test the latest couple versions to see if it works again (🤞 )

  2. I believe the issue you are having has to do with how my OfflineApps processor expects the files and/or folders to be labeled. It expects the <version string> to be after the last version_separator. So in your case, you have a file named: Matlab-R2021a-maci64.dmg And it is identifying the marked hypen as the version_separator: Matlab-R2021a-maci64.dmg Which makes the version found (or should be, see point 3 below): maci64

  3. I literally added the ability to also use files themselves (and not only folders) in the last couple weeks, after another admins request. In my "offline file share" where my source files are stored, they are all stored in folders, so there are no file extensions (I put the vendor provided files in folders so that I do not care what the vendor named their files and I don't have to rename them). So in this last update, it looks like I failed to account for the file extension which needs to be ignored in the parsing of the version logic. I just pushed c53d2f5 which should hopefully fix this issue.

tl/dr:

  1. The Matlab recipe is likely broken -- though I haven't tested 2021a or newer yet
  2. You will need need to have the <version string> as the final string after the final version_separator (if there are multiple instances of the character used as the version_separator within the files' name). a. i.e. You will need to rename the file or place it within a folder that follows the Processors expected naming convention.
MLBZ521 commented 2 years ago

Closing at this time. Feel free to let me know if you are still having issues with this processor.