This repository has been archived by the owner on May 2, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
906 additions
and
433 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Changelog | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
## Unreleased | ||
|
||
## Added | ||
|
||
- Configuration handler in [#58](https://github.com/pacstall/libpacstall/pull/58) by [\@wizard-28](https://github.com/wizard-28) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,16 @@ | |
name = "libpacstall" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
[lib] | ||
name = "libpacstall" | ||
authors = [ | ||
"Sourajyoti Basak <[email protected]>", | ||
"David Brochero <[email protected]>", | ||
"Paul Cosma <[email protected]>" | ||
] | ||
description = "Backend API library for Pacstall" | ||
repository = "https://github.com/pacstall/libpacstall" | ||
license = "GPL-3.0-or-later" | ||
keywords = ["aur", "pacstall", "package-manager", "linux", "apt"] | ||
categories = ["caching", "config", "parsing", "os::linux-apis"] | ||
|
||
[dependencies] | ||
figment = { version = "0.10.6", features = ["env", "test", "toml" ] } | ||
|
@@ -14,6 +20,7 @@ serde = { version = "1.0.144", features = ["derive"] } | |
chrono = { version = "0.4.22", features = ["serde"] } | ||
serde_derive = "1.0.144" | ||
serde_json = "1.0.85" | ||
thiserror = "1.0" | ||
|
||
[dev-dependencies] | ||
rstest = "0.15.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,5 @@ | |
)] | ||
#![allow(clippy::must_use_candidate)] | ||
pub mod config; | ||
pub mod model; | ||
pub mod store; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//! Provides structs to handle Pacstall's data models. | ||
|
||
mod pacbuild; | ||
mod repository; | ||
|
||
pub use crate::model::pacbuild::*; | ||
pub use crate::model::repository::{default_repository, Repository}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,35 @@ | ||
use chrono::NaiveDateTime as DateTime; | ||
use serde_derive::{Deserialize, Serialize}; | ||
|
||
use crate::model::pacbuild::PacBuild; | ||
|
||
#[derive(Debug, Clone, Serialize, Deserialize)] | ||
/// Representation of a Pacstall repository. | ||
/// | ||
/// Defaults to the official repository. | ||
#[derive(Deserialize, Debug, Eq, PartialEq, Serialize, Clone)] | ||
#[serde(deny_unknown_fields)] | ||
pub struct Repository { | ||
/// The name of the repository. | ||
pub name: String, | ||
pub last_updated: DateTime, | ||
/// URL of the repository. | ||
/// | ||
/// Note that the URL **isn't verified** during extraction! | ||
pub url: String, | ||
pub pacbuilds: Vec<PacBuild>, | ||
pub priority: u8, | ||
/// Preference of the repository. | ||
/// | ||
/// Specifies which repository to look into first during certain operations | ||
/// like installing a package. If the package isn't present in the first | ||
/// preferred repository, then the second preferred repository is looked | ||
/// into. | ||
pub preference: u32, | ||
} | ||
|
||
#[allow(clippy::module_name_repetitions)] | ||
pub fn default_repository() -> Vec<Repository> { vec![Repository::default()] } | ||
|
||
impl Default for Repository { | ||
fn default() -> Self { | ||
Self { | ||
name: "official".into(), | ||
url: "https://github.com/pacstall/pacstall-programs".into(), | ||
preference: 1, | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.