mirror of
https://github.com/clearlinux/common.git
synced 2026-05-13 18:44:07 +00:00
This tooling is designed to automate 2 main tasks that are part of the package maintenance workflow of Clear Linux LTS. These tasks are: - Back-porting of a patch (e.g. security fix) to older branches. - (Not implemented yet) Building RPMs with the intent of sharing binaries of older LTS branches to newer branches whenever possible. 2 new targets are defined in Makefile.common.lts: - lts-show: Show a summary of active LTS branches - lts-backport: Attempt to fast-forward the previous active branch to the current branch "Active" branches correspond to LTS releases that currently have support. They are listed in a flat file "active-branches" in "lts" directory, from oldest to newest. New entries are added by Clear Linux LTS developers as new releases become available, and entries removed as releases become obsolete. Note: For CVE patching, the tool is not aware of CVE severity levels or the minimum supported severity level of each LTS branch. For now it is the user's responsibility to know when a CVE does not apply to older branches and stop calling "make lts-backport". Signed-off-by: Tan, Yew Wayne <yew.wayne.tan@intel.com>
28 lines
767 B
Python
28 lines
767 B
Python
import subprocess, shlex
|
|
|
|
class Shell:
|
|
# Default options passed to subprocess.run. May be customized per-instance.
|
|
cwd = None
|
|
check = True
|
|
capture_output = True
|
|
text = True
|
|
|
|
def __init__(self, cwd=None):
|
|
if cwd: self.cwd = cwd
|
|
|
|
def run_args(self, args, **kwargs):
|
|
kwargs1 = {
|
|
'check': self.check,
|
|
'capture_output': self.capture_output,
|
|
'text': self.text,
|
|
'cwd': self.cwd
|
|
}
|
|
kwargs1.update(kwargs)
|
|
return subprocess.run(args, **kwargs1)
|
|
|
|
def run(self, cmd, **kwargs):
|
|
return self.run_args(shlex.split(cmd), **kwargs)
|
|
|
|
def popen(self, args, **kwargs):
|
|
return subprocess.Popen(args, cwd=self.cwd, **kwargs)
|