summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/manifest.rs22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/manifest.rs b/src/manifest.rs
index 5b7ae77..ed326e1 100644
--- a/src/manifest.rs
+++ b/src/manifest.rs
@@ -279,9 +279,25 @@ fn portable_path(path: &Path) -> Result<String> {
}
fn is_enabled_service(path: &str) -> bool {
- path.starts_with("etc/systemd/system/")
- && path.contains(".target.wants/")
- && path.ends_with(".service")
+ let mut components = path.split('/');
+ matches!(
+ (
+ components.next(),
+ components.next(),
+ components.next(),
+ components.next(),
+ components.next(),
+ components.next(),
+ ),
+ (
+ Some("etc"),
+ Some("systemd"),
+ Some("system"),
+ Some(wants),
+ Some(service),
+ None,
+ ) if wants.ends_with(".target.wants") && service.ends_with(".service")
+ )
}
fn is_internal_metadata_path(path: &str) -> bool {