Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pmbootstrap
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
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
pmbootstrap
Commits
4a0825bd
Unverified
Commit
4a0825bd
authored
5 months ago
by
Newbyte
Committed by
Oliver Smith
5 months ago
Browse files
Options
Downloads
Patches
Plain Diff
pmb: Remove args from aportgen command (MR 2432)
parent
653d4550
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2432
Various fixes and cleanups to aportgen
Pipeline
#208279
passed
5 months ago
Stage: lint
Stage: deploy
Stage: test
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
pmb/aportgen/__init__.py
+4
-2
4 additions, 2 deletions
pmb/aportgen/__init__.py
pmb/aportgen/core.py
+2
-5
2 additions, 5 deletions
pmb/aportgen/core.py
pmb/commands/__init__.py
+1
-1
1 addition, 1 deletion
pmb/commands/__init__.py
pmb/commands/aportgen.py
+5
-2
5 additions, 2 deletions
pmb/commands/aportgen.py
with
12 additions
and
10 deletions
pmb/aportgen/__init__.py
+
4
−
2
View file @
4a0825bd
...
...
@@ -64,7 +64,7 @@ def properties(pkgname):
raise
ValueError
(
"
No generator available for
"
+
pkgname
+
"
!
"
)
def
generate
(
pkgname
:
str
,
fork_alpine
:
bool
)
:
def
generate
(
pkgname
:
str
,
fork_alpine
:
bool
,
fork_alpine_retain_branch
:
bool
=
False
)
->
None
:
if
fork_alpine
:
prefix
,
folder
,
options
=
(
pkgname
,
"
temp
"
,
{
"
confirm_overwrite
"
:
True
})
else
:
...
...
@@ -83,7 +83,9 @@ def generate(pkgname: str, fork_alpine: bool):
if
os
.
path
.
exists
(
aportgen
):
pmb
.
helpers
.
run
.
user
([
"
rm
"
,
"
-r
"
,
aportgen
])
if
fork_alpine
:
upstream
=
pmb
.
aportgen
.
core
.
get_upstream_aport
(
pkgname
)
upstream
=
pmb
.
aportgen
.
core
.
get_upstream_aport
(
pkgname
,
retain_branch
=
fork_alpine_retain_branch
)
pmb
.
helpers
.
run
.
user
([
"
cp
"
,
"
-r
"
,
upstream
,
aportgen
])
pmb
.
aportgen
.
core
.
rewrite
(
pkgname
,
replace_simple
=
{
"
# Contributor:*
"
:
None
,
"
# Maintainer:*
"
:
None
}
...
...
This diff is collapsed.
Click to expand it.
pmb/aportgen/core.py
+
2
−
5
View file @
4a0825bd
...
...
@@ -6,7 +6,6 @@ from pathlib import Path
import
re
import
pmb.helpers.git
import
pmb.helpers.run
import
pmb.helpers.args
from
pmb.core.arch
import
Arch
from
pmb.core.context
import
get_context
...
...
@@ -162,7 +161,7 @@ def rewrite(
handle
.
truncate
()
def
get_upstream_aport
(
pkgname
:
str
,
arch
:
Arch
|
None
=
None
):
def
get_upstream_aport
(
pkgname
:
str
,
arch
:
Arch
|
None
=
None
,
retain_branch
:
bool
=
False
):
"""
Perform a git checkout of Alpine
'
s aports and get the path to the aport.
...
...
@@ -175,9 +174,7 @@ def get_upstream_aport(pkgname: str, arch: Arch | None = None):
pmb
.
helpers
.
git
.
clone
(
"
aports_upstream
"
)
aports_upstream_path
=
get_context
().
config
.
work
/
"
cache_git/aports_upstream
"
args
=
pmb
.
helpers
.
args
.
please_i_really_need_args
()
if
getattr
(
args
,
"
fork_alpine_retain_branch
"
,
False
):
if
retain_branch
:
logging
.
info
(
"
Not changing aports branch as --fork-alpine-retain-branch was
"
"
used.
"
)
else
:
# Checkout branch
...
...
This diff is collapsed.
Click to expand it.
pmb/commands/__init__.py
+
1
−
1
View file @
4a0825bd
...
...
@@ -65,7 +65,7 @@ def run_command(args: PmbArgs):
command
:
Command
match
args
.
action
:
case
"
aportgen
"
:
command
=
Aportgen
(
args
.
packages
,
args
.
fork_alpine
)
command
=
Aportgen
(
args
.
packages
,
args
.
fork_alpine
,
args
.
fork_alpine_retain_branch
)
case
"
log
"
:
command
=
Log
(
args
.
clear_log
,
args
.
lines
)
case
"
index
"
:
...
...
This diff is collapsed.
Click to expand it.
pmb/commands/aportgen.py
+
5
−
2
View file @
4a0825bd
...
...
@@ -8,11 +8,14 @@ from pmb.helpers import logging
class
Aportgen
(
commands
.
Command
):
def
__init__
(
self
,
package_list
:
list
[
str
],
fork_alpine
:
bool
)
->
None
:
def
__init__
(
self
,
package_list
:
list
[
str
],
fork_alpine
:
bool
,
fork_alpine_retain_branch
:
bool
)
->
None
:
self
.
package_list
=
package_list
self
.
fork_alpine
=
fork_alpine
self
.
fork_alpine_retain_branch
=
fork_alpine_retain_branch
def
run
(
self
)
->
None
:
for
package
in
self
.
package_list
:
logging
.
info
(
f
"
Generate aport:
{
package
}
"
)
pmb
.
aportgen
.
generate
(
package
,
self
.
fork_alpine
)
pmb
.
aportgen
.
generate
(
package
,
self
.
fork_alpine
,
self
.
fork_alpine_retain_branch
)
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