Commit 1b40b2e8 authored by Sophie Herold's avatar Sophie Herold
Browse files

lib/data: Fix monitor/api not sub-domains for Dev

parent f5067bd0
Pipeline #382304 passed with stages
in 15 minutes and 33 seconds
......@@ -2,8 +2,8 @@ podir = '../po'
plain_id = run_command('cat', 'APPLICATION_ID', check: true).stdout()
application_id = plain_id + get_option('app_id_suffix')
daemon_id = plain_id + '.Monitor' + get_option('app_id_suffix')
api_id = plain_id + '.Api' + get_option('app_id_suffix')
daemon_id = plain_id + get_option('app_id_suffix') + '.Monitor'
api_id = plain_id + get_option('app_id_suffix') + '.Api'
# Desktop files
......
......@@ -295,17 +295,15 @@ impl Pattern {
.ok(),
_ => None,
}
} else if s.contains(['*', '?', '[']) {
Some(Self::Fnmatch(std::ffi::OsString::from(s)))
} else {
if s.contains(['*', '?', '[']) {
Some(Self::Fnmatch(std::ffi::OsString::from(s)))
} else {
Some(Self::PathPrefix(
path::PathBuf::from(&s)
.strip_prefix(glib::home_dir())
.map(|x| x.to_path_buf())
.unwrap_or_else(|_| s.into()),
))
}
Some(Self::PathPrefix(
path::PathBuf::from(&s)
.strip_prefix(glib::home_dir())
.map(|x| x.to_path_buf())
.unwrap_or_else(|_| s.into()),
))
}
}
......
......@@ -47,12 +47,14 @@ fn dbus_api_path() -> String {
fn daemon_app_id() -> String {
format!(
"{}.Monitor{}",
"{}{}.Monitor",
UNPREFIXED_APP_ID,
option_env!("APPLICATION_ID_SUFFIX").unwrap_or_default()
)
}
const DAEMON_BINARY: &str = concat!(env!("CARGO_PKG_NAME"), "-monitor");
mod action;
pub mod borg;
pub mod config;
......
......@@ -245,7 +245,7 @@ impl Due {
}
} else {
Err(Self::NotDue {
next: scheduled_date.and_hms(0, 0, 0) + chrono::Duration::weeks(1),
next: (scheduled_date + chrono::Duration::weeks(1)).and_hms(0, 0, 0),
})
}
}
......@@ -451,7 +451,7 @@ fn test_check_weekly() {
Err(Due::NotDue { next }) => {
assert_eq!(
next,
chrono::Local::today().and_hms(0, 0, 0) + chrono::Duration::days(6)
(chrono::Local::today() + chrono::Duration::days(6)).and_hms(0, 0, 0)
);
true
}
......
......@@ -101,7 +101,7 @@ pub async fn background_permission() -> Result<()> {
&ashpd::WindowIdentifier::default(),
&gettext("Schedule backups and continue running backups."),
true,
Some(&["pika-backup-monitor"]),
Some(&[crate::DAEMON_BINARY]),
// Do not use dbus-activation because that would start the UI
// See <https://gitlab.gnome.org/Teams/Design/hig-www/-/issues/107>
false,
......@@ -132,7 +132,7 @@ pub async fn background_permission() -> Result<()> {
)
}
Ok(_) => {
let mut command = std::process::Command::new("pika-backup-monitor");
let mut command = std::process::Command::new(crate::DAEMON_BINARY);
if let Ok(debug) = std::env::var("G_MESSAGES_DEBUG") {
command.env("G_MESSAGES_DEBUG", debug);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment