Skip to content

Commit

Permalink
Release '0.9.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
hwittenborn committed Sep 26, 2022
1 parent 5132bb8 commit d9f88b8
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 36 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.9.9] - 2022-09-26
### Changed
- Pass in each file manually to `${EDITOR}` during file review.

### Fixed
- Fix issues with MPR dependency resolver.

## [0.9.8] - 2022-09-26
### Fixed
- Fix panics when using the `-i` flag with `mist list`.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mist"
version = "0.9.8"
version = "0.9.9"
authors = ["Hunter Wittenborn <[email protected]"]
description = "The official command-line interface for the makedeb Package Repository"
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion makedeb/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# `-H 'MPR-Package: yes'` to your `makedeb` call if you want Mist to be able to
# automatically update itself.
pkgname=mist
pkgver=0.9.8
pkgver=0.9.9
pkgrel=1
pkgdesc='The official command-line interface for the makedeb Package Repository'
arch=('any')
Expand Down
39 changes: 35 additions & 4 deletions src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,10 @@ impl Cache {
println!();

loop {
message::question(&format!("Review files for '{}'? [Y/n] ", pkg.green()));
message::question(&format!(
"Review files for '{}'? [Y/n] ",
pkg.bold().green()
));
io::stdout().flush().unwrap();

let mut resp = String::new();
Expand All @@ -558,8 +561,30 @@ impl Cache {
cache_dir.push("git-pkg");
cache_dir.push(pkg);

let files = {
let mut files = vec![];

let mut cmd = util::sudo::run_as_normal_user("git");
cmd.args(["ls-tree", "master", "--name-only"]);
let output = cmd.output().unwrap();
util::check_exit_status(&cmd, &output.status);

let string = std::str::from_utf8(&output.stdout).unwrap();

for file in string.lines() {
// There's no point in having the user review the '.SRCINFO' file.
if file == ".SRCINFO" {
continue;
}

files.push(file.to_string());
}

files
};

let mut cmd = util::sudo::run_as_normal_user(&editor);
cmd.arg("./");
cmd.args(files);

let status = cmd.spawn().unwrap().wait().unwrap();
util::check_exit_status(&cmd, &status)
Expand Down Expand Up @@ -597,7 +622,7 @@ impl Cache {
for pkg in pkg_group {
let mut git_dir = cache_dir.clone();
git_dir.push(pkg.clone());
env::set_current_dir(git_dir).unwrap();
env::set_current_dir(&git_dir).unwrap();

// See this package has a control field value of 'MPR-Package'. If it does,
// don't add it to our arg list. TODO: We need to add this key
Expand Down Expand Up @@ -636,7 +661,13 @@ impl Cache {
let arch = control_file.get("Architecture").unwrap();

if flattened_pkgnames.contains(&pkgname.as_str()) {
debs.push(format!("{}_{}_{}.deb", pkgname, version, arch));
debs.push(format!(
"{}/{}_{}_{}.deb",
git_dir.display(),
pkgname,
version,
arch
));
}

install_list.push([
Expand Down
36 changes: 7 additions & 29 deletions src/install_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,9 @@ use std::{env, fs};
pub fn clone_mpr_pkgs(pkglist: &Vec<&str>, mpr_url: &str) {
let mut cache_dir = util::xdg::get_cache_dir();
cache_dir.push("git-pkg");

// Lint checks for the cache dir.
if !cache_dir.exists() {
if fs::create_dir_all(&cache_dir).is_err() {
message::error(&format!(
"Failed to create directory for cache directory ({}).\n",
cache_dir
.into_os_string()
.into_string()
.unwrap()
.green()
.bold()
));
quit::with_code(exitcode::UNAVAILABLE);
}
} else if !cache_dir.is_dir() {
message::error(&format!(
"Config directory path '{}' needs to be a directory, but it isn't.\n",
cache_dir
.into_os_string()
.into_string()
.unwrap()
.green()
.bold()
));
quit::with_code(exitcode::UNAVAILABLE);
}
util::sudo::to_normal();
util::fs::create_dir(&cache_dir.clone().into_os_string().into_string().unwrap());
util::sudo::to_root();

// Check each package.
for pkg in pkglist {
Expand Down Expand Up @@ -188,7 +164,7 @@ pub fn order_mpr_packages(cache: &Cache, pkglist: &Vec<&str>) -> Vec<Vec<String>
}
};

if !mpr_pkg_change {
if apt_cache.get(&pkg.name()).is_some() {
let normal_pkg = apt_cache.get(&pkg.name()).unwrap();
let normal_pkg_keep = normal_pkg.marked_keep();

Expand Down Expand Up @@ -234,7 +210,9 @@ pub fn order_mpr_packages(cache: &Cache, pkglist: &Vec<&str>) -> Vec<Vec<String>
}

normal_pkg.protect();
} else {
}

if mpr_pkg_change {
mpr_pkgs.first_mut().unwrap().push(pkg);
}
}
Expand Down

0 comments on commit d9f88b8

Please sign in to comment.