Skip to content

Commit 1ef036a

Browse files
committed
Merge upstream changes
2 parents f12b1f7 + 4d2699a commit 1ef036a

File tree

13 files changed

+146
-220
lines changed

13 files changed

+146
-220
lines changed

Cargo.lock

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ include = ["src/**/*", "LICENSE", "README.md", "CHANGELOG.md", "help"]
1414

1515

1616
[dependencies]
17-
alpm = "2.1.3"
17+
alpm = "2.2.1"
1818
alpm-utils = "1.1.2"
1919
aur-depends = "1.0.3"
2020
aur-fetch = "0.10.0"
@@ -63,3 +63,6 @@ generate = ["alpm/generate"]
6363
static = ["alpm/static"]
6464
mock = ["async-trait"]
6565
container = []
66+
67+
#[patch.crates-io]
68+
#alpm = { path = "../alpm.rs/alpm" }

man/paru.8

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,9 @@ separated list that is quoted by the shell.
289289
This enables fm review mode, where PKGBUILD review is done using the file
290290
manager specified by command.
291291

292+
This allows the PKGBUILDs and related files to be edited. Changes won't
293+
persist unless commited.
294+
292295
.TP
293296
.B \-\-fmflags <flags>
294297
Passes arguments to file manager. These flags get passed to every instance where

man/paru.conf.5

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,9 @@ guaranteed to work with a custom \fBsudo\fR command.
262262
This enables fm review mode, where PKGBUILD review is done using the file
263263
manager specified by command.
264264

265+
This allows the PKGBUILDs and related files to be edited. Changes won't
266+
persist unless commited.
267+
265268
.TP
266269
.B MFlags = Flags...
267270
Passes arguments to makepkg. These flags get passed to every instance where

po/es.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ msgstr " -p --print Imprimir pkgbuild en stdout"
621621

622622
#: src/help.rs:91
623623
msgid " -c --comments Print AUR comments for pkgbuild"
624-
msgstr " -c --comments Mostrar comentarios de AUR para pkgbuild"
624+
msgstr " -c --comments Mostrar comentarios de AUR para pkgbuild"
625625

626626
#: src/help.rs:93
627627
msgid "upgrade specific options:"

po/nl.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ msgstr "het parsen van de gegenereerde srcinfo door makepkg is mislukt"
339339

340340
#: src/install.rs:171 src/install.rs:442
341341
msgid "Resolving dependencies..."
342-
msgstr "Afhaneklijkheden oplossen..."
342+
msgstr "Afhankelijkheden oplossen..."
343343

344344
#: src/install.rs:220 src/install.rs:225
345345
msgid "failed to download sources"

src/chroot.rs

Lines changed: 36 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use anyhow::Result;
44
use std::ffi::OsStr;
55
use std::io::Write;
66
use std::path::{Path, PathBuf};
7+
use std::process::Command;
78

89
#[derive(Debug)]
910
pub struct Chroot {
@@ -37,52 +38,49 @@ impl Chroot {
3738
}
3839

3940
pub fn create<S: AsRef<OsStr>>(&self, config: &Config, pkgs: &[S]) -> Result<()> {
40-
let args = &[
41-
OsStr::new("install"),
42-
OsStr::new("-dm755"),
43-
self.path.as_os_str(),
44-
];
45-
exec::command(&config.sudo_bin, ".", args)?;
41+
let mut cmd = Command::new(&config.sudo_bin);
42+
cmd.arg("install").arg("-dm755").arg(&self.path);
43+
exec::command(&mut cmd)?;
4644

4745
let tmp = pacman_conf(&self.pacman_conf)?;
4846
let dir = self.path.join("root");
4947

50-
let mut args = vec![
51-
OsStr::new("-C"),
52-
tmp.path().as_os_str(),
53-
OsStr::new("-M"),
54-
OsStr::new(&self.makepkg_conf),
55-
dir.as_os_str(),
56-
];
57-
args.extend(pkgs.iter().map(|p| p.as_ref()));
58-
exec::command("mkarchroot", ".", &args)?;
48+
let mut cmd = Command::new("makechrootpkg");
49+
cmd.arg("-C")
50+
.arg(tmp.path())
51+
.arg("-M")
52+
.arg(&self.makepkg_conf)
53+
.arg(dir)
54+
.args(pkgs);
55+
56+
exec::command(&mut cmd)?;
5957
Ok(())
6058
}
6159

6260
pub fn run<S: AsRef<OsStr>>(&self, args: &[S]) -> Result<()> {
6361
let dir = self.path.join("root");
6462
let tmp = pacman_conf(&self.pacman_conf)?;
6563

66-
let mut a = vec![
67-
OsStr::new("-C"),
68-
tmp.path().as_os_str(),
69-
OsStr::new("-M"),
70-
OsStr::new(&self.makepkg_conf),
71-
dir.as_os_str(),
72-
];
64+
let mut cmd = Command::new("arch-nspawn");
65+
cmd.arg("-C")
66+
.arg(tmp.path())
67+
.arg("-M")
68+
.arg(&self.makepkg_conf)
69+
.arg(dir);
7370

7471
for file in &self.ro {
75-
a.push(OsStr::new("--bind-ro"));
76-
a.push(OsStr::new(file));
72+
cmd.arg("--bind-ro");
73+
cmd.arg(file);
7774
}
7875

7976
for file in &self.rw {
80-
a.push(OsStr::new("--bind"));
81-
a.push(OsStr::new(file));
77+
cmd.arg("--bind");
78+
cmd.arg(file);
8279
}
8380

84-
a.extend(args.iter().map(|p| p.as_ref()));
85-
exec::command("arch-nspawn", ".", &a)?;
81+
cmd.args(args);
82+
83+
exec::command(&mut cmd)?;
8684
Ok(())
8785
}
8886

@@ -91,72 +89,24 @@ impl Chroot {
9189
}
9290

9391
pub fn build(&self, pkgbuild: &Path, chroot_flags: &[&str], flags: &[&str]) -> Result<()> {
94-
let mut args = chroot_flags.iter().map(OsStr::new).collect::<Vec<_>>();
95-
args.push(OsStr::new("-r"));
96-
args.push(OsStr::new(self.path.as_os_str()));
92+
let mut cmd = Command::new("makechrootpkg");
93+
94+
cmd.current_dir(pkgbuild)
95+
.args(chroot_flags)
96+
.arg("-r")
97+
.arg(&self.path);
9798

9899
for file in &self.ro {
99-
args.push(OsStr::new("-D"));
100-
args.push(OsStr::new(file));
100+
cmd.arg("-D").arg(file);
101101
}
102102

103103
for file in &self.rw {
104-
args.push(OsStr::new("-d"));
105-
args.push(OsStr::new(file));
104+
cmd.arg("-d").arg(file);
106105
}
107106

108-
args.push(OsStr::new("--"));
109-
110-
for flag in flags {
111-
args.push(OsStr::new(flag));
112-
}
113-
for flag in &self.mflags {
114-
args.push(OsStr::new(flag));
115-
}
107+
cmd.arg("--").args(flags).args(&self.mflags);
116108

117-
exec::command("makechrootpkg", pkgbuild, &args)?;
109+
exec::command(&mut cmd)?;
118110
Ok(())
119111
}
120112
}
121-
122-
/*pub fn chroot(globals: clap::Globals, ch: clap::Chroot) -> Result<()> {
123-
let pacman = pacmanconf::Config::from_file(&globals.pacman_conf)?;
124-
125-
let chroot = Chroot {
126-
path: ch.chroot,
127-
pacman_conf: globals.pacman_conf.clone(),
128-
makepkg_conf: globals.makepkg_conf.clone(),
129-
ro: repo::all_files(&pacman)
130-
.iter()
131-
.map(|s| s.to_string())
132-
.collect(),
133-
rw: pacman.cache_dir.clone(),
134-
};
135-
136-
println!("{:?}", chroot);
137-
138-
if !chroot.path.exists() && !ch.create {
139-
bail!("chroot does not exist: use 'chroot -c' to create it");
140-
}
141-
142-
if ch.create {
143-
if ch.targets.is_empty() {
144-
chroot.create(&["base-devel"])?;
145-
} else {
146-
chroot.create(&ch.targets)?;
147-
}
148-
} else if ch.upgrade {
149-
chroot.update()?;
150-
} else if ch.interactive {
151-
let targs: &[&str] = &[];
152-
chroot.run(targs)?;
153-
} else if ch.sync {
154-
let mut cmd = vec!["pacman", "-S", "--ask=255"];
155-
cmd.extend(ch.targets.iter().map(|s| s.as_str()));
156-
chroot.run(&cmd)?;
157-
} else {
158-
chroot.run(&ch.targets)?;
159-
}
160-
161-
Ok(())
162-
}*/

src/download.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -410,10 +410,9 @@ pub async fn show_comments(config: &mut Config) -> Result<i32> {
410410
let c = config.color;
411411

412412
for base in &bases.bases {
413-
let url = config.aur_url.join(&format!(
414-
"packages/{}/comments?&PP=1000000",
415-
base.package_base()
416-
))?;
413+
let url = config
414+
.aur_url
415+
.join(&format!("packages/{}", base.package_base()))?;
417416

418417
let response = client
419418
.get(url.clone())
@@ -441,7 +440,7 @@ pub async fn show_comments(config: &mut Config) -> Result<i32> {
441440

442441
if config.sort_mode == SortMode::TopDown {
443442
for (title, comment) in iter.into_iter() {
444-
println!("{}", c.bold.paint(title.trim()));
443+
print_indent(c.bold, 0, 0, config.cols, " ", title.split_whitespace());
445444

446445
for line in comment.trim().split('\n') {
447446
let line = line.split_whitespace();
@@ -452,7 +451,7 @@ pub async fn show_comments(config: &mut Config) -> Result<i32> {
452451
}
453452
} else {
454453
for (title, comment) in iter.into_iter().rev() {
455-
println!("{}", c.bold.paint(title.trim()));
454+
print_indent(c.bold, 0, 0, config.cols, " ", title.split_whitespace());
456455

457456
for line in comment.trim().split('\n') {
458457
let line = line.split_whitespace();

0 commit comments

Comments
 (0)