Calinou / scoop-games

Scoop bucket for open source/freeware games and game-related tools
Creative Commons Zero v1.0 Universal
286 stars 143 forks source link

[Bug]: xonotic@0.8.5 Could not find 'Xonotic'! (error 11) #877

Closed SunsetMkt closed 1 month ago

SunsetMkt commented 1 year ago

Prerequisites

Package Name

xonotic

Expected/Current Behaviour

Unable to install Xonotic.

Extracting xonotic-0.8.5.zip ... Could not find 'Xonotic'! (error 11)
......
+ CategoryInfo          : OperationStopped: (Could not find 'Xonotic'! (error 11):String) [], RuntimeException
+ FullyQualifiedErrorId : Could not find 'Xonotic'! (error 11)

Steps to Reproduce

PS C:\[REMOVED]> scoop install xonotic
WARN  Scoop uses 'aria2c' for multi-connection downloads.
WARN  Should it cause issues, run 'scoop config aria2-enabled false' to disable it.
WARN  To disable this warning, run 'scoop config aria2-warning-enabled false'.
Installing 'xonotic' (0.8.5) [64bit] from games bucket
Starting download with aria2 ...
Download: Download Results:
Download: gid   |stat|avg speed  |path/URI
Download: ======+====+===========+=======================================================
Download: 6b5fb6|OK  |   9.7MiB/s|C:/[REMOVED]/scoop/cache/xonotic#0.8.5#https_dl.xonotic.org_xonotic-0.8.5.zip
Download: Status Legend:
Download: (OK):download completed.
Checking hash of xonotic-0.8.5.zip ... ok.
Extracting xonotic-0.8.5.zip ... Could not find 'Xonotic'! (error 11)
Location C:\[REMOVED]\scoop\apps\scoop\current\lib\core.ps1:638 Character: 9
+         throw "Could not find '$(fname $from)'! (error $($proc.ExitCo ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Could not find 'Xonotic'! (error 11):String) [], RuntimeException
    + FullyQualifiedErrorId : Could not find 'Xonotic'! (error 11)

Possible Solution

I have no idea about how Scoop manifest works.

Scoop and Buckets Version

Current Scoop version:
v0.3.1 - Released at 2022-11-15

'extras' bucket:
d195c12b2 (HEAD -> master, origin/master, origin/HEAD) dbeaver@23.0.3: Fix hash (Closes #11126)

'games' bucket:
a1f11518 (HEAD -> master, origin/master, origin/HEAD) steam-rom-manager: Update to version 2.4.8

'main' bucket:
cb9da8bd5 (HEAD -> master, origin/master, origin/HEAD) snapraid: Update to version 12.1

Scoop Config

proxy          last_update                       scoop_branch scoop_repo
-----          -----------                       ------------ ----------
[REMOVED] 2023-04-24T15:22:21.0048077+08:00 master       https://github.com/ScoopInstaller/Scoop

PowerShell Version

Name                           Value
----                           -----
PSVersion                      5.1.22621.963
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.963
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Additional Softwares

No response

Calinou commented 1 year ago

I just downloaded xonotic-0.8.5.zip manually and can confirm the top-level folder is called "Xonotic" with an uppercase X. Maybe Scoop is automatically getting rid of the first top-level folder now?

SunsetMkt commented 1 year ago

This may be a bug of scoop. The error occurs in movedir() of scoop, this should not happen.

function movedir($from, $to) {
    $from = $from.trimend('\')
    $to = $to.trimend('\')

    $proc = New-Object System.Diagnostics.Process
    $proc.StartInfo.FileName = 'robocopy.exe'
    $proc.StartInfo.Arguments = "`"$from`" `"$to`" /e /move"
    $proc.StartInfo.RedirectStandardOutput = $true
    $proc.StartInfo.RedirectStandardError = $true
    $proc.StartInfo.UseShellExecute = $false
    $proc.StartInfo.WindowStyle = [System.Diagnostics.ProcessWindowStyle]::Hidden
    [void]$proc.Start()
    $stdoutTask = $proc.StandardOutput.ReadToEndAsync()
    $proc.WaitForExit()

    if($proc.ExitCode -ge 8) {
        debug $stdoutTask.Result
        throw "Could not find '$(fname $from)'! (error $($proc.ExitCode))"
    }

    # wait for robocopy to terminate its threads
    1..10 | ForEach-Object {
        if (Test-Path $from) {
            Start-Sleep -Milliseconds 100
        }
    }
}