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

[Discussion] Sourceforge download patterns #146

Open
jloehel opened this issue Mar 1, 2024 · 1 comment
Open

[Discussion] Sourceforge download patterns #146

jloehel opened this issue Mar 1, 2024 · 1 comment

Comments

@jloehel
Copy link

jloehel commented Mar 1, 2024

@tdruez Thank you very much for the improvements of the Sourceforge download patterns. I still have some issues with the following URLs:

https://sourceforge.net/projects/keepass/files/KeePass%202.x/2.55/KeePass-2.55-Source.zip/download
https://sourceforge.net/projects/codeblocks/files/Sources/20.03/codeblocks-20.03.tar.xz/download
https://sourceforge.net/projects/npppluginmgr/files/v1.3.3/PluginManager_1.3.3_UNI.zip/download
https://sourceforge.net/projects/openofficeorg.mirror/files/4.1.12/source/apache-openoffice-4.1.12-60e0a1c111-src.zip/download
https://sourceforge.net/projects/qbittorrent/files/qbittorrent/qbittorrent-4.6.2/qbittorrent-4.6.2.tar.xz/download
https://sourceforge.net/projects/scrcpy.mirror/files/v2.3.1/scrcpy-win64-v2.3.1.zip/download
https://sourceforge.net/projects/zedgraph/files/zedgraph%20source/5.0.9%20%2B%204.5.9/zedgraph_source_v509_459.zip/download

What I have seen so far it's not guaranteed that the project name matches with the files. Some Projects name the files just Source . Like Codeblocks is doing it. Furthermore the name in the archive does not need to match with the project name. zedgraph is really an edge case because the archive has two versions. I am not sure if it's necessary to consider version ranges there. zedgraph is the only case I know.

What do you think about this regex:

^https?://sourceforge.net/projects/(?P<namespace>[^/]+)/files(/(.+/)?)((?P<version_prefix>(?!\d)[a-zA-Z\-]+)?(?P<version>\d[\w\.\-\+\ ]+))(/(.+/)?)(?P<filename>(?P<name>.+)[-_\ ](?P=version_prefix)?(?P=version)(.*))/download$
@tdruez
Copy link
Collaborator

tdruez commented Mar 4, 2024

What do you think about this regex

@jloehel You should add the URL listing in the url2purl.json with their expected PURLs.
You can then run the tests and adapt the regex as needed until those pass.
Once you have something stable, you can submit a PR and I'll take care of the merge.
Cheers ;)

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

No branches or pull requests

2 participants