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
0e14b6d3
Unverified
Commit
0e14b6d3
authored
4 years ago
by
Martijn Braam
Browse files
Options
Downloads
Patches
Plain Diff
Display provides info
parent
72993614
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
app.py
+23
-0
23 additions, 0 deletions
app.py
templates/package.html
+16
-1
16 additions, 1 deletion
templates/package.html
with
39 additions
and
1 deletion
app.py
+
23
−
0
View file @
0e14b6d3
...
...
@@ -252,6 +252,27 @@ def get_install_if(branch, package_id):
return
result
def
get_provides
(
branch
,
package_id
,
pkgname
):
db
=
getattr
(
g
,
'
_db
'
,
None
)
if
db
is
None
:
open_databases
()
db
=
getattr
(
g
,
'
_db
'
,
None
)
sql
=
"""
SELECT name, operator, version
FROM provides
WHERE pid = ?
AND name != ?
"""
cur
=
db
[
branch
].
cursor
()
cur
.
execute
(
sql
,
[
package_id
,
pkgname
])
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
:
...
...
@@ -349,6 +370,7 @@ def package(branch, repo, arch, name):
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
'
])
provides
=
get_provides
(
branch
,
package
[
'
id
'
],
package
[
'
name
'
])
return
render_template
(
"
package.html
"
,
**
get_settings
(),
...
...
@@ -364,6 +386,7 @@ def package(branch, repo, arch, name):
num_subpackages
=
len
(
subpackages
),
subpackages
=
subpackages
,
install_if
=
install_if
,
provides
=
provides
,
pkg
=
package
)
...
...
This diff is collapsed.
Click to expand it.
templates/package.html
+
16
−
1
View file @
0e14b6d3
...
...
@@ -82,7 +82,22 @@
</ul>
</td>
</tr>
{% endif %}
{% if provides %}
<tr>
<th
class=
"header"
>
Provides
</th>
<td>
<ul
class=
"compact"
>
{% for p in provides %}
{% if p.operator %}
<li>
{{ p.name }}{{ p.operator }}{{ p.version }}
</li>
{% else %}
<li>
{{ p.name }}
</li>
{% endif %}
{% endfor %}
</ul>
</td>
</tr>
{% endif %}
<tr>
<th
class=
"header"
>
Maintainer
</th>
...
...
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