diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/config.rs | 6 | ||||
| -rw-r--r-- | src/db/builds/mod.rs | 16 | ||||
| -rw-r--r-- | src/db/pkgbases.rs | 4 | ||||
| -rw-r--r-- | src/db/snapshots.rs | 7 |
4 files changed, 11 insertions, 22 deletions
diff --git a/src/config.rs b/src/config.rs index 4f6cef0..958fb0f 100644 --- a/src/config.rs +++ b/src/config.rs @@ -130,12 +130,10 @@ pub struct Config { pub password: String, pub base_url: String, pub build_profile: String, - pub git_bin: String, pub makepkg_bin: String, pub pacman_bin: String, pub repo_add_bin: String, pub gpg_bin: String, - pub build_user: String, pub sandbox: Sandbox, #[cfg(feature = "test-support")] #[serde(default, skip_serializing_if = "TestHooks::is_empty")] @@ -188,12 +186,10 @@ impl Default for Config { password: String::new(), base_url: "http://127.0.0.1:8484".into(), build_profile: "extra-x86_64".into(), - git_bin: "git".into(), makepkg_bin: "makepkg".into(), pacman_bin: "pacman".into(), repo_add_bin: "repo-add".into(), gpg_bin: "gpg".into(), - build_user: String::new(), sandbox: Sandbox::default(), #[cfg(feature = "test-support")] hooks: TestHooks::default(), @@ -287,6 +283,8 @@ impl Config { Ok(()) } + // Everything this assembles comes from the `test-support`-gated `hooks` + // field, so in a release build the argument and the vector are both unused. #[cfg_attr(not(feature = "test-support"), allow(unused_variables))] pub fn child_env_pairs(&self) -> Vec<(String, String)> { #[cfg_attr(not(feature = "test-support"), allow(unused_mut))] diff --git a/src/db/builds/mod.rs b/src/db/builds/mod.rs index fc84335..83566ad 100644 --- a/src/db/builds/mod.rs +++ b/src/db/builds/mod.rs @@ -16,17 +16,15 @@ pub struct BuildRow { pub state: BuildState, pub blocked_on_json: String, pub current_step: Option<String>, - pub lease_owner: Option<String>, pub lease_expires_at: Option<String>, pub attempt: i64, - pub priority: i64, pub cancel_requested: bool, pub error: Option<String>, } const BUILD_COLS: &str = "id, pkgbase_id, candidate_id, release_id, kind, world_snapshot_id, \ - build_profile, state, blocked_on_json, current_step, lease_owner, lease_expires_at, \ - attempt, priority, cancel_requested, error"; + build_profile, state, blocked_on_json, current_step, lease_expires_at, \ + attempt, cancel_requested, error"; pub(crate) fn row_to_build(r: &rusqlite::Row<'_>) -> rusqlite::Result<BuildRow> { let state = crate::db::state_col::<BuildState>(7, &r.get::<_, String>(7)?)?; @@ -41,12 +39,10 @@ pub(crate) fn row_to_build(r: &rusqlite::Row<'_>) -> rusqlite::Result<BuildRow> state, blocked_on_json: r.get(8)?, current_step: r.get(9)?, - lease_owner: r.get(10)?, - lease_expires_at: r.get(11)?, - attempt: r.get(12)?, - priority: r.get(13)?, - cancel_requested: r.get::<_, i64>(14)? != 0, - error: r.get(15)?, + lease_expires_at: r.get(10)?, + attempt: r.get(11)?, + cancel_requested: r.get::<_, i64>(12)? != 0, + error: r.get(13)?, }) } diff --git a/src/db/pkgbases.rs b/src/db/pkgbases.rs index 0f711a7..743aa43 100644 --- a/src/db/pkgbases.rs +++ b/src/db/pkgbases.rs @@ -14,7 +14,6 @@ pub struct Pkgbase { pub aur_head: Option<String>, pub current_accepted_release_id: Option<i64>, pub state: String, - pub unpinable: bool, } fn row_to_pkgbase(r: &Row<'_>) -> rusqlite::Result<Pkgbase> { @@ -26,12 +25,11 @@ fn row_to_pkgbase(r: &Row<'_>) -> rusqlite::Result<Pkgbase> { aur_head: r.get(4)?, current_accepted_release_id: r.get(5)?, state: r.get(6)?, - unpinable: r.get::<_, i64>(7)? != 0, }) } const PKGBASE_COLS: &str = "id, name, aur_url, mirror_path, aur_head, \ - current_accepted_release_id, state, unpinable"; + current_accepted_release_id, state"; pub fn get_pkgbase(db: &Db, name: &str) -> Result<Option<Pkgbase>> { db.read(|c| { diff --git a/src/db/snapshots.rs b/src/db/snapshots.rs index e227eca..7966c8b 100644 --- a/src/db/snapshots.rs +++ b/src/db/snapshots.rs @@ -44,7 +44,6 @@ pub struct SnapshotRow { pub aur_commit: String, pub recipe_hash: String, pub srcinfo_json: String, - pub files_json: String, } /// Find a snapshot by the commit it was taken at. @@ -55,7 +54,7 @@ pub struct SnapshotRow { pub fn snapshot_by_commit(db: &Db, pkgbase_id: i64, commit: &str) -> Result<Option<SnapshotRow>> { db.read(|c| { c.query_row( - "SELECT id, aur_commit, recipe_hash, srcinfo_json, files_json FROM snapshot + "SELECT id, aur_commit, recipe_hash, srcinfo_json FROM snapshot WHERE pkgbase_id=?1 AND aur_commit=?2", params![pkgbase_id, commit], |r| { @@ -64,7 +63,6 @@ pub fn snapshot_by_commit(db: &Db, pkgbase_id: i64, commit: &str) -> Result<Opti aur_commit: r.get(1)?, recipe_hash: r.get(2)?, srcinfo_json: r.get(3)?, - files_json: r.get(4)?, }) }, ) @@ -76,7 +74,7 @@ pub fn snapshot_by_commit(db: &Db, pkgbase_id: i64, commit: &str) -> Result<Opti pub fn snapshot_by_id(db: &Db, id: i64) -> Result<Option<SnapshotRow>> { db.read(|c| { c.query_row( - "SELECT id, aur_commit, recipe_hash, srcinfo_json, files_json FROM snapshot WHERE id=?1", + "SELECT id, aur_commit, recipe_hash, srcinfo_json FROM snapshot WHERE id=?1", params![id], |r| { Ok(SnapshotRow { @@ -84,7 +82,6 @@ pub fn snapshot_by_id(db: &Db, id: i64) -> Result<Option<SnapshotRow>> { aur_commit: r.get(1)?, recipe_hash: r.get(2)?, srcinfo_json: r.get(3)?, - files_json: r.get(4)?, }) }, ) |
