Skip to content

Commit

Permalink
Made watch script error handling stricter
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianeicher committed Sep 21, 2020
1 parent bc8623a commit 6da8e29
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 8 deletions.
4 changes: 3 additions & 1 deletion gui/vlc.watch.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import re
from datetime import datetime

skipped_versions = ['3.0.11.1']

data = request.urlopen('https://get.videolan.org/vlc/').read().decode('utf-8')
matches = re.findall(r'/">([0-9\.]+)/</a>\s+(..-...-....)', data)
releases = [{'version': match[0], 'released': datetime.strftime(datetime.strptime(match[1], '%d-%b-%Y'), '%Y-%m-%d')} for match in matches if match[0].startswith('3.')]
releases = [{'version': match[0], 'released': datetime.strftime(datetime.strptime(match[1], '%d-%b-%Y'), '%Y-%m-%d')} for match in matches if match[0].startswith('3.') and match[0] not in skipped_versions]
2 changes: 1 addition & 1 deletion lib/gcc-libs.watch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#os=Linux
#os=MinGW
"""
gcc-libs 0watch script for packages from the mingw64 project
Expand Down
2 changes: 1 addition & 1 deletion lib/gmp.watch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#os=Linux
#os=MinGW
"""
gmp 0watch script for packages from the mingw64 project
Expand Down
2 changes: 1 addition & 1 deletion lib/gnumpc.watch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#os=Linux
#os=MinGW
"""
gnumpc 0watch script for packages from the mingw64 project
Expand Down
2 changes: 1 addition & 1 deletion lib/libwinpthread.watch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#os=Linux
#os=MinGW
"""
libwinpthread 0watch script for mingw64 projects libwinpthread feed
"""
Expand Down
2 changes: 1 addition & 1 deletion lib/mpfr4.watch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#os=Linux
#os=MinGW
"""
mpfr v4 0watch script for packages from the mingw64 project
"""
Expand Down
2 changes: 1 addition & 1 deletion lib/png16-0.watch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#os=Linux
#os=MinGW
"""
libpng v1.6 0watch script for packages from the mingw64 project
"""
Expand Down
2 changes: 1 addition & 1 deletion lib/zlib.watch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#os=Linux
#os=MinGW
"""
zlib 0watch script for packages from the mingw64 project
"""
Expand Down
3 changes: 3 additions & 0 deletions watch.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
$ErrorActionPreference = "Stop"
pushd $PSScriptRoot

if (-not (Test-Path "..\incoming" -PathType Container)) {
Expand All @@ -9,8 +10,10 @@ foreach ($file in (ls -Recurse -Filter *.watch.py).FullName) {
$header = Get-Content $file -TotalCount 1
if (($header -eq "#os=Windows") -or (-not $header.StartsWith("#os="))) {
echo $file
$ErrorActionPreference = "Continue"
#.\0install.ps1 run --batch https://apps.0install.net/0install/0watch.xml --output ..\incoming $file
.\0install.ps1 run --batch 0watch-windows.xml.selections --output ..\incoming $file
if ($LASTEXITCODE -ne 0) {throw "Exit Code: $LASTEXITCODE"}
}
}

Expand Down
1 change: 1 addition & 0 deletions watch.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -e
cd `dirname $0`

if [ ! -d "../incoming" ]; then
Expand Down

0 comments on commit 6da8e29

Please sign in to comment.