mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Wait for package manager not to be locked (#7817)
This commit is contained in:
+20
-6
@@ -14,11 +14,31 @@ phases:
|
||||
queue:
|
||||
name: Hosted Ubuntu 1604
|
||||
steps:
|
||||
- powershell: |
|
||||
Get-Process
|
||||
displayName: Capture Processes
|
||||
condition: succeededOrFailed()
|
||||
|
||||
- powershell: |
|
||||
Get-ChildItem -Path env:
|
||||
displayName: Capture environment
|
||||
condition: succeededOrFailed()
|
||||
|
||||
- powershell: |
|
||||
# sometimes the file is locked and we must wait or things will fail
|
||||
$filePath = '/var/lib/dpkg/lock'
|
||||
$lockList = sudo lsof '/var/lib/dpkg/lock'
|
||||
while($lockList)
|
||||
{
|
||||
Write-Verbose "waiting..." -verbose
|
||||
Write-Verbose ($lockList -join "`n") -verbose
|
||||
Start-Sleep -Second 30
|
||||
$lockList = sudo lsof $filePath
|
||||
}
|
||||
exit 0
|
||||
displayName: Wait for /var/lib/dpkg/lock
|
||||
condition: succeededOrFailed()
|
||||
|
||||
- powershell: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))"
|
||||
displayName: Set Build Name for Non-PR
|
||||
condition: ne(variables['Build.Reason'], 'PullRequest')
|
||||
@@ -35,12 +55,6 @@ phases:
|
||||
displayName: SubModule Init
|
||||
condition: succeededOrFailed()
|
||||
|
||||
- powershell: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y --no-install-recommends less
|
||||
displayName: Install less
|
||||
condition: succeededOrFailed()
|
||||
|
||||
- powershell: |
|
||||
tools/travis.ps1 -Stage Bootstrap
|
||||
displayName: Bootstrap
|
||||
|
||||
Reference in New Issue
Block a user