Compare commits
19 Commits
developmen
...
master
Author | SHA1 | Date | |
---|---|---|---|
a1e748c0a9 | |||
4f2c810a2f
|
|||
3ce6daea15 | |||
16fd963c8d
|
|||
6d3cd0566e
|
|||
42fd6f186f | |||
98699fcdeb | |||
e2c8035b99
|
|||
7bc9725f63 | |||
eb12a979b6
|
|||
1e33c89223 | |||
784fe9a438 | |||
3e2857dcb1 | |||
0f6cbfa52a
|
|||
eae61ea52e | |||
dc3bc810bb
|
|||
f57e542126
|
|||
0752725119
|
|||
80015040f1
|
117
.gitea/workflows/build-docker.yml
Normal file
117
.gitea/workflows/build-docker.yml
Normal file
@@ -0,0 +1,117 @@
|
||||
name: Docker Image CI
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
branches: [ master ]
|
||||
push:
|
||||
branches: [ master ]
|
||||
tags:
|
||||
- 'v*'
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 90
|
||||
strategy:
|
||||
fail-fast: true
|
||||
env:
|
||||
REGISTRY: gitea.artixlinux.org
|
||||
DH_REGISTRY: docker.io
|
||||
REPO_ORG: ${{ gitea.repository_owner }}
|
||||
DH_ORG: artixlinux
|
||||
IMAGE_NAME: artixweb_packages
|
||||
DH_IMAGE_NAME: artixweb-packages
|
||||
ABSOLUTE_IMAGE: ${{ env.REGISTRY }}/${{ env.REPO_ORG }}/${{ env.IMAGE_NAME }}
|
||||
ABSOLUTE_DH_IMAGE: ${{ env.DH_REGISTRY }}/${{ env.DH_ORG }}/${{ env.DH_IMAGE_NAME }}
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
- name: Set up docker
|
||||
run: curl -fsSL https://get.docker.com | sh
|
||||
- name: Set up QEMU
|
||||
uses: https://github.com/docker/setup-qemu-action@v2
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: https://github.com/docker/setup-buildx-action@v2
|
||||
with:
|
||||
install: true
|
||||
|
||||
- name: Log in to the Container registry
|
||||
uses: https://github.com/docker/login-action@v2
|
||||
if: startsWith(gitea.ref, 'refs/tags/v')
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: corysanin
|
||||
password: ${{ secrets.PAT }}
|
||||
|
||||
- name: Log in to the Docker Hub
|
||||
uses: https://github.com/docker/login-action@v2
|
||||
if: startsWith(gitea.ref, 'refs/tags/v')
|
||||
with:
|
||||
registry: ${{ env.DH_REGISTRY }}
|
||||
username: ${{ secrets.DOCKERHUB_USER }}
|
||||
password: ${{ secrets.DOCKERHUB }}
|
||||
|
||||
- name: Define metadata variables
|
||||
if: startsWith(gitea.ref, 'refs/tags/v')
|
||||
run: |
|
||||
sed -i "s/LABEL Version=.*/ARG version=${{ gitea.ref_name }}/" Dockerfile
|
||||
cat Dockerfile
|
||||
|
||||
- name: Extract metadata for release Docker image
|
||||
if: startsWith(gitea.ref, 'refs/tags/v')
|
||||
id: meta
|
||||
uses: https://github.com/docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
${{ env.ABSOLUTE_DH_IMAGE }}
|
||||
# ${{ env.ABSOLUTE_IMAGE }}
|
||||
##unexpected status from PUT request: 413 Request Entity Too Large
|
||||
tags: |
|
||||
type=raw,value=latest
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=semver,pattern={{major}}
|
||||
|
||||
- name: Extract metadata for develop Docker image
|
||||
if: "!startsWith(gitea.ref, 'refs/tags/v')"
|
||||
id: meta-develop
|
||||
uses: https://github.com/docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
${{ env.ABSOLUTE_IMAGE }}
|
||||
tags: |
|
||||
type=ref,enable=true,priority=600,prefix=,suffix=,event=branch
|
||||
type=ref,enable=true,priority=600,prefix=pr-,suffix=,event=pr
|
||||
|
||||
- name: Build and push release Docker image
|
||||
if: startsWith(gitea.ref, 'refs/tags/v')
|
||||
uses: https://github.com/docker/build-push-action@v4
|
||||
with:
|
||||
file: Dockerfile.ci
|
||||
target: deploy
|
||||
pull: true
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
platforms: linux/amd64
|
||||
|
||||
- name: Build develop Docker image
|
||||
if: "!startsWith(gitea.ref, 'refs/tags/v')"
|
||||
uses: https://github.com/docker/build-push-action@v4
|
||||
with:
|
||||
file: Dockerfile.ci
|
||||
target: deploy
|
||||
pull: true
|
||||
push: false
|
||||
tags: ${{ steps.meta-develop.outputs.tags }}
|
||||
labels: ${{ steps.meta-develop.outputs.labels }}
|
||||
platforms: linux/amd64
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,6 +1,6 @@
|
||||
# Cargo stuff
|
||||
target/
|
||||
*Cargo.lock
|
||||
*/Cargo.lock
|
||||
|
||||
# editor stuff
|
||||
.vscode/
|
||||
|
2627
Cargo.lock
generated
Normal file
2627
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
58
Dockerfile.ci
Normal file
58
Dockerfile.ci
Normal file
@@ -0,0 +1,58 @@
|
||||
# This file is part of Artix Web Packages. See LICENSE file for details
|
||||
# Copyright 2022 - Artix Linux
|
||||
FROM artixlinux/artixlinux:base as build
|
||||
|
||||
# update pacman
|
||||
# install clang and pkg-config
|
||||
# install rustup and put $HOME/.cargo/bin in the $PATH
|
||||
# install stable and nightly toolchains
|
||||
# install rustfmt-preview and clippy-preview in the nightly toolchain
|
||||
RUN set -x \
|
||||
&& pacman -Syu --noconfirm \
|
||||
&& pacman -S --noconfirm clang pkgconf \
|
||||
&& pacman -Scc --noconfirm \
|
||||
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
|
||||
&& export PATH="$HOME/.cargo/bin:$PATH" \
|
||||
&& rustup toolchain add stable nightly \
|
||||
&& rustup component add --toolchain nightly rustfmt-preview clippy-preview
|
||||
|
||||
# Update PATH in the container
|
||||
ENV PATH="/root/.cargo/bin:${PATH}"
|
||||
ENV RUSTUP_TOOLCHAIN=stable
|
||||
|
||||
RUN pacman -Sy --noconfirm postgresql-libs
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
COPY . ./
|
||||
|
||||
RUN cargo build --release
|
||||
RUN set -x \
|
||||
&& install -vd /usr/share/artixweb_packages/assets \
|
||||
&& cp -rv crates/artixweb-packages/assets/* /usr/share/artixweb_packages/assets/ \
|
||||
&& install -vd /usr/share/artixweb_packages/templates \
|
||||
&& cp -v crates/artixweb-packages/templates/* /usr/share/artixweb_packages/templates/ \
|
||||
&& install -vDm 755 target/release/artixweb_packages -t "/usr/share/artixweb_packages"
|
||||
|
||||
FROM artixlinux/artixlinux:base AS deploy
|
||||
|
||||
LABEL Maintainer="damnwidget@artixlinux.org"
|
||||
LABEL Name="Artix Web Packages Container"
|
||||
LABEL Version="Develop"
|
||||
|
||||
EXPOSE 1936/tcp
|
||||
|
||||
RUN pacman -Sy --noconfirm postgresql-libs \
|
||||
&& set -x \
|
||||
&& pacman -Syu --noconfirm \
|
||||
&& pacman -Scc --noconfirm \
|
||||
&& printf "[lib32]\nInclude = /etc/pacman.d/mirrorlist\n" >> /etc/pacman.conf \
|
||||
&& printf "[system-gremlins]\nInclude = /etc/pacman.d/mirrorlist\n" >> /etc/pacman.conf \
|
||||
&& printf "[world-gremlins]\nInclude = /etc/pacman.d/mirrorlist\n" >> /etc/pacman.conf \
|
||||
&& printf "[galaxy-gremlins]\nInclude = /etc/pacman.d/mirrorlist\n" >> /etc/pacman.conf \
|
||||
&& printf "[lib32-gremlins]\nInclude = /etc/pacman.d/mirrorlist\n" >> /etc/pacman.conf \
|
||||
&& pacman -Sy --noconfirm
|
||||
|
||||
WORKDIR /usr/share/artixweb_packages
|
||||
COPY --from=0 /usr/share/artixweb_packages ./
|
||||
CMD ["./artixweb_packages"]
|
@@ -8,7 +8,7 @@ homepage = "https://packages.artixlinux.org"
|
||||
keywords = ["artix", "packages", "gitea"]
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2021"
|
||||
version = "0.1.0"
|
||||
version = "0.1.2"
|
||||
|
||||
[lib]
|
||||
name = "artix_gitea"
|
||||
|
@@ -8,7 +8,7 @@ homepage = "https://packages.artixlinux.org"
|
||||
keywords = ["artix", "packages"]
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2021"
|
||||
version = "0.1.0"
|
||||
version = "0.1.2"
|
||||
|
||||
[lib]
|
||||
name = "artix_pkglib"
|
||||
@@ -16,7 +16,7 @@ path = "src/lib.rs"
|
||||
|
||||
|
||||
[dependencies]
|
||||
alpm = "2.2.1"
|
||||
alpm-utils = "2.0.0"
|
||||
pacmanconf = "2.0.0"
|
||||
thiserror = "1.0.1"
|
||||
alpm = "3.0.4"
|
||||
alpm-utils = "3.0.2"
|
||||
pacmanconf = "2.1.0"
|
||||
thiserror = "1.0.58"
|
||||
|
@@ -11,14 +11,14 @@ use alpm::{Alpm, Db, Package};
|
||||
|
||||
/// Data structure used to returns information about an specific packages search
|
||||
pub struct PackagesResultData<'a> {
|
||||
packages: Vec<Package<'a>>,
|
||||
packages: Vec<&'a Package>,
|
||||
total: usize,
|
||||
}
|
||||
|
||||
impl<'a> PackagesResultData<'a> {
|
||||
/// Retrieve the packages of this result if any
|
||||
#[must_use]
|
||||
pub fn packages(&self) -> &Vec<Package<'a>> {
|
||||
pub fn packages(&self) -> &Vec<&Package> {
|
||||
&self.packages
|
||||
}
|
||||
|
||||
@@ -32,22 +32,19 @@ impl<'a> PackagesResultData<'a> {
|
||||
/// Returns back all the packages contained in the given database
|
||||
/// If the database is invalid it returns None
|
||||
#[must_use]
|
||||
pub fn get_packages(db: Db<'_>, limit: usize, offset: usize) -> Vec<Package<'_>> {
|
||||
pub fn get_packages<'a>(db: &'a Db, limit: usize, offset: usize) -> Vec<&'a Package> {
|
||||
let mut ret = Vec::new();
|
||||
if db.is_valid().is_ok() {
|
||||
let pkgs = db.pkgs();
|
||||
if pkgs.is_empty() {
|
||||
return ret;
|
||||
}
|
||||
ret.extend(pkgs);
|
||||
|
||||
// if offset is set, split the vector at the given offset
|
||||
if offset != 0 {
|
||||
ret = ret.split_at(offset).1.to_vec();
|
||||
// if offset is set, truncate the vector at the given offset
|
||||
if offset != 0 && offset < ret.len() {
|
||||
ret = ret.split_off(offset);
|
||||
}
|
||||
|
||||
// if limit is set, truncate the vector at it
|
||||
if limit != 0 {
|
||||
if limit != 0 && limit < ret.len() {
|
||||
ret.truncate(limit);
|
||||
}
|
||||
}
|
||||
@@ -85,7 +82,7 @@ pub fn get_all_packages<'a>(
|
||||
|
||||
if ret.is_empty() {
|
||||
return PackagesResultData {
|
||||
packages: ret,
|
||||
packages: Vec::new(),
|
||||
total: 0,
|
||||
};
|
||||
}
|
||||
@@ -126,14 +123,14 @@ mod test {
|
||||
let alpm = Alpm::new("/", &db_location).unwrap();
|
||||
let db = alpm.register_syncdb("world", SigLevel::NONE).unwrap();
|
||||
|
||||
let pkgs = get_packages(db, 0, 0);
|
||||
let pkgs = get_packages(*db, 0, 0);
|
||||
assert!(!pkgs.is_empty());
|
||||
|
||||
let pkgs = get_packages(db, 2, 0);
|
||||
let pkgs = get_packages(*db, 2, 0);
|
||||
assert_eq!(pkgs.len(), 2);
|
||||
|
||||
let pkgs = get_packages(db, 0, 0);
|
||||
let pkgs2 = get_packages(db, 0, 10);
|
||||
let pkgs = get_packages(*db, 0, 0);
|
||||
let pkgs2 = get_packages(*db, 0, 10);
|
||||
assert_eq!(pkgs2[0].name(), pkgs[10].name());
|
||||
}
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
Copyright (c) 2022 - Oscar Campos <damnwidget@artixlinux.org>
|
||||
*/
|
||||
|
||||
use alpm::{Alpm, AlpmList, Dep, Package, Ver};
|
||||
use alpm::{Alpm, AlpmList, Dep, Package, Pkg, Ver};
|
||||
|
||||
use crate::error::Error;
|
||||
|
||||
@@ -17,7 +17,7 @@ use crate::error::Error;
|
||||
pub fn get_package_dependencies<'a>(
|
||||
alpm: &'a Alpm,
|
||||
package_name: &'a str,
|
||||
) -> Result<AlpmList<'a, Dep<'a>>, Error<'a>> {
|
||||
) -> Result<AlpmList<'a, &'a Dep>, Error<'a>> {
|
||||
for db in alpm.syncdbs() {
|
||||
let db_pkgs = db.search([package_name].iter());
|
||||
if let Ok(pkgs) = db_pkgs {
|
||||
@@ -40,7 +40,7 @@ pub fn get_package_dependencies<'a>(
|
||||
pub fn get_package_optional_dependencies<'a>(
|
||||
alpm: &'a Alpm,
|
||||
package_name: &'a str,
|
||||
) -> Result<AlpmList<'a, Dep<'a>>, Error<'a>> {
|
||||
) -> Result<AlpmList<'a, &'a Dep>, Error<'a>> {
|
||||
for db in alpm.syncdbs() {
|
||||
let db_pkgs = db.search([package_name].iter());
|
||||
if let Ok(pkgs) = db_pkgs {
|
||||
@@ -84,7 +84,7 @@ pub fn get_package_version<'a>(
|
||||
///
|
||||
/// If the package can not be found a [`Error::PackageNotFound`] error is returned
|
||||
#[allow(clippy::module_name_repetitions)]
|
||||
pub fn get_package<'a>(alpm: &'a Alpm, package_name: &'a str) -> Result<Package<'a>, Error<'a>> {
|
||||
pub fn get_package<'a>(alpm: &'a Alpm, package_name: &'a str) -> Result<&'a Pkg, Error<'a>> {
|
||||
for db in alpm.syncdbs() {
|
||||
let db_pkgs = db.search([package_name].iter());
|
||||
if let Ok(pkgs) = db_pkgs {
|
||||
@@ -110,15 +110,15 @@ pub fn retrieve_providers<'a>(
|
||||
arch: &str,
|
||||
alpm: &'a Alpm,
|
||||
requirement: &'a str,
|
||||
) -> Vec<Package<'a>> {
|
||||
let mut pkgs = Vec::new();
|
||||
) -> Vec<&'a Package> {
|
||||
let mut pkgs: Vec<&'a Package> = Vec::new();
|
||||
for db in alpm.syncdbs() {
|
||||
if arch.to_lowercase() != "any" && db.name() == "lib32" {
|
||||
continue;
|
||||
}
|
||||
|
||||
for pkg in db.pkgs() {
|
||||
let mut a: Vec<Dep<'_>> = Vec::new();
|
||||
let mut a: Vec<&'a Dep> = Vec::new();
|
||||
a.extend(pkg.provides().iter().filter(|d| d.name() == requirement));
|
||||
if !a.is_empty() {
|
||||
pkgs.push(pkg);
|
||||
|
@@ -7,7 +7,7 @@ repository = "gitea.artixlinux.org/artix/artixweb_packages"
|
||||
keywords = ["artix", "packages"]
|
||||
license = "MIT OR Apache-2.0"
|
||||
edition = "2021"
|
||||
version = "0.1.0"
|
||||
version = "0.1.2"
|
||||
|
||||
[[bin]]
|
||||
name = "artixweb_packages"
|
||||
@@ -15,8 +15,8 @@ test = false
|
||||
bench = false
|
||||
|
||||
[dependencies]
|
||||
artix-gitea = { path = "../artix-gitea", version = "=0.1.0" }
|
||||
artix-pkglib = { path = "../artix-pkglib", version = "=0.1.0" }
|
||||
artix-gitea = { path = "../artix-gitea", version = "=0.1.2" }
|
||||
artix-pkglib = { path = "../artix-pkglib", version = "=0.1.2" }
|
||||
|
||||
actix-files = "0.6.0"
|
||||
actix-identity = "0.4"
|
||||
|
@@ -73,7 +73,16 @@ fn generate_random_token() -> String {
|
||||
token
|
||||
}
|
||||
|
||||
const DATABASESS: [&str; 5] = ["system", "world", "galaxy", "universe", "lib32"];
|
||||
const DATABASESS: [&str; 8] = [
|
||||
"system",
|
||||
"world",
|
||||
"galaxy",
|
||||
"lib32",
|
||||
"system-gremlins",
|
||||
"world-gremlins",
|
||||
"galaxy-gremlins",
|
||||
"lib32-gremlins"
|
||||
];
|
||||
const MIN_PASSWORD_LENGTH: usize = 8;
|
||||
|
||||
/// Syncs the configured databases
|
||||
|
@@ -23,6 +23,7 @@ use super::packages::{get_packages_inner, Response};
|
||||
#[template(path = "base_index.html")]
|
||||
struct BaseTemplate {
|
||||
packages: Vec<Response>,
|
||||
repos: Vec<String>,
|
||||
limit: usize,
|
||||
query: String,
|
||||
user_email: String,
|
||||
@@ -33,6 +34,7 @@ struct BaseTemplate {
|
||||
#[template(path = "packages_nav.html")]
|
||||
struct PackagesNavigation {
|
||||
packages: Vec<Response>,
|
||||
repos: Vec<String>,
|
||||
total: usize,
|
||||
offset: usize,
|
||||
limit: usize,
|
||||
@@ -62,7 +64,16 @@ pub async fn index(
|
||||
String::new()
|
||||
};
|
||||
|
||||
let valid_repos = vec!["world", "galaxy", "system", "universe", "lib32"];
|
||||
let valid_repos = vec![
|
||||
"system",
|
||||
"world",
|
||||
"galaxy",
|
||||
"lib32",
|
||||
"system-gremlins",
|
||||
"world-gremlins",
|
||||
"galaxy-gremlins",
|
||||
"lib32-gremlins"
|
||||
];
|
||||
for parameter in query.0 {
|
||||
let key: &str = ¶meter.0;
|
||||
match key {
|
||||
@@ -116,6 +127,7 @@ pub async fn index(
|
||||
PackagesNavigation {
|
||||
user_email,
|
||||
packages: result.0,
|
||||
repos,
|
||||
total: result.1,
|
||||
query: query_url.join("&"),
|
||||
total_pages: if limit > 0 {
|
||||
@@ -140,8 +152,8 @@ pub async fn index(
|
||||
|
||||
#[allow(clippy::unnecessary_wraps)]
|
||||
mod filters {
|
||||
pub fn selected_repo(query: &str, repo: &str) -> ::askama::Result<bool> {
|
||||
Ok(query.to_lowercase().contains(&repo.to_lowercase()))
|
||||
pub fn selected_repo(repos: &Vec<String>, repo: &str) -> ::askama::Result<bool> {
|
||||
Ok(repos.iter().any(|r| r == repo))
|
||||
}
|
||||
|
||||
pub fn details_url(pkg_name: &str) -> ::askama::Result<String> {
|
||||
|
@@ -531,12 +531,9 @@ pub(crate) async fn get_packages_details_inner(
|
||||
return Ok(result);
|
||||
}
|
||||
|
||||
// retrieve a valid organization name for gitea packages
|
||||
let org_name = get_org_name(&pkg);
|
||||
|
||||
// look for this package in gitea
|
||||
if let Some(gitea_repo) = Repository::retrieve_repository(
|
||||
&org_name,
|
||||
&String::from("packages"),
|
||||
package_name,
|
||||
Some(&SETTINGS.gitea_api_url),
|
||||
)
|
||||
@@ -621,33 +618,6 @@ fn get_package_metadata<'a>(
|
||||
}
|
||||
}
|
||||
|
||||
// retrieves a valid (hopefully) organization name from a package name or base
|
||||
fn get_org_name(pkg: &Package<'_>) -> String {
|
||||
let mut pkg_name = pkg.name();
|
||||
let mut org_name = if let Some(base) = pkg.base() {
|
||||
pkg_name = base;
|
||||
format!(
|
||||
"packages{}",
|
||||
base.to_uppercase().chars().next().unwrap_or('_')
|
||||
)
|
||||
} else {
|
||||
format!(
|
||||
"packages{}",
|
||||
pkg_name.to_uppercase().chars().next().unwrap_or('_')
|
||||
)
|
||||
};
|
||||
|
||||
if pkg_name.starts_with("python-") {
|
||||
org_name = String::from("packagesPython");
|
||||
} else if pkg.name().starts_with("perl-") {
|
||||
org_name = String::from("packagesPerl");
|
||||
} else if pkg.name().starts_with("ruby-") {
|
||||
org_name = String::from("packagesRuby");
|
||||
}
|
||||
|
||||
org_name
|
||||
}
|
||||
|
||||
pub(crate) async fn get_packages_inner(
|
||||
repo_names: &str,
|
||||
limit: usize,
|
||||
@@ -782,7 +752,7 @@ async fn retrieve_maintainers(gitea_repo: &Repository) -> Vec<String> {
|
||||
fn get_depends_from_package<'a>(
|
||||
alpm: &'a Alpm,
|
||||
arch: &str,
|
||||
deps: AlpmList<'_, Dep<'_>>,
|
||||
deps: AlpmList<'_, &Dep>,
|
||||
kind: &DependencyKind,
|
||||
) -> Vec<Dependency> {
|
||||
match kind {
|
||||
@@ -808,7 +778,7 @@ fn get_depends_from_package<'a>(
|
||||
|
||||
// constructs a Dependency instance with the given data and returns it back
|
||||
#[allow(clippy::needless_pass_by_value)]
|
||||
fn construct_dependency(arch: &str, alpm: &Alpm, dep: Dep<'_>) -> Dependency {
|
||||
fn construct_dependency(arch: &str, alpm: &Alpm, dep: &Dep) -> Dependency {
|
||||
let kind = if dep
|
||||
.name()
|
||||
.rsplit('.')
|
||||
@@ -821,25 +791,25 @@ fn construct_dependency(arch: &str, alpm: &Alpm, dep: Dep<'_>) -> Dependency {
|
||||
DependencyKind::Depend
|
||||
};
|
||||
|
||||
common_dependency_data(arch, alpm, &dep, kind)
|
||||
common_dependency_data(arch, alpm, dep, kind)
|
||||
}
|
||||
|
||||
// constructs a (make) Dependency instance with the given data and return it back
|
||||
#[allow(clippy::needless_pass_by_value)]
|
||||
fn construct_make_dependency(arch: &str, alpm: &Alpm, dep: Dep<'_>) -> Dependency {
|
||||
common_dependency_data(arch, alpm, &dep, DependencyKind::Make)
|
||||
fn construct_make_dependency(arch: &str, alpm: &Alpm, dep: &Dep) -> Dependency {
|
||||
common_dependency_data(arch, alpm, dep, DependencyKind::Make)
|
||||
}
|
||||
|
||||
// constructs a (opt) Dependency instance with the given data and return it back
|
||||
#[allow(clippy::needless_pass_by_value)]
|
||||
fn construct_opt_dependency(arch: &str, alpm: &Alpm, dep: Dep<'_>) -> Dependency {
|
||||
common_dependency_data(arch, alpm, &dep, DependencyKind::Opt)
|
||||
fn construct_opt_dependency(arch: &str, alpm: &Alpm, dep: &Dep) -> Dependency {
|
||||
common_dependency_data(arch, alpm, dep, DependencyKind::Opt)
|
||||
}
|
||||
|
||||
fn common_dependency_data<'a>(
|
||||
arch: &str,
|
||||
alpm: &'a Alpm,
|
||||
dep: &Dep<'_>,
|
||||
dep: &Dep,
|
||||
kind: DependencyKind,
|
||||
) -> Dependency {
|
||||
let ver = if let Some(ver) = dep.version() {
|
||||
|
@@ -10,11 +10,14 @@
|
||||
<div>
|
||||
<label for="repo_name" title="Repositories to include in the search">Repositories</label>
|
||||
<select id="repo_name" name="repo" multiple="">
|
||||
<option value="World" {% if query|selected_repo("World") %} selected {% endif %}>World</option>
|
||||
<option value="Galaxy" {% if query|selected_repo("Galaxy") %} selected {% endif %}>Galaxy</option>
|
||||
<option value="System" {% if query|selected_repo("System") %} selected {% endif %}>System</option>
|
||||
<option value="Universe" {% if query|selected_repo("Universe") %} selected {% endif %}>Universe</option>
|
||||
<option value="Lib32" {% if query|selected_repo("Lib32") %} selected {% endif %}>Lib32</option>
|
||||
<option value="system" {% if repos|selected_repo("system") %} selected {% endif %}>System</option>
|
||||
<option value="world" {% if repos|selected_repo("world") %} selected {% endif %}>World</option>
|
||||
<option value="galaxy" {% if repos|selected_repo("galaxy") %} selected {% endif %}>Galaxy</option>
|
||||
<option value="lib32" {% if repos|selected_repo("lib32") %} selected {% endif %}>Lib32</option>
|
||||
<option value="system-gremlins" {% if repos|selected_repo("system-gremlins") %} selected {% endif %}>System-Gremlins</option>
|
||||
<option value="world-gremlins" {% if repos|selected_repo("world-gremlins") %} selected {% endif %}>World-Gremlins</option>
|
||||
<option value="galaxy-gremlins" {% if repos|selected_repo("galaxy-gremlins") %} selected {% endif %}>Galaxy-Gremlins</option>
|
||||
<option value="lib32-gremlins" {% if repos|selected_repo("lib32-gremlins") %} selected {% endif %}>Lib32-Gremlins</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
|
@@ -35,8 +35,8 @@
|
||||
<h2>{{ pkg.package_name }}-{{ pkg.version }} {% if pkg.flagged %}(<span class="flagged">flagged</span>){% endif %}</h2>
|
||||
<section role="action_panel" class="action_panel">
|
||||
<h4>Actions Panel</h4>
|
||||
<section role="action"><a href="{{ pkg.gitea_url }}" target="blank">View Package Sources</a></section>
|
||||
<section role="action"><a href="{{ pkg.gitea_url }}/graph" target="blank">View Package Changes</a></section>
|
||||
<section role="action"><a href="{{ pkg.gitea_url }}">View Package Sources</a></section>
|
||||
<section role="action"><a href="{{ pkg.gitea_url }}/graph">View Package Changes</a></section>
|
||||
{% if !pkg.flagged %}
|
||||
<section role="action"><a href="/flag_package/{{ pkg.package_name }}/{{ pkg.version }}">Flag package out-of-date</a></section>
|
||||
{% else %}
|
||||
@@ -65,7 +65,7 @@
|
||||
<section role="value">{{ pkg.replaces|provides_or_replaces }}</section>
|
||||
{% endif %}
|
||||
<section role="key">Upstream URL:</section>
|
||||
<section role="value"><a href="{{ pkg.upstream_url }}" target="_blank">{{ pkg.upstream_url }}</a></section>
|
||||
<section role="value"><a href="{{ pkg.upstream_url }}">{{ pkg.upstream_url }}</a></section>
|
||||
<section role="key">Size:</section>
|
||||
<section role="value">{{ pkg.size|human_readable }} MB</section>
|
||||
<section role="key">Installed Size:</section>
|
||||
|
Reference in New Issue
Block a user