Skip to content

Commit 7a1841e

Browse files
committed
Upload New Files
1 parent df98d58 commit 7a1841e

6 files changed

Lines changed: 35 additions & 21 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
[package]
22
name = "ALPack"
3-
version = "3.1.0"
3+
version = "3.1.1"
44
edition = "2024"
55

66
[dependencies]
77
pico-args = { version = "0.5" }
8-
ureq = { version = "3.0", features = ["charset"] }
8+
ureq = { version = "3.1", features = ["charset"] }
99
scraper = { version = "0.25" }
10-
regex = { version = "1.11" }
11-
indicatif = { version = "0.18" }
10+
regex = { version = "1.12" }
11+
indicatif = { version = "0.18" }
1212
flate2 = { version = "1.1" }
1313
tar = { version = "0.4" }
14-
serde = { version = "1", features = ["derive"] }
14+
serde = { version = "1.0", features = ["derive"] }
1515
toml = { version = "0.9" }
16-
walkdir_minimal = { version = "1.0" }
17-
which = { version = "8.0" }
16+
walkdir_minimal = { version = "1.0" }
17+
which = { version = "8.0" }
1818

1919
[profile.release]
2020
opt-level = "z"

changelog

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
Fri Jan 30 21:19:00 -03 2026:
2+
- fallback if --apkbuild is dir
3+
- fix no_group option
4+
- add default install: glib-dev glib-static libtool
15
Fri Oct 24 20:02:13 -03 2025:
26
- update dependency scraper
3-
- add default install cmake and go
7+
- add default install: cmake go xz
48
- fix function for cache dir
59
Tue Sep 16 23:01:59 -03 2025:
610
- Code rewritten from shell to Rust

src/builder.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use crate::command::Command;
22
use crate::settings::Settings;
3+
use crate::setup::DEF_PACKAGES;
34
use crate::utils::_parse_key_value;
45
use crate::{parse_key_value, utils};
56

@@ -34,6 +35,7 @@ impl Builder {
3435
}
3536

3637
let mut cmd_args = Vec::new();
38+
let mut concat_args = Vec::new();
3739
let mut apkbuild_file = String::new();
3840

3941
let sett = Settings::load_or_create();
@@ -87,6 +89,8 @@ impl Builder {
8789
fs::copy(apkbuild_file.clone(), &dest_file)?;
8890

8991
Self::run_abuild(rootfs_dir.clone(), dir_name)?;
92+
} else if file_path.is_dir() {
93+
concat_args.push(apkbuild_file);
9094
} else {
9195
eprintln!(
9296
"\x1b[1;33mWarning\x1b[0m: Invalid file: {}, expected 'APKBUILD'",
@@ -101,7 +105,9 @@ impl Builder {
101105
}
102106
}
103107

104-
for p in cmd_args {
108+
concat_args.extend(cmd_args);
109+
110+
for p in concat_args {
105111
let path = Path::new(&p);
106112
let (pkg_name, mut dir_name): (String, String);
107113
let mut copy_only_apkbuild = false;
@@ -210,15 +216,16 @@ impl Builder {
210216
fn run_abuild(rootfs: String, dir_name: String) -> Result<(), Box<dyn Error>> {
211217
let cmd = format!(
212218
"
213-
type abuild > /dev/null || apk add alpine-sdk autoconf automake
219+
type abuild > /dev/null || apk add {a}
214220
HOME=/build
215221
test -f /etc/apk/keys/{u}*.rsa.pub && exit
216222
rm -rf /build/.abuild
217223
mkdir -p /build
218224
abuild-keygen -a -n
219225
cp -v /build/.abuild/{u}*.rsa.pub /etc/apk/keys/
220-
",
221-
u = env::var("USER").unwrap()
226+
",
227+
u = env::var("USER").unwrap(),
228+
a = DEF_PACKAGES
222229
);
223230

224231
Command::run(rootfs.clone(), None, Some(cmd), false, false, false)?;

src/command.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ impl Command {
9292
fn build_proot_options(rootfs: String, rootfs_args: String, no_extra_binds: bool, no_group: bool) -> String {
9393
let mut proot_options = format!("-R {rootfs} --bind=/media --bind=/mnt {rootfs_args}");
9494

95+
if no_group {
96+
proot_options.push_str(format!(
97+
" --bind={rootfs}/etc/group:/etc/group \
98+
--bind={rootfs}/etc/passwd:/etc/passwd").as_str()
99+
);
100+
}
101+
95102
if !no_extra_binds {
96103
if Path::new("/etc/asound.conf").exists() {
97104
proot_options.push_str(" --bind=/etc/asound.conf");
@@ -112,13 +119,6 @@ impl Command {
112119
proot_options.push_str(" --bind=/usr/share/themes");
113120
}
114121

115-
if no_group {
116-
proot_options.push_str(format!(
117-
" --bind={rootfs}/etc/group:/etc/group \
118-
--bind={rootfs}/etc/passwd:/etc/passwd").as_str()
119-
);
120-
}
121-
122122
if let Ok(entries) = fs::read_dir("/usr/share/icons") {
123123
for entry in entries.flatten() {
124124
let path = entry.path().join("cursors");

src/setup.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ use std::path::Path;
1616
use std::{fs, io};
1717
use tar::Archive;
1818

19+
pub const DEF_PACKAGES: &str =
20+
"alpine-sdk autoconf automake cmake glib-dev glib-static libtool go xz";
21+
1922
pub struct Setup {
2023
name: String,
2124
remaining_args: Vec<String>,
@@ -160,7 +163,7 @@ impl Setup {
160163
Command::run(
161164
dest_rootfs,
162165
None,
163-
Some("apk add alpine-sdk autoconf automake cmake go xz".to_string()),
166+
Some(format!("apk add {DEF_PACKAGES}")),
164167
true,
165168
true,
166169
false,

0 commit comments

Comments
 (0)