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

LibreOffice Download recipe getting an error on download #272

Open
jpiperberg opened this issue Nov 2, 2023 · 3 comments
Open

LibreOffice Download recipe getting an error on download #272

jpiperberg opened this issue Nov 2, 2023 · 3 comments

Comments

@jpiperberg
Copy link

jpiperberg commented Nov 2, 2023

This worked last week, but today I got a 404 for both architectures for "fresh". It does not appear as though the releases page is not being updated properly and the 7.6.1 version is missing from download.documentfoundation.org.

Proposed fix:

add URLTextSearcherArray URL/Regex:

url: http://downloadarchive.documentfoundation.org/libreoffice/old/
re_pattern: href="(%version%[\d.]+)/"

add https://github.com/jgstew/jgstew-recipes/blob/main/SharedProcessors/VersionMaximumArray.py

Change URLDownloader
url: http://downloadarchive.documentfoundation.org/libreoffice/old/%version_maximum%/mac/%ARCH%/LibreOffice_%version_maximum%_MacOS_%aux_arch_name%.dmg

I didn't have the ability to fork, but I have tested this recipe with x86_64 and aarch64 with both fresh and still

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Description</key>
	<string>Downloads the latest LibreOffice. Set RELEASE to either "fresh" or "still".

LibreOffice Still is the stable version that has undergone more testing (over a longer time). It is usually recommended for more conservative use.
LibreOffice Fresh is the stable version with the most recent features. Users interested in taking advantage of our most innovative features should download and use our fresh version.
The architecture (ARCH) can be 'x86-64' or 'aarch64'
</string>
	<key>Identifier</key>
	<string>io.github.hjuutilainen.download.LibreOffice</string>
	<key>Input</key>
	<dict>
		<key>NAME</key>
		<string>LibreOffice</string>
		<key>RELEASE</key>
		<string>fresh</string>
		<key>ARCH</key>
		<string>x86_64</string>
	</dict>
	<key>MinimumVersion</key>
	<string>0.2.0</string>
	<key>Process</key>
	<array>
		<dict>
			<key>Comment</key>
			<string>LibreOffice uses both x86_64 AND x86-64 in the download path. Here we build the x86-64 or aarch64 part.</string>
			<key>Processor</key>
			<string>CreateLibreOfficeAuxArchName</string>
			<key>Arguments</key>
			<dict>
				<key>arch_name</key>
				<string>%ARCH%</string>
			</dict>
		</dict>
		<dict>
			<key>Comment</key>
			<string>Try to parse the the latest fresh or still version from current release notes</string>
			<key>Processor</key>
			<string>URLTextSearcher</string>
			<key>Arguments</key>
			<dict>
				<key>re_pattern</key>
				<string>LibreOffice (?P&lt;version&gt;[\d\.]+) \([\d-]+\) - (?i)%RELEASE% Branch</string>
				<key>url</key>
				<string>https://www.libreoffice.org/download/release-notes/</string>
			</dict>
		</dict>
    <dict>
      <key>Processor</key>
      <string>com.github.jgstew.SharedProcessors/SharedUtilityMethods</string>
    </dict>
    <dict>
    	<key>Processor</key>
    	<string>com.github.jgstew.SharedProcessors/URLTextSearcherArray</string>
    	<key>Arguments</key>
    	<dict>
    		<key>url</key>
    		<string>http://downloadarchive.documentfoundation.org/libreoffice/old/</string>
    		<key>result_output_var_name</key>
    		<string>match</string>
    		<key>re_pattern</key>
        <string>href="(?P&lt;fullversion&gt;%version%[\d\.]+)\/"</string>
        <key>full_results</key>
        <true/>
    	</dict>
    </dict>
    <dict>
      <key>Processor</key>
      <string>com.github.jgstew.SharedProcessors/VersionMaximumArray</string>
    </dict>
		<dict>
			<key>Comment</key>
			<string>
				The current (late June 2021) dmg download URL at
				https://www.libreoffice.org/download/download/?type=mac-x86_64
				takes us to a JavaScript-heavy page that eventually redirects to
				the download, but the download is at a predictable URL once we
				know the version. So we just assemble that URL.
			</string>
			<key>Processor</key>
			<string>URLDownloader</string>
			<key>Arguments</key>
			<dict>
				<key>url</key>
				<string>http://downloadarchive.documentfoundation.org/libreoffice/old/%version_maximum%/mac/%ARCH%/LibreOffice_%version_maximum%_MacOS_%aux_arch_name%.dmg</string>
				<key>filename</key>
				<string>%NAME%-%ARCH%.dmg</string>
			</dict>
		</dict>
		<dict>
			<key>Processor</key>
			<string>EndOfCheckPhase</string>
		</dict>
		<dict>
			<key>Processor</key>
			<string>CodeSignatureVerifier</string>
			<key>Arguments</key>
			<dict>
				<key>input_path</key>
				<string>%pathname%/LibreOffice.app</string>
				<key>requirement</key>
				<string>(identifier "org.libreoffice.script.LibreOffice" or identifier "org.libreoffice.script") and anchor apple generic and certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and certificate leaf[subject.OU] = "7P5S3ZLCN7"</string>
				<key>strict_verification</key>
				<true />
			</dict>
		</dict>
	</array>
</dict>
</plist>
				
@juloski
Copy link

juloski commented Feb 13, 2024

Joining to the issue.

The following recipes failed: LibreOffice.munki.recipe Error in local.munki.LibreOffice: Processor: URLTextSearcher: Error: No match found on URL: https://www.libreoffice.org/download/release-notes/

Download link is not valid. Please correct it.

Have a nice day.
Juliusz

@gregneagle
Copy link
Contributor

@juloski this would be a new, different issue.

@juloski
Copy link

juloski commented Feb 15, 2024

Thx for advise. Just created a new issue :-)

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

3 participants