chore(i18n): finish translating code comments and scripts to English
CI / Format and clippy (push) Successful in 1m57s
CI / Dependency audit (push) Successful in 13s
CI / Check desktop app (Linux) (push) Successful in 3m54s
CI / Tests (Linux) (push) Failing after 7m25s
Release / Create release (push) Successful in 6s
Release / CLI (linux-aarch64) (push) Successful in 1m48s
Release / CLI (linux-x86_64) (push) Successful in 2m39s
Release / Desktop app (linux-aarch64) (push) Successful in 10m9s
Release / Desktop app (linux-x86_64) (push) Successful in 12m20s
Release / Desktop app (windows) (push) Successful in 7m32s
Release / Build latest.json (push) Successful in 5s
CI / Format and clippy (push) Successful in 1m57s
CI / Dependency audit (push) Successful in 13s
CI / Check desktop app (Linux) (push) Successful in 3m54s
CI / Tests (Linux) (push) Failing after 7m25s
Release / Create release (push) Successful in 6s
Release / CLI (linux-aarch64) (push) Successful in 1m48s
Release / CLI (linux-x86_64) (push) Successful in 2m39s
Release / Desktop app (linux-aarch64) (push) Successful in 10m9s
Release / Desktop app (linux-x86_64) (push) Successful in 12m20s
Release / Desktop app (windows) (push) Successful in 7m32s
Release / Build latest.json (push) Successful in 5s
Completes the English-only standardization for code, comments, scripts and CI templates (UI/CLI-facing strings stay bilingual pt-BR/en, untouched). Covers the remaining crates/, apps/gui/ui/ and apps/gui/src-tauri/ comments, .gitea/ workflow and template comments, .githooks/ hooks, and the scripts/ source comments for the files already renamed in a prior commit (check.sh, generate-logo.py, install-hooks.sh). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VAyr8d7HuAdUGB6aA5xmDD
This commit is contained in:
1 parent
da212e6926
commit
6328220c60
129 files changed
+1961
-1834
No files matched your search
@@ -1,5 +1,5 @@
|
||||
//! Btrfs: imagens criadas com mkfs.btrfs --rootdir; exclusão simulada como o COW faz
|
||||
//! (nova versão da folha em outro bloco, a antiga continua no disco).
|
||||
//! Btrfs: images created with `mkfs.btrfs --rootdir`; COW deletion simulated by writing a
|
||||
//! new fs-tree leaf generation to a free metadata block while leaving the old leaf on disk.
|
||||
|
||||
mod common;
|
||||
use common::*;
|
||||
@@ -89,7 +89,7 @@ fn lists_the_live_tree_with_paths_and_sizes() {
|
||||
assert!(listed.iter().any(|x| x.0 == "docs/sub" && x.2));
|
||||
}
|
||||
|
||||
// --- manipulação bruta de folhas (independente do módulo) ---
|
||||
// --- raw B-tree leaf manipulation helpers (independent of the production reader) ---
|
||||
|
||||
struct Leaf {
|
||||
raw: Vec<u8>,
|
||||
@@ -118,7 +118,7 @@ impl Leaf {
|
||||
let c = crc32c(&self.raw[32..]);
|
||||
self.raw[0..4].copy_from_slice(&c.to_le_bytes());
|
||||
}
|
||||
/// Nova versão da folha sem os itens que `drop` rejeita, num novo endereço lógico.
|
||||
/// Rebuilds a B-tree leaf without items matching `drop`, at a new logical `bytenr` and generation.
|
||||
fn without(&self, drop: impl Fn(u64, u8) -> bool, new_bytenr: u64) -> Leaf {
|
||||
let mut kept: Vec<(usize, Vec<u8>)> = vec![];
|
||||
for i in 0..self.nritems() {
|
||||
@@ -152,7 +152,7 @@ fn superblock(img: &[u8]) -> &[u8] {
|
||||
&img[0x10000..0x11000]
|
||||
}
|
||||
|
||||
/// Mapa lógico -> físico dos chunks de sistema (suficiente para imagens pequenas de um dispositivo).
|
||||
/// Logical -> physical chunk mapping from `sys_chunk_array` (sufficient for small single-device images).
|
||||
fn chunk_map(img: &[u8]) -> Vec<(u64, u64, u64)> {
|
||||
let sb = superblock(img);
|
||||
let n = u32::from_le_bytes(sb[160..164].try_into().unwrap()) as usize;
|
||||
@@ -193,7 +193,7 @@ fn deleted_file_survives_in_the_previous_version_of_the_leaf() {
|
||||
let fl = Leaf {
|
||||
raw: img[fs_leaf.0..fs_leaf.0 + nodesize].to_vec(),
|
||||
};
|
||||
// inode do arquivo apagado
|
||||
// find the objectid (inode) of the target file
|
||||
let victim = "relatorio.dat";
|
||||
let mut ino = 0;
|
||||
for k in 0..fl.nritems() {
|
||||
@@ -207,7 +207,7 @@ fn deleted_file_survives_in_the_previous_version_of_the_leaf() {
|
||||
}
|
||||
}
|
||||
assert!(ino > 256);
|
||||
// extent de dados do arquivo (para liberar no extent tree)
|
||||
// locate the file's data extent `(disk_bytenr, disk_num_bytes)` so we can free it in the extent tree
|
||||
let mut data_bytenr = 0;
|
||||
for k in 0..fl.nritems() {
|
||||
let (obj, ty, _, _, _) = fl.item(k);
|
||||
@@ -216,7 +216,7 @@ fn deleted_file_survives_in_the_previous_version_of_the_leaf() {
|
||||
}
|
||||
}
|
||||
assert!(data_bytenr > 0);
|
||||
// Novo bloco livre para a nova versão: primeiro bloco do metadata sem folha válida e todo zero.
|
||||
// Pick an all-zero metadata block for the new COW leaf generation.
|
||||
let free_slot = (0..img.len() / nodesize)
|
||||
.map(|n| n * nodesize)
|
||||
.find(|&o| {
|
||||
@@ -228,11 +228,11 @@ fn deleted_file_survives_in_the_previous_version_of_the_leaf() {
|
||||
&& o < fs_leaf.0 + (8 << 20)
|
||||
})
|
||||
.expect("bloco livre");
|
||||
// logical = bytenr da folha antiga + (offset físico - offset físico antigo): mesmo chunk
|
||||
// logical `bytenr` within the same metadata chunk
|
||||
let new_bytenr = to_logical(free_slot);
|
||||
let newleaf = fl.without(|o, _| o == ino, new_bytenr);
|
||||
img[free_slot..free_slot + nodesize].copy_from_slice(&newleaf.raw);
|
||||
// Aponta o ROOT_ITEM da árvore 5 para a nova versão (e sobe a geração), na folha da árvore raiz.
|
||||
// Update tree 5 (`FS_TREE`) `ROOT_ITEM` in the root tree to point to the new leaf and bump generation.
|
||||
let mut rl = Leaf {
|
||||
raw: img[root_leaf.0..root_leaf.0 + nodesize].to_vec(),
|
||||
};
|
||||
@@ -245,7 +245,7 @@ fn deleted_file_survives_in_the_previous_version_of_the_leaf() {
|
||||
}
|
||||
rl.seal();
|
||||
img[root_leaf.0..root_leaf.0 + nodesize].copy_from_slice(&rl.raw);
|
||||
// Libera o extent de dados no extent tree (em outro endereço da mesma folha).
|
||||
// Remove the file's data extent from the extent tree so its data blocks are marked free.
|
||||
let el = Leaf {
|
||||
raw: img[ext_leaf.0..ext_leaf.0 + nodesize].to_vec(),
|
||||
};
|
||||
@@ -290,7 +290,7 @@ fn deleted_file_survives_in_the_previous_version_of_the_leaf() {
|
||||
let rp = PathBuf::from(&rep.recovered[0].path);
|
||||
let got = std::fs::read(if rp.is_absolute() { rp } else { out.join(rp) }).unwrap();
|
||||
assert!(got == i.files[0].1);
|
||||
// Os arquivos que continuam existindo não aparecem como apagados.
|
||||
// Files that are still live in the current tree must not be reported as deleted.
|
||||
assert!(!c
|
||||
.found
|
||||
.iter()
|
||||
@@ -300,7 +300,7 @@ fn deleted_file_survives_in_the_previous_version_of_the_leaf() {
|
||||
|
||||
#[test]
|
||||
fn lzo_literals_and_a_match() {
|
||||
// 20 literais + fim
|
||||
// 20 literals + EOF marker
|
||||
let mut s = vec![17 + 20];
|
||||
s.extend((0..20u8).map(|i| b'a' + i));
|
||||
s.extend_from_slice(&[0x11, 0, 0]);
|
||||
@@ -308,7 +308,7 @@ fn lzo_literals_and_a_match() {
|
||||
lzo1x_decompress(&s, 4096).unwrap(),
|
||||
(0..20u8).map(|i| b'a' + i).collect::<Vec<_>>()
|
||||
);
|
||||
// "abcd" + M2 (dist 4, len 4) + fim
|
||||
// "abcd" + M2 backreference (distance 4, length 4) + EOF marker
|
||||
let s = vec![17 + 4, b'a', b'b', b'c', b'd', 0x6C, 0x00, 0x11, 0, 0];
|
||||
assert_eq!(lzo1x_decompress(&s, 4096).unwrap(), b"abcdabcd");
|
||||
}
|
||||
@@ -334,7 +334,7 @@ fn packed_extents_decode_zlib_and_zstd() {
|
||||
codec: PackedCodec::Zlib,
|
||||
};
|
||||
assert_eq!(p.read(&MemSource(disk)).unwrap(), &plain[1000..6000]);
|
||||
// zstd, se o utilitário existir
|
||||
// zstd-compressed extent (if the `zstd` CLI is installed)
|
||||
if have("zstd") {
|
||||
let dir = tempfile::tempdir().unwrap();
|
||||
let f = dir.path().join("p.bin");
|
||||
|
||||
Reference in new issue
Block a user