Skip to content

Commit

Permalink
Merge pull request #2403 from TheCakeIsNaOH/freecad
Browse files Browse the repository at this point in the history
(freecad) Fix portable regex and remove 32 bit references
  • Loading branch information
JPRuskin authored Jun 14, 2024
2 parents a2cf68b + ab4a2ae commit 963d475
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
4 changes: 0 additions & 4 deletions automatic/freecad/tools/chocolateyInstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ if (!$PSScriptRoot) { $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -P
$packageArgs = @{
packageName = 'freecad'
fileType = '7z'
url = ''
url64 = 'https://github.com/FreeCAD/FreeCAD-Bundle/releases/download/weekly-builds/FreeCAD_weekly-builds-33658-2023-07-30-conda-Windows-x86_64-py310.7z'
softwareName = 'FreeCAD'
checksum = ''
checksumType = ''
checksum64 = '4E61B5E4176CB93EDC23EB71A53D2ACAA840C88AEE9BFAA63AB2CA48F8300726'
checksumType64 = 'sha256'
silentArgs = '/S'
Expand All @@ -20,7 +17,6 @@ $packageArgs = @{
if (( $packageArgs.filetype -eq '7z' ) -or ( $packageArgs.filetype -eq 'zip' )) {
# Checking for Package Parameters
$pp = ( Get-UserPackageParams -scrawl )
if ($packageArgs.url64 -match "Conda") { $packageArgs.Remove("url"); $packageArgs.Remove("checksum"); $packageArgs.Remove("checksumType"); }
if ($pp.InstallDir) { $packageArgs.Add( "UnzipLocation", $pp.InstallDir ) }
Install-ChocolateyZipPackage @packageArgs
if ($pp.Shortcut) { $pp.Remove("Shortcut"); Install-ChocolateyShortcut @pp }
Expand Down
3 changes: 0 additions & 3 deletions automatic/freecad/update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@ function global:au_SearchReplace {
".\tools\chocolateyInstall.ps1" = @{
"(?i)(^\s*packageName\s*=\s*)'.*'" = "`$1'$($Latest.PackageName)'"
"(?i)(^\s*fileType\s*=\s*)('.*')" = "`$1'$($Latest.fileType)'"
"(?i)(^\s*url\s*=\s*)('.*')" = "`$1'$($Latest.URL32)'"
"(?i)(^\s*url64\s*=\s*)('.*')" = "`$1'$($Latest.URL64)'"
"(?i)(^\s*checksum\s*=\s*)('.*')" = "`$1'$($Latest.Checksum32)'"
"(?i)(^\s*checksum64\s*=\s*)('.*')" = "`$1'$($Latest.Checksum64)'"
"(?i)(^\s*checksumType\s*=\s*)('.*')" = "`$1'$($Latest.ChecksumType32)'"
"(?i)(^\s*checksumType64\s*=\s*)('.*')" = "`$1'$($Latest.ChecksumType64)'"
"(?i)(^\s*softwareName\s*=\s*)'.*'" = "`$1'$($softwareName)'"
}
Expand Down
16 changes: 9 additions & 7 deletions automatic/freecad/update_helper.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,25 @@ param(
$ext = "7z"
$re64 = "(FreeCAD_weekly-builds)?((\-\d{2,6})+)?(\-conda)?(\-${mobile})(\-|.)?(x\d{2}_\d{2}\-)?(py\d{2,5})?(\.$ext)$"
# $url64 = ( $download_page.Links | ? href -match $re64 | Select-Object -First 1 -ExpandProperty 'href' )
$url64 = ( $download_page | Where-Object Name -match $re64 | Select-Object -First 1 -ExpandProperty 'browser_download_url' )
$asset64 = ( $download_page | Where-Object Name -match $re64 | Select-Object -First 1 )
$url64 = $asset64.browser_download_url
"url64 -$url64-" | Write-Warning
$PackageName = "$Title"
$Title = "$Title"
# Now to get the newest Revision from url64
# Now to get the newest Revision with date from asset64
$dateCreated = Get-Date -Date $asset64.created_at -UFormat "%Y.%m.%d"
$veri = ((($url64 -split('\/'))[-1]) -replace( "(x\d{2})|(_\d{2}\-py\d{2,5})|(\-)?([A-z])+?(\-)|(\.$ext)", ''))
"veri -$veri-" | Write-Warning
$DevRevision,$year,$month,$day = (($veri -replace('\-','.') ) -split('\.'))
"Standard Development Versioning for $DevRevision dated ${month}-${day}-${year}" | Write-Warning
[version]$version = ( ( ($DevRevision),($year),($month),($day) ) -join "." )
$DevRevision = (($veri -replace('\-','.') ) -split('\.')) | Select-Object -First 1
"Standard Development Versioning for $DevRevision dated ${dateCreated}" | Write-Warning
[version]$version = ( ( ($DevRevision),($dateCreated) ) -join "." )
$vert = "${version}-${kind}"
}
'portable' {
$download_page = (Get-GitHubRelease -Owner "Freecad" -Name "Freecad" -Verbose).assets
$mobile = "portable"
$ext = "zip"
$re64 = "(FreeCAD\-)((\d+)?(\.))+?(\d)?(\-)(WIN)(\-)?(x\d{2})\-(${mobile})(\-|.)?(\d+)?(\.${ext})$"
$ext = "7z"
$re64 = "(FreeCAD\-)((\d+)?(\.))+?(\d)?(\-)(Windows)(\-)?(x\d{2})(\-|.)?(\d+)?(\.${ext})$"
# $url64 = ( $download_page.Links | ? href -match $re64 | Sort-Object -Property 'href' -Descending | Select-Object -First 1 -ExpandProperty 'href' )
$url64 = ( $download_page | Where-Object Name -match $re64 | Select-Object -First 1 -ExpandProperty 'browser_download_url' )
$vert = "$version"
Expand Down

0 comments on commit 963d475

Please sign in to comment.