deb: detect package directory using cwd
remove linux-riscv specific quirk
This commit is contained in:
@@ -13,7 +13,3 @@ quirks:
|
|||||||
# parameters:
|
# parameters:
|
||||||
# key: value
|
# key: value
|
||||||
|
|
||||||
linux-riscv:
|
|
||||||
deb:
|
|
||||||
package_directory:
|
|
||||||
- linux-main
|
|
||||||
|
|||||||
@@ -150,6 +150,23 @@ pub(crate) fn find_package_directory(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Try the current working directory name as a package directory
|
||||||
|
// This is useful when the user is inside a non-standard package directory
|
||||||
|
// e.g. ~/kernels/linux-riscv/linux-main -> tries "linux-main"
|
||||||
|
if let Ok(cwd) = std::env::current_dir()
|
||||||
|
&& let Some(cwd_name) = cwd.file_name()
|
||||||
|
{
|
||||||
|
let cwd_name_str = cwd_name.to_string_lossy();
|
||||||
|
let package_dir = parent_dir.join(cwd_name_str.as_ref());
|
||||||
|
if ctx.exists(&package_dir)? && ctx.exists(&package_dir.join("debian"))? {
|
||||||
|
log::debug!(
|
||||||
|
"Found package directory via CWD name: {}",
|
||||||
|
package_dir.display()
|
||||||
|
);
|
||||||
|
return Ok(package_dir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Try package/package pattern first
|
// Try package/package pattern first
|
||||||
let package_dir = parent_dir.join(package).join(package);
|
let package_dir = parent_dir.join(package).join(package);
|
||||||
if ctx.exists(&package_dir)? && ctx.exists(&package_dir.join("debian"))? {
|
if ctx.exists(&package_dir)? && ctx.exists(&package_dir.join("debian"))? {
|
||||||
|
|||||||
Reference in New Issue
Block a user