From 6904fc5f2c92952fe12f30ccce83a96f84ba8c7a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thibaut=20VAR=C3=88NE?= Date: Wed, 19 Oct 2022 19:57:18 +0200 Subject: [PATCH] phase1: remove checkBuiltin deadcode MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Thibaut VARÈNE --- phase1/master.cfg | 55 ----------------------------------------------- 1 file changed, 55 deletions(-) diff --git a/phase1/master.cfg b/phase1/master.cfg index 16817d4..8c708d2 100644 --- a/phase1/master.cfg +++ b/phase1/master.cfg @@ -574,59 +574,6 @@ c['builders'] = [] dlLock = locks.WorkerLock("worker_dl") -checkBuiltin = re.sub('[\t\n ]+', ' ', """ - checkBuiltin() { - local symbol op path file; - for file in $CHANGED_FILES; do - case "$file" in - package/*/*) : ;; - *) return 0 ;; - esac; - done; - while read symbol op path; do - case "$symbol" in package-*) - symbol="${symbol##*(}"; - symbol="${symbol%)}"; - for file in $CHANGED_FILES; do - case "$file" in "package/$path/"*) - grep -qsx "$symbol=y" .config && return 0 - ;; esac; - done; - esac; - done < tmp/.packagedeps; - return 1; - } -""").strip() - - -class IfBuiltinShellCommand(ShellCommand): - def _quote(self, str): - if re.search("[^a-zA-Z0-9/_.-]", str): - return "'%s'" %(re.sub("'", "'\"'\"'", str)) - return str - - def setCommand(self, command): - if not isinstance(command, (str, unicode)): - command = ' '.join(map(self._quote, command)) - self.command = [ - '/bin/sh', '-c', - '%s; if checkBuiltin; then %s; else exit 0; fi' %(checkBuiltin, command) - ] - - def setupEnvironment(self, cmd): - workerEnv = self.workerEnvironment - if workerEnv is None: - workerEnv = { } - changedFiles = { } - for request in self.build.requests: - for source in request.sources: - for change in source.changes: - for file in change.files: - changedFiles[file] = True - fullSlaveEnv = workerEnv.copy() - fullSlaveEnv['CHANGED_FILES'] = ' '.join(changedFiles.keys()) - cmd.args['env'] = fullSlaveEnv - workerNames = [ ] for worker in c['workers']: @@ -1015,7 +962,6 @@ for target in targets: haltOnFailure = True )) - # factory.addStep(IfBuiltinShellCommand( factory.addStep(ShellCommand( name = "pkginstall", description = "Installing packages", @@ -1032,7 +978,6 @@ for target in targets: haltOnFailure = True )) - #factory.addStep(IfBuiltinShellCommand( factory.addStep(ShellCommand( name = "images", description = "Building and installing images", -- 2.30.2