mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-18 22:16:18 -05:00
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc1376dbac | ||
|
|
15d85d1878 | ||
|
|
6edc93b579 | ||
|
|
1c34c52707 | ||
|
|
287d0cc6af | ||
|
|
5f4b2b602a |
No files matched your search
@@ -112,7 +112,6 @@ jobs:
|
|||||||
in
|
in
|
||||||
assert builtins.elem package
|
assert builtins.elem package
|
||||||
hostSystem.config.environment.systemPackages;
|
hostSystem.config.environment.systemPackages;
|
||||||
assert hostSystem.config.services.ayatana-indicators.enable;
|
|
||||||
package
|
package
|
||||||
'
|
'
|
||||||
|
|
||||||
|
|||||||
@@ -362,7 +362,6 @@ init-debian: clean-debian tarball
|
|||||||
# Remove the GUI dependencies if neither GUI component is included
|
# Remove the GUI dependencies if neither GUI component is included
|
||||||
if [ $(INCLUDE_GUI) -eq 0 ] && [ $(BUILD_GUI_HELPER) -eq 0 ]; then \
|
if [ $(INCLUDE_GUI) -eq 0 ] && [ $(BUILD_GUI_HELPER) -eq 0 ]; then \
|
||||||
sed -i "/libsecret-1-0/d" .build/deb/$(PKG)/debian/control; \
|
sed -i "/libsecret-1-0/d" .build/deb/$(PKG)/debian/control; \
|
||||||
sed -i "/libayatana-appindicator3-1/d" .build/deb/$(PKG)/debian/control; \
|
|
||||||
sed -i "/gnome-keyring/d" .build/deb/$(PKG)/debian/control; \
|
sed -i "/gnome-keyring/d" .build/deb/$(PKG)/debian/control; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -475,7 +474,6 @@ init-apk: clean-apk tarball
|
|||||||
|
|
||||||
# Remove the GUI dependencies if neither GUI component is included
|
# Remove the GUI dependencies if neither GUI component is included
|
||||||
if [ $(INCLUDE_GUI) -eq 0 ] && [ $(BUILD_GUI_HELPER) -eq 0 ]; then \
|
if [ $(INCLUDE_GUI) -eq 0 ] && [ $(BUILD_GUI_HELPER) -eq 0 ]; then \
|
||||||
sed -i "/^\tlibayatana-appindicator$$/d" .build/apk/APKBUILD; \
|
|
||||||
sed -i "/^\tlibsecret$$/d" .build/apk/APKBUILD; \
|
sed -i "/^\tlibsecret$$/d" .build/apk/APKBUILD; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# GlobalProtect-openconnect
|
# GlobalProtect-openconnect
|
||||||
|
|
||||||
A GlobalProtect VPN client built on OpenConnect. GP Connect runs on Windows, macOS, Linux, FreeBSD, and OpenBSD. Command-line tools (`gpclient`) are available on macOS, Linux, and BSD.
|
A GlobalProtect VPN client built on OpenConnect. GP Connect runs on Windows, macOS, Linux, FreeBSD, and OpenBSD.
|
||||||
|
|
||||||
> **Disclaimer**: GP Connect is an independent third-party client for GlobalProtect VPN networks. It is not affiliated with or endorsed by Palo Alto Networks, Inc.
|
> **Disclaimer**: GP Connect is an independent third-party client for GlobalProtect VPN networks. It is not affiliated with or endorsed by Palo Alto Networks, Inc.
|
||||||
|
|
||||||
@@ -94,16 +94,9 @@ Run `gpclient --help` or `gpclient <command> --help` to view all available comma
|
|||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
|
||||||
Download the matching EXE installer from [GitHub Releases](https://github.com/yuezk/GlobalProtect-openconnect/releases/latest):
|
1. Download the **x64** or **ARM64** installer for your PC from [GitHub Releases](https://github.com/yuezk/GlobalProtect-openconnect/releases/latest).
|
||||||
|
2. Run the installer and approve the administrator prompt.
|
||||||
- **x64**: Windows 10 version 2004 (build 19041) or later.
|
3. Open **GP Connect** from the Start menu.
|
||||||
- **ARM64**: Windows 11.
|
|
||||||
|
|
||||||
Run the installer and confirm installation. It installs GP Connect and its background VPN service for all users; administrator access is required. Open GP Connect from the Start menu as your normal user.
|
|
||||||
|
|
||||||
The installer and application executables are signed by **Tangramly, LLC**. Embedded sign-in uses Microsoft Edge WebView2 Runtime. You can also use your system browser from Settings.
|
|
||||||
|
|
||||||
GP Connect checks for updates in the app. Uninstall it from Windows Settings; your app settings are kept. The Windows package contains the desktop app and service, without the `gpclient` command-line tool.
|
|
||||||
|
|
||||||
### macOS
|
### macOS
|
||||||
|
|
||||||
@@ -168,7 +161,7 @@ Download the latest `.apk` package from the [releases](https://github.com/yuezk/
|
|||||||
sudo apk add --allow-untrusted globalprotect-openconnect-*.apk
|
sudo apk add --allow-untrusted globalprotect-openconnect-*.apk
|
||||||
```
|
```
|
||||||
|
|
||||||
*(Requires `community` repository enabled for WebKitGTK and AppIndicator dependencies).*
|
*(Requires the `community` repository for WebKitGTK dependencies).*
|
||||||
|
|
||||||
### FreeBSD
|
### FreeBSD
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ Install build and runtime dependencies:
|
|||||||
```sh
|
```sh
|
||||||
sudo pkg install git rust libiconv gettext-tools autoconf automake libtool patch \
|
sudo pkg install git rust libiconv gettext-tools autoconf automake libtool patch \
|
||||||
gmake pkgconf libxml2 gnutls p11-kit nettle gmp liblz4 gnome-keyring \
|
gmake pkgconf libxml2 gnutls p11-kit nettle gmp liblz4 gnome-keyring \
|
||||||
libayatana-appindicator polkit webkit2-gtk_41 xdg-utils
|
polkit webkit2-gtk_41 xdg-utils
|
||||||
```
|
```
|
||||||
|
|
||||||
Build and install:
|
Build and install:
|
||||||
|
|||||||
Generated
+3
-3
@@ -63,11 +63,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1794408178,
|
"lastModified": 1794840529,
|
||||||
"narHash": "sha256-OUDRQTMmN/6cQ/ebDsazUmLj84RxSLaHznKv5As9E1k=",
|
"narHash": "sha256-ySrWnmZB5UsZTYGHHnBjllT05O5iFjElCRS+mabtfP0=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "9397dcb09c9598a33509fbc0cce699bd4e6c84d5",
|
"rev": "e21fec321d73511849707a7585e4ea155ee4bf40",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
@@ -29,8 +29,8 @@
|
|||||||
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
|
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
|
||||||
pname = "globalprotect-openconnect";
|
pname = "globalprotect-openconnect";
|
||||||
version = cargoToml.workspace.package.version;
|
version = cargoToml.workspace.package.version;
|
||||||
releaseTag = "v3.4.0";
|
releaseTag = "v3.5.0";
|
||||||
releaseVersion = "3.4.0";
|
releaseVersion = "3.5.0";
|
||||||
|
|
||||||
toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
||||||
|
|
||||||
@@ -55,8 +55,8 @@
|
|||||||
cpu = pkgs.stdenv.hostPlatform.parsed.cpu.name;
|
cpu = pkgs.stdenv.hostPlatform.parsed.cpu.name;
|
||||||
|
|
||||||
gpguiHashes = {
|
gpguiHashes = {
|
||||||
x86_64 = "sha256-2qZQICnK5fa18suhnqeYnDI1z+SGqXJa1ZXI2NhfQP0=";
|
x86_64 = "sha256-nA6+URV5FafIynXFQL7YmimhVU0sYEuaYqQ4I9YZ5eY=";
|
||||||
aarch64 = "sha256-iOM3+Qte/6C4Gs/e9jVvx5DtBFq7DG2PNDCsGwPMeY0=";
|
aarch64 = "sha256-gPuz6UV7Xir0WKZac8ZsEw8mjN92wRdidbHu5FjS1cw=";
|
||||||
};
|
};
|
||||||
|
|
||||||
gpguiArchive = pkgs.fetchurl {
|
gpguiArchive = pkgs.fetchurl {
|
||||||
@@ -70,8 +70,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
binaryHashes = {
|
binaryHashes = {
|
||||||
x86_64 = "sha256-hBnfMAS3qEby9Dyc3ysH8tdGQwarXqo9xtY1gbN8gJI=";
|
x86_64 = "sha256-l8NrsyiLfYTcALybjOPVnJMLL8Qe2q1jGrwnDu4Grg8=";
|
||||||
aarch64 = "sha256-lW1yQQD1G633tdBGBhVEAEQvMtnntK3mMU9M69x9ID0=";
|
aarch64 = "sha256-+vSsvbqXhoEnxz8dxm/Qq0P5Ve/0HDLs2WnLsTszsgw=";
|
||||||
};
|
};
|
||||||
|
|
||||||
binaryArchive = pkgs.fetchurl {
|
binaryArchive = pkgs.fetchurl {
|
||||||
@@ -324,7 +324,6 @@
|
|||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
environment.systemPackages = [ cfg.package ];
|
environment.systemPackages = [ cfg.package ];
|
||||||
services.ayatana-indicators.enable = lib.mkDefault true;
|
|
||||||
security.polkit = {
|
security.polkit = {
|
||||||
enable = true;
|
enable = true;
|
||||||
} // lib.optionalAttrs (options.security.polkit ? enablePkexecWrapper) {
|
} // lib.optionalAttrs (options.security.polkit ? enablePkexecWrapper) {
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ in {
|
|||||||
prebuilt = assert prebuiltPackage.version == sourcePackage.version; prebuiltPackage;
|
prebuilt = assert prebuiltPackage.version == sourcePackage.version; prebuiltPackage;
|
||||||
module = assert modulePackage.version == sourcePackage.version;
|
module = assert modulePackage.version == sourcePackage.version;
|
||||||
assert builtins.elem modulePackage hostSystem.config.environment.systemPackages;
|
assert builtins.elem modulePackage hostSystem.config.environment.systemPackages;
|
||||||
assert hostSystem.config.services.ayatana-indicators.enable;
|
|
||||||
assert hostSystem.config.security.polkit.enable;
|
assert hostSystem.config.security.polkit.enable;
|
||||||
assert hostSystem.config.security.wrappers.pkexec.enable;
|
assert hostSystem.config.security.wrappers.pkexec.enable;
|
||||||
assert hostSystem.config.security.wrappers.pkexec.setuid;
|
assert hostSystem.config.security.wrappers.pkexec.setuid;
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ pkgbase = globalprotect-openconnect-git
|
|||||||
makedepends = librsvg
|
makedepends = librsvg
|
||||||
makedepends = cargo
|
makedepends = cargo
|
||||||
depends = webkit2gtk-4.1
|
depends = webkit2gtk-4.1
|
||||||
depends = libappindicator-gtk3
|
|
||||||
depends = libsecret
|
depends = libsecret
|
||||||
depends = libxml2
|
depends = libxml2
|
||||||
depends = zlib
|
depends = zlib
|
||||||
|
|||||||
@@ -37,7 +37,30 @@ PY
|
|||||||
branch="chore/promote-$tag"
|
branch="chore/promote-$tag"
|
||||||
git switch -c "$branch" origin/main
|
git switch -c "$branch" origin/main
|
||||||
git merge --ff --no-edit "$release_sha"
|
git merge --ff --no-edit "$release_sha"
|
||||||
cp "$artifact_dir/flake.nix" "$artifact_dir/flake.lock" .
|
# The artifact may come from older main sources; preserve the released package logic.
|
||||||
|
python3 - "$artifact_dir/flake.nix" <<'PY'
|
||||||
|
import re, sys
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
artifact = Path(sys.argv[1]).read_text()
|
||||||
|
path = Path('flake.nix')
|
||||||
|
promoted = path.read_text()
|
||||||
|
fields = [(name, rf'(\b{name}\s*=\s*")([^"]+)(")')
|
||||||
|
for name in ('releaseTag', 'releaseVersion')]
|
||||||
|
for block in ('gpguiHashes', 'binaryHashes'):
|
||||||
|
for arch in ('x86_64', 'aarch64'):
|
||||||
|
fields.append((f'{block}.{arch}', rf'(\b{block}\s*=\s*\{{[^}}]*?\b{arch}\s*=\s*")([^"]+)(")'))
|
||||||
|
for name, pattern in fields:
|
||||||
|
values = re.findall(pattern, artifact)
|
||||||
|
if len(values) != 1:
|
||||||
|
raise SystemExit(f'Expected exactly one {name} in the flake artifact')
|
||||||
|
value = values[0][1]
|
||||||
|
promoted, count = re.subn(pattern, lambda match: match[1] + value + match[3], promoted)
|
||||||
|
if count != 1:
|
||||||
|
raise SystemExit(f'Expected exactly one {name} in the release flake')
|
||||||
|
path.write_text(promoted)
|
||||||
|
PY
|
||||||
|
cp "$artifact_dir/flake.lock" .
|
||||||
python3 "$script_dir/validate-release-version.py" --version "${tag#v}"
|
python3 "$script_dir/validate-release-version.py" --version "${tag#v}"
|
||||||
# Check against Cargo too: overriding the expectation above is only for artifacts.
|
# Check against Cargo too: overriding the expectation above is only for artifacts.
|
||||||
python3 "$script_dir/validate-release-version.py"
|
python3 "$script_dir/validate-release-version.py"
|
||||||
|
|||||||
@@ -144,9 +144,15 @@ class PromotionTests(unittest.TestCase):
|
|||||||
repo, origin, artifact = root / 'repo', root / 'origin.git', root / 'artifact'
|
repo, origin, artifact = root / 'repo', root / 'origin.git', root / 'artifact'
|
||||||
initialize(repo)
|
initialize(repo)
|
||||||
write_version(repo)
|
write_version(repo)
|
||||||
|
hashes = 'gpguiHashes = { x86_64 = "old-gui-x64"; aarch64 = "old-gui-arm64"; };\n' \
|
||||||
|
'binaryHashes = { x86_64 = "old-cli-x64"; aarch64 = "old-cli-arm64"; };\n'
|
||||||
|
with (repo / 'flake.nix').open('a') as flake:
|
||||||
|
flake.write('packageSetting = "original";\n' + hashes)
|
||||||
old = commit(repo, '3.1')
|
old = commit(repo, '3.1')
|
||||||
git(repo, 'switch', '-c', 'release/next')
|
git(repo, 'switch', '-c', 'release/next')
|
||||||
write_version(repo, '3.2.0', '3.1.0')
|
write_version(repo, '3.2.0', '3.1.0')
|
||||||
|
with (repo / 'flake.nix').open('a') as flake:
|
||||||
|
flake.write('packageSetting = "released";\n' + hashes)
|
||||||
(repo / 'feature').write_text('released product feature')
|
(repo / 'feature').write_text('released product feature')
|
||||||
release = commit(repo, '3.2 source')
|
release = commit(repo, '3.2 source')
|
||||||
git(repo, 'tag', 'v3.2.0')
|
git(repo, 'tag', 'v3.2.0')
|
||||||
@@ -158,6 +164,8 @@ class PromotionTests(unittest.TestCase):
|
|||||||
git(repo, 'push', 'origin', 'main', 'v3.2.0')
|
git(repo, 'push', 'origin', 'main', 'v3.2.0')
|
||||||
artifact.mkdir()
|
artifact.mkdir()
|
||||||
write_version(artifact, '3.2.0')
|
write_version(artifact, '3.2.0')
|
||||||
|
with (artifact / 'flake.nix').open('a') as flake:
|
||||||
|
flake.write('packageSetting = "original";\n' + hashes.replace('old-', 'new-'))
|
||||||
(artifact / 'release-candidate.json').write_text(json.dumps({'version': '3.2.0', 'releaseTag': 'v3.2.0'}))
|
(artifact / 'release-candidate.json').write_text(json.dumps({'version': '3.2.0', 'releaseTag': 'v3.2.0'}))
|
||||||
result = subprocess.run(['bash', str(ROOT / 'scripts/prepare-release-promotion.sh'),
|
result = subprocess.run(['bash', str(ROOT / 'scripts/prepare-release-promotion.sh'),
|
||||||
'v3.2.0', str(artifact)], cwd=repo, capture_output=True, text=True)
|
'v3.2.0', str(artifact)], cwd=repo, capture_output=True, text=True)
|
||||||
@@ -168,6 +176,9 @@ class PromotionTests(unittest.TestCase):
|
|||||||
self.assertEqual(git(repo, 'show', f'{old}:Cargo.toml'), '[workspace.package]\nversion = "3.1.0"')
|
self.assertEqual(git(repo, 'show', f'{old}:Cargo.toml'), '[workspace.package]\nversion = "3.1.0"')
|
||||||
self.assertTrue((repo / 'infrastructure').exists())
|
self.assertTrue((repo / 'infrastructure').exists())
|
||||||
self.assertTrue((repo / 'feature').exists())
|
self.assertTrue((repo / 'feature').exists())
|
||||||
|
promoted = (repo / 'flake.nix').read_text()
|
||||||
|
self.assertIn('packageSetting = "released";', promoted)
|
||||||
|
self.assertIn(hashes.replace('old-', 'new-'), promoted)
|
||||||
self.assertEqual(git(repo, 'rev-list', '--parents', '-1', 'HEAD^').split()[1:], [main, release])
|
self.assertEqual(git(repo, 'rev-list', '--parents', '-1', 'HEAD^').split()[1:], [main, release])
|
||||||
self.assertEqual(git(repo, 'diff', '--name-only', 'HEAD^', 'HEAD'), 'flake.nix')
|
self.assertEqual(git(repo, 'diff', '--name-only', 'HEAD^', 'HEAD'), 'flake.nix')
|
||||||
self.assertEqual(git(repo, 'status', '--porcelain'), '')
|
self.assertEqual(git(repo, 'status', '--porcelain'), '')
|
||||||
|
|||||||
@@ -39,14 +39,6 @@ class RepositoryTests(unittest.TestCase):
|
|||||||
with self.assertRaises(publication.Pending):
|
with self.assertRaises(publication.Pending):
|
||||||
publication.rpm_packages("https://repo")
|
publication.rpm_packages("https://repo")
|
||||||
|
|
||||||
def test_copr_same_version_from_another_build_does_not_pass(self):
|
|
||||||
primary = ET.fromstring('''<metadata xmlns="http://linux.duke.edu/metadata/common"><package>
|
|
||||||
<name>globalprotect-openconnect</name><arch>x86_64</arch><version ver="3.0.1" rel="1.fc44"/>
|
|
||||||
<location href="011106217-globalprotect-openconnect/package.rpm"/></package></metadata>''')
|
|
||||||
with patch.object(publication, "rpm_packages", return_value=primary):
|
|
||||||
params = ("https://repo", "globalprotect-openconnect", "3.0.1", "x86_64", lambda release: True)
|
|
||||||
self.assertTrue(publication.rpm_present(*params, build_id=11106217))
|
|
||||||
self.assertFalse(publication.rpm_present(*params, build_id=11106218))
|
|
||||||
|
|
||||||
|
|
||||||
class LaunchpadTests(unittest.TestCase):
|
class LaunchpadTests(unittest.TestCase):
|
||||||
@@ -138,6 +130,25 @@ class OBSTests(unittest.TestCase):
|
|||||||
|
|
||||||
|
|
||||||
class CoprTests(unittest.TestCase):
|
class CoprTests(unittest.TestCase):
|
||||||
|
def test_migrated_repository_matches_exact_build_manifest(self):
|
||||||
|
checker = publication.Copr(arguments(build_id=42))
|
||||||
|
build = {"ownername": "yuezk", "projectname": "globalprotect-openconnect",
|
||||||
|
"state": "succeeded", "source_package": {"name": "globalprotect-openconnect", "version": "3.0.1-1"},
|
||||||
|
"chroots": ["fedora-44-x86_64"], "repo_url": "https://repo"}
|
||||||
|
status = {"state": "succeeded", "result_url": "https://results/42/"}
|
||||||
|
package = {"name": "globalprotect-openconnect", "version": "3.0.1", "release": "1.fc44", "arch": "x86_64"}
|
||||||
|
primary = ET.fromstring('''<metadata xmlns="http://linux.duke.edu/metadata/common"><package>
|
||||||
|
<name>globalprotect-openconnect</name><arch>x86_64</arch><version ver="3.0.1" rel="1.fc44"/>
|
||||||
|
<location href="Packages/g/globalprotect-openconnect-3.0.1-1.fc44.x86_64.rpm"/></package></metadata>''')
|
||||||
|
with patch.object(publication, "api", side_effect=[build, status, {"packages": [package]}]), \
|
||||||
|
patch.object(publication, "rpm_packages", return_value=primary):
|
||||||
|
self.assertIn("1 targets built and published", checker.check())
|
||||||
|
package["release"] = "1.fc45"
|
||||||
|
with patch.object(publication, "api", side_effect=[build, status, {"packages": [package]}]), \
|
||||||
|
patch.object(publication, "rpm_packages", return_value=primary):
|
||||||
|
with self.assertRaisesRegex(publication.Pending, "Waiting for Copr build 42"):
|
||||||
|
checker.check()
|
||||||
|
|
||||||
def test_unselected_chroot_cannot_be_hidden_by_verification(self):
|
def test_unselected_chroot_cannot_be_hidden_by_verification(self):
|
||||||
checker = publication.Copr(arguments(build_id=42, chroots=["fedora-44-x86_64"]))
|
checker = publication.Copr(arguments(build_id=42, chroots=["fedora-44-x86_64"]))
|
||||||
build = {"ownername": "yuezk", "projectname": "globalprotect-openconnect",
|
build = {"ownername": "yuezk", "projectname": "globalprotect-openconnect",
|
||||||
|
|||||||
@@ -84,17 +84,14 @@ def rpm_packages(base_url):
|
|||||||
return ET.fromstring(unpack(content, location))
|
return ET.fromstring(unpack(content, location))
|
||||||
|
|
||||||
|
|
||||||
def rpm_present(base_url, package, version, arch, release_matches, build_id=None):
|
def rpm_present(base_url, package, version, arch, release_matches):
|
||||||
namespace = {"rpm": "http://linux.duke.edu/metadata/common"}
|
namespace = {"rpm": "http://linux.duke.edu/metadata/common"}
|
||||||
for entry in rpm_packages(base_url).findall("rpm:package", namespace):
|
for entry in rpm_packages(base_url).findall("rpm:package", namespace):
|
||||||
info = entry.find("rpm:version", namespace)
|
info = entry.find("rpm:version", namespace)
|
||||||
location = entry.find("rpm:location", namespace).get("href")
|
|
||||||
if (entry.findtext("rpm:name", namespaces=namespace) != package or
|
if (entry.findtext("rpm:name", namespaces=namespace) != package or
|
||||||
entry.findtext("rpm:arch", namespaces=namespace) != arch or
|
entry.findtext("rpm:arch", namespaces=namespace) != arch or
|
||||||
info.get("ver") != version or not release_matches(info.get("rel", ""))):
|
info.get("ver") != version or not release_matches(info.get("rel", ""))):
|
||||||
continue
|
continue
|
||||||
if build_id is not None and not re.search(rf"(?:^|/)0*{build_id}-", location):
|
|
||||||
continue
|
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@@ -254,9 +251,16 @@ class Copr:
|
|||||||
raise Pending(f"Copr {chroot}: {status['state']}; {link}")
|
raise Pending(f"Copr {chroot}: {status['state']}; {link}")
|
||||||
base = build["repo_url"].rstrip("/") + "/" + chroot
|
base = build["repo_url"].rstrip("/") + "/" + chroot
|
||||||
arch = chroot.rsplit("-", 1)[1]
|
arch = chroot.rsplit("-", 1)[1]
|
||||||
|
packages = api(urljoin(status["result_url"], "results.json"))["packages"]
|
||||||
|
package = next((item for item in packages
|
||||||
|
if item["name"] == args.package and item["version"] == args.version
|
||||||
|
and item["arch"] == arch
|
||||||
|
and (item["release"] == args.revision
|
||||||
|
or item["release"].startswith(args.revision + "."))), None)
|
||||||
|
if package is None:
|
||||||
|
raise Failed(f"Copr build {args.build_id} has no requested package for {chroot}")
|
||||||
if not rpm_present(base, args.package, args.version, arch,
|
if not rpm_present(base, args.package, args.version, arch,
|
||||||
lambda release: release == args.revision or release.startswith(args.revision + "."),
|
lambda release: release == package["release"]):
|
||||||
build_id=args.build_id):
|
|
||||||
raise Pending(f"Waiting for Copr build {args.build_id} in {base}")
|
raise Pending(f"Waiting for Copr build {args.build_id} in {base}")
|
||||||
return f"Copr build {args.build_id}: {len(build['chroots'])} targets built and published; {link}"
|
return f"Copr build {args.build_id}: {len(build['chroots'])} targets built and published; {link}"
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user