pub enum MakefileAction {
Show 13 variants
ReplaceRecipe {
file: PathBuf,
target: String,
recipe: String,
new_recipe: String,
},
RemoveRecipe {
file: PathBuf,
target: String,
recipe: String,
},
SetVariable {
file: PathBuf,
name: String,
value: String,
},
SetVariableOperator {
file: PathBuf,
name: String,
operator: String,
},
RemoveVariable {
file: PathBuf,
name: String,
},
RemoveRule {
file: PathBuf,
target: String,
},
RemovePhonyTarget {
file: PathBuf,
target: String,
},
RenameRuleTarget {
file: PathBuf,
from_target: String,
to_target: String,
},
AddRule {
file: PathBuf,
target: String,
prerequisites: Vec<String>,
},
AddPhonyTarget {
file: PathBuf,
target: String,
},
AddInclude {
file: PathBuf,
path: String,
},
ReplaceVariableWithInclude {
file: PathBuf,
name: String,
path: String,
},
InsertIncludeBeforeVariable {
file: PathBuf,
path: String,
before_variable: String,
},
}Expand description
Edits to a Makefile (typically debian/rules).
Recipes are addressed by their exact current text (including leading indentation). This avoids index drift when multiple recipe edits target the same rule.
Variants§
ReplaceRecipe
Replace the first recipe whose text exactly matches recipe in the
rule whose primary target is target. A no-op if no rule or recipe
matches.
Fields
RemoveRecipe
Remove the first recipe whose text exactly matches recipe from the
rule whose primary target is target. A no-op if no rule or recipe
matches.
Fields
SetVariable
Replace the value of the first variable definition for name.
A no-op if no such variable exists.
Fields
SetVariableOperator
Change the assignment operator on the first variable definition
for name (e.g. := to ?=). A no-op if no such variable
exists or it already uses operator.
Fields
RemoveVariable
Remove the first variable definition for name. A no-op if no such
variable exists.
Fields
RemoveRule
Remove the first rule whose primary target is target. A no-op if
no such rule exists.
Fields
RemovePhonyTarget
Remove target from the prerequisites of the .PHONY rule. If
.PHONY becomes empty, the rule itself is removed. A no-op if
the target is not listed.
Fields
RenameRuleTarget
Rename a target on the first rule that has it. A no-op if no rule has the old target.
Fields
AddRule
Append a new rule with target and the given (possibly empty)
prerequisites. The applier does not check for an existing rule —
detectors must guard against duplicates themselves.
Fields
AddPhonyTarget
Add target to the prerequisites of the .PHONY rule. A no-op if
.PHONY already lists target. If no .PHONY rule exists, the
applier creates one.
Fields
AddInclude
Add an include <path> directive. A no-op if the file is already
included.
Fields
ReplaceVariableWithInclude
Replace the first variable definition for name with an
include <path> directive. A no-op if the variable doesn’t
exist or path is already included. Used to migrate
DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH) and
friends to a single include /usr/share/dpkg/architecture.mk,
keeping the include in the variable’s old position.
Fields
InsertIncludeBeforeVariable
Insert include <path> immediately before the first variable
definition whose name is before_variable. A no-op if the
variable doesn’t exist or path is already included.
Trait Implementations§
Source§impl Clone for MakefileAction
impl Clone for MakefileAction
Source§fn clone(&self) -> MakefileAction
fn clone(&self) -> MakefileAction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MakefileAction
impl Debug for MakefileAction
Source§impl<'de> Deserialize<'de> for MakefileAction
impl<'de> Deserialize<'de> for MakefileAction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for MakefileAction
Source§impl PartialEq for MakefileAction
impl PartialEq for MakefileAction
Source§fn eq(&self, other: &MakefileAction) -> bool
fn eq(&self, other: &MakefileAction) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for MakefileAction
impl Serialize for MakefileAction
impl StructuralPartialEq for MakefileAction
Auto Trait Implementations§
impl Freeze for MakefileAction
impl RefUnwindSafe for MakefileAction
impl Send for MakefileAction
impl Sync for MakefileAction
impl Unpin for MakefileAction
impl UnsafeUnpin for MakefileAction
impl UnwindSafe for MakefileAction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.