Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pmaports
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
postmarketOS
pmaports
Commits
f7a459bd
Commit
f7a459bd
authored
6 months ago
by
Barnabás Czémán
Browse files
Options
Downloads
Patches
Plain Diff
Revert "CI: lib: update for pmb v3 (MR 5566)"
This reverts commit
bb7b69d4
.
parent
7957b9ef
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.ci/lib/build_changed_aports.py
+4
-7
4 additions, 7 deletions
.ci/lib/build_changed_aports.py
.ci/lib/check_changed_aports_versions.py
+11
-18
11 additions, 18 deletions
.ci/lib/check_changed_aports_versions.py
with
15 additions
and
25 deletions
.ci/lib/build_changed_aports.py
+
4
−
7
View file @
f7a459bd
...
...
@@ -2,7 +2,6 @@
# Copyright 2021 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import
sys
import
pathlib
# Same dir
import
common
...
...
@@ -12,7 +11,6 @@ import add_pmbootstrap_to_import_path
import
pmb.parse
import
pmb.parse._apkbuild
import
pmb.helpers.pmaports
from
pmb.core.context
import
get_context
def
build_strict
(
packages
,
arch
):
...
...
@@ -61,16 +59,15 @@ if __name__ == "__main__":
verify_checksums
(
packages
,
arch
)
sys
.
exit
(
0
)
#
Load context
sys
.
argv
=
[
"
pmbootstrap
.py
"
,
"
chroot
"
]
#
Prepare "args" to use pmbootstrap code
sys
.
argv
=
[
"
pmbootstrap
"
,
"
chroot
"
]
args
=
pmb
.
parse
.
arguments
()
context
=
get_context
()
# Filter out packages that can't be built for given arch
# (Iterate over copy of packages, because we modify it in this loop)
for
package
in
packages
.
copy
():
apkbuild_path
=
pmb
.
helpers
.
pmaports
.
find
(
package
)
apkbuild
=
pmb
.
parse
.
_apkbuild
.
apkbuild
(
pathlib
.
Path
(
apkbuild_path
,
"
APKBUILD
"
)
)
apkbuild_path
=
pmb
.
helpers
.
pmaports
.
find
(
args
,
package
)
apkbuild
=
pmb
.
parse
.
_apkbuild
.
apkbuild
(
f
"
{
apkbuild_path
}
/
APKBUILD
"
)
if
not
pmb
.
helpers
.
pmaports
.
check_arches
(
apkbuild
[
"
arch
"
],
arch
):
print
(
f
"
{
package
}
: not enabled for
{
arch
}
, skipping
"
)
...
...
This diff is collapsed.
Click to expand it.
.ci/lib/check_changed_aports_versions.py
+
11
−
18
View file @
f7a459bd
...
...
@@ -3,7 +3,6 @@
# SPDX-License-Identifier: GPL-3.0-or-later
import
glob
import
pathlib
import
tempfile
import
sys
import
subprocess
...
...
@@ -16,9 +15,8 @@ import add_pmbootstrap_to_import_path # noqa
import
pmb.parse
import
pmb.parse.version
import
pmb.helpers.logging
from
pmb.core.context
import
get_context
def
get_package_contents
(
package
,
revision
,
check
=
True
):
def
get_package_contents
(
args
,
package
,
revision
,
check
=
True
):
# Redirect stderr to /dev/null, so git doesn't complain about files not
# existing in upstream branch for new packages
stderr
=
None
...
...
@@ -39,16 +37,15 @@ def get_package_contents(package, revision, check=True):
with
tempfile
.
TemporaryDirectory
()
as
tempdir
:
with
open
(
tempdir
+
"
/APKBUILD
"
,
"
w
"
,
encoding
=
"
utf-8
"
)
as
handle
:
handle
.
write
(
apkbuild_content
)
parsed
=
pmb
.
parse
.
apkbuild
(
pathlib
.
Path
(
tempdir
,
"
APKBUILD
"
),
False
,
False
)
parsed
=
pmb
.
parse
.
apkbuild
(
tempdir
+
"
/APKBUILD
"
,
False
,
False
)
return
parsed
def
get_package_version
(
package
,
revision
,
check
=
True
):
def
get_package_version
(
args
,
package
,
revision
,
check
=
True
):
"""
returns version in the format
"
{pkgver}-r{pkgrel}
"
, or None if no
matching package is found
"""
parsed
=
get_package_contents
(
package
,
revision
,
check
)
parsed
=
get_package_contents
(
args
,
package
,
revision
,
check
)
if
parsed
is
None
:
return
None
return
parsed
[
"
pkgver
"
]
+
"
-r
"
+
parsed
[
"
pkgrel
"
]
...
...
@@ -94,7 +91,7 @@ def exit_with_error_message():
exit
(
1
)
def
check_versions
(
packages
):
def
check_versions
(
args
,
packages
):
error
=
False
# Get relevant commits: compare HEAD against upstream branch or HEAD~1
...
...
@@ -113,8 +110,8 @@ def check_versions(packages):
for
package
in
packages
:
# Get versions, skip new packages
head
=
get_package_version
(
package
,
"
HEAD
"
)
upstream
=
get_package_version
(
package
,
commit
,
False
)
head
=
get_package_version
(
args
,
package
,
"
HEAD
"
)
upstream
=
get_package_version
(
args
,
package
,
commit
,
False
)
if
not
upstream
:
if
head
.
rpartition
(
'
r
'
)[
2
]
!=
"
0
"
:
print
(
f
"
-
{
package
}
:
{
head
}
(HEAD) (new package) [ERROR]
"
)
...
...
@@ -132,8 +129,8 @@ def check_versions(packages):
# Additional checks for device packages
if
package
.
startswith
(
'
device-
'
):
head_parsed
=
get_package_contents
(
package
,
"
HEAD
"
,
False
)
upstream_parsed
=
get_package_contents
(
package
,
commit
,
False
)
head_parsed
=
get_package_contents
(
args
,
package
,
"
HEAD
"
,
False
)
upstream_parsed
=
get_package_contents
(
args
,
package
,
commit
,
False
)
# checksums did not change
if
head_parsed
[
"
sha512sums
"
]
==
upstream_parsed
[
"
sha512sums
"
]:
...
...
@@ -194,12 +191,8 @@ if __name__ == "__main__":
# Initialize args (so we can use pmbootstrap's APKBUILD parsing)
sys
.
argv
=
[
"
pmbootstrap.py
"
,
"
chroot
"
]
args
=
pmb
.
parse
.
arguments
()
context
=
get_context
()
# pmb.helpers.logging.init(args)
pmb
.
helpers
.
logging
.
init
(
context
.
log
,
args
.
verbose
,
context
.
details_to_stdout
)
pmb
.
helpers
.
logging
.
init
(
args
)
# Verify package versions
print
(
"
checking changed package versions...
"
)
check_versions
(
packages
)
check_versions
(
args
,
packages
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment