Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
apkbrowser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container 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
apkbrowser
Commits
72993614
Unverified
Commit
72993614
authored
4 years ago
by
Martijn Braam
Browse files
Options
Downloads
Patches
Plain Diff
Display install_if information if available
parent
dce52b69
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app.py
+22
-0
22 additions, 0 deletions
app.py
static/css/style.css
+6
-0
6 additions, 0 deletions
static/css/style.css
templates/package.html
+17
-0
17 additions, 0 deletions
templates/package.html
with
45 additions
and
0 deletions
app.py
+
22
−
0
View file @
72993614
...
...
@@ -232,6 +232,26 @@ def get_subpackages(branch, repo, package_id, arch):
return
result
def
get_install_if
(
branch
,
package_id
):
db
=
getattr
(
g
,
'
_db
'
,
None
)
if
db
is
None
:
open_databases
()
db
=
getattr
(
g
,
'
_db
'
,
None
)
sql
=
"""
SELECT name, operator, version
FROM install_if
WHERE pid = ?
"""
cur
=
db
[
branch
].
cursor
()
cur
.
execute
(
sql
,
[
package_id
])
fields
=
[
i
[
0
]
for
i
in
cur
.
description
]
result
=
[
dict
(
zip
(
fields
,
row
))
for
row
in
cur
.
fetchall
()]
return
result
def
sizeof_fmt
(
num
,
suffix
=
'
B
'
):
for
unit
in
[
''
,
'
Ki
'
,
'
Mi
'
,
'
Gi
'
,
'
Ti
'
,
'
Pi
'
,
'
Ei
'
,
'
Zi
'
]:
if
abs
(
num
)
<
1024.0
:
...
...
@@ -328,6 +348,7 @@ def package(branch, repo, arch, name):
depends
=
get_depends
(
branch
,
package
[
'
id
'
],
arch
)
required_by
=
get_required_by
(
branch
,
package
[
'
id
'
],
arch
)
subpackages
=
get_subpackages
(
branch
,
repo
,
package
[
'
origin
'
],
arch
)
install_if
=
get_install_if
(
branch
,
package
[
'
id
'
])
return
render_template
(
"
package.html
"
,
**
get_settings
(),
...
...
@@ -342,6 +363,7 @@ def package(branch, repo, arch, name):
required_by
=
required_by
,
num_subpackages
=
len
(
subpackages
),
subpackages
=
subpackages
,
install_if
=
install_if
,
pkg
=
package
)
...
...
This diff is collapsed.
Click to expand it.
static/css/style.css
+
6
−
0
View file @
72993614
...
...
@@ -428,3 +428,9 @@ footer a {
}
}
ul
.compact
{
padding
:
0
;
margin
:
0
;
margin-left
:
16px
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
templates/package.html
+
17
−
0
View file @
72993614
...
...
@@ -67,6 +67,23 @@
{{ pkg.origin }}
</a></td>
</tr>
{% if install_if %}
<tr>
<th
class=
"header"
>
Install if
</th>
<td>
<ul
class=
"compact"
>
{% for iif in install_if %}
{% if iif.operator %}
<li>
{{ iif.name }}{{ iif.operator }}{{ iif.version }}
</li>
{% else %}
<li>
{{ iif.name }}
</li>
{% endif %}
{% endfor %}
</ul>
</td>
</tr>
{% endif %}
<tr>
<th
class=
"header"
>
Maintainer
</th>
<td>
{{ pkg.mname }}
</td>
...
...
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