Codebase list rust-stfu8 / 1c9e133
added translation files to ripasso-cursive, and fixed a bug in the new user wizard Alexander Kjäll 1 year, 3 months ago
7 changed file(s) with 132 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 rust-ripasso-cursive (0.6.1-2) UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; urgency=medium
1
2 * Package ripasso-cursive 0.6.1 from crates.io using debcargo 2.6.0
3 * Add translation files from upstream
4 * Fix the new user wizard
5
6 -- Alexander Kjäll <alexander.kjall@gmail.com> Thu, 09 Feb 2023 21:13:48 +0100
7
08 rust-ripasso-cursive (0.6.1-1) unstable; urgency=medium
19
210 * Package ripasso-cursive 0.6.1 from crates.io using debcargo 2.6.0
0 diff --git a/build.rs b/build.rs
1 index eb3e307..dbde16e 100644
2 --- a/build.rs
3 +++ b/build.rs
4 @@ -116,7 +116,6 @@ fn generate_translation_files() {
5 dir.pop();
6 dir.pop();
7 dir.pop();
8 - dir.push("cursive");
9 dir.push("res");
10
11 let translation_path_glob = dir.join("**/*.po");
00 relax-deps.patch
1 unbreak-new-user-wizard.patch
2 fix-translation-generation.patch
0 diff --git a/src/main.rs b/src/main.rs
1 index 9354d59..a2693b7 100644
2 --- a/src/main.rs
3 +++ b/src/main.rs
4 @@ -1169,6 +1169,19 @@ fn get_stores(config: &config::Config, home: &Option<PathBuf>) -> Result<Vec<Pas
5 )?);
6 }
7 }
8 + } else if final_stores.len() == 0 && home.is_some() {
9 + let default_path = home.clone().unwrap().join(".password_store");
10 + if default_path.exists() {
11 + final_stores.push(PasswordStore::new(
12 + "default",
13 + &Some(default_path),
14 + &None,
15 + home,
16 + &None,
17 + &CryptoImpl::GpgMe,
18 + &None,
19 + )?);
20 + }
21 }
22
23 Ok(final_stores)
24 @@ -1176,7 +1189,7 @@ fn get_stores(config: &config::Config, home: &Option<PathBuf>) -> Result<Vec<Pas
25
26 /// Validates the config for password stores.
27 /// Returns a list of paths that the new store wizard should be run for
28 -fn validate_stores_config(settings: &config::Config) -> Vec<PathBuf> {
29 +fn validate_stores_config(settings: &config::Config, home: &Option<PathBuf>) -> Vec<PathBuf> {
30 let mut incomplete_stores: Vec<PathBuf> = vec![];
31
32 let stores_res = settings.get("stores");
33 @@ -1202,6 +1215,8 @@ fn validate_stores_config(settings: &config::Config) -> Vec<PathBuf> {
34 }
35 }
36 }
37 + } else if incomplete_stores.len() == 0 && home.is_some() {
38 + incomplete_stores.push(home.clone().unwrap().join(".password_store"));
39 }
40
41 incomplete_stores
42 @@ -1758,7 +1773,7 @@ fn main() {
43 let password_store_signing_key = std::env::var("PASSWORD_STORE_SIGNING_KEY").ok();
44 let xdg_config_home = match std::env::var("XDG_CONFIG_HOME") {
45 Err(_) => None,
46 - Ok(home_path) => Some(PathBuf::from(home_path)),
47 + Ok(config_home_path) => Some(PathBuf::from(config_home_path)),
48 };
49
50 pass::read_config(
51 @@ -1774,7 +1789,7 @@ fn main() {
52 }
53 let (config, config_file_location) = config_res.unwrap();
54
55 - for path in validate_stores_config(&config) {
56 + for path in validate_stores_config(&config, &home) {
57 wizard::show_init_menu(&Some(path), &home);
58 }
59
60 @@ -1783,7 +1798,8 @@ fn main() {
61 eprintln!("Error {}", err);
62 process::exit(1);
63 }
64 - let stores: StoreListType = Arc::new(Mutex::new(
65 +
66 +let stores: StoreListType = Arc::new(Mutex::new(
67 stores
68 .unwrap()
69 .into_iter()
70 @@ -1791,6 +1807,19 @@ fn main() {
71 .collect(),
72 ));
73
74 + if !config_file_location.exists() && stores.lock().unwrap().len() == 1 {
75 + let mut config_file_dir = config_file_location.clone();
76 + config_file_dir.pop();
77 + if let Err(err) = std::fs::create_dir_all(config_file_dir) {
78 + eprintln!("Error {err}");
79 + process::exit(1);
80 + }
81 + if let Err(err) = pass::save_config(stores.clone(), &config_file_location) {
82 + eprintln!("Error {err}");
83 + process::exit(1);
84 + }
85 + }
86 +
87 let store: PasswordStoreType = Arc::new(Mutex::new(stores.lock().unwrap()[0].clone()));
88 #[allow(clippy::significant_drop_in_scrutinee)]
89 for ss in stores.lock().unwrap().iter() {
0 #!/usr/bin/make -f
1
2 include /usr/share/dpkg/pkg-info.mk
3
4 %:
5 dh $@ --buildsystem cargo
6
7 override_dh_install:
8 mkdir -p debian/ripasso-cursive/usr/share/ripasso/
9 cp -f target/translations/cursive/de.mo debian/ripasso-cursive/usr/share/ripasso/
10 cp -f target/translations/cursive/fr.mo debian/ripasso-cursive/usr/share/ripasso/
11 cp -f target/translations/cursive/it.mo debian/ripasso-cursive/usr/share/ripasso/
12 cp -f target/translations/cursive/nb.mo debian/ripasso-cursive/usr/share/ripasso/
13 cp -f target/translations/cursive/nn.mo debian/ripasso-cursive/usr/share/ripasso/
14 cp -f target/translations/cursive/sv.mo debian/ripasso-cursive/usr/share/ripasso/
15 dh_install
16
0 #!/usr/bin/make -f
1 %:
2 dh $@ --buildsystem cargo