Updates the bundle
342668
def update(self):
        
        with self._lock:
            # Was it active ?
            restart = self._state == Bundle.ACTIVE

            # Send the update event
            self._fire_bundle_event(BundleEvent.UPDATE_BEGIN)

            try:
                # Stop the bundle
                self.stop()
            except:
                # Something wrong occurred, notify listeners
                self._fire_bundle_event(BundleEvent.UPDATE_FAILED)
                raise

            # Change the source file age
            module_stat = None
            module_file = getattr(self.__module, "__file__", None)
            if module_file is not None and os.path.isfile(module_file):
                try:
                    module_stat = os.stat(module_file)

                    # Change modification time to bypass weak time resolution
                    # of the underlying file system
                    os.utime(
                        module_file,
                        (module_stat.st_atime, module_stat.st_mtime + 1),
                    )
                except OSError:
                    # Can't touch the file
                    _logger.warning(
                        "Failed to update the modification time of '%s'. "
                        "The bundle update might not reflect the latest "
                        "changes.",
                        module_file,
                    )

            # Clean up the module constants (otherwise kept by reload)
            # Keep special members (__name__, __file__, ...)
            old_content = self.__module.__dict__.copy()
            for name in list(self.__module.__dict__):
                if not (name.startswith("__") and name.endswith("__")):
                    del self.__module.__dict__[name]

            try:
                # Reload the module
                reload_module(self.__module)
            except (ImportError, SyntaxError) as ex:
                # Exception raised if the file is unreadable
                _logger.exception("Error updating %s: %s", self.__name, ex)

                # Reset module content
                self.__module.__dict__.clear()
                self.__module.__dict__.update(old_content)

            if module_stat is not None:
                try:
                    # Reset times
                    os.utime(
                        module_file,
                        (module_stat.st_atime, module_stat.st_mtime),
                    )
                except OSError:
                    # Shouldn't occur, since we succeeded before the update
                    _logger.debug(
                        "Failed to reset the modification time of '%s'",
                        module_file,
                    )

            if restart:
                try:
                    # Re-start the bundle
                    self.start()
                except:
                    # Something wrong occurred, notify listeners
                    self._fire_bundle_event(BundleEvent.UPDATE_FAILED)
                    raise

            # Bundle update finished
            self._fire_bundle_event(BundleEvent.UPDATED)
518624
def update(self, *pkgs, **kwargs):
        """"""
        cmd_list = ['update', '--json', '--yes']

        if not pkgs and not kwargs.get('all'):
            raise TypeError("Must specify at least one package to update, or "
                            "all=True.")

        cmd_list.extend(
            self._setup_install_commands_from_kwargs(
                kwargs,
                ('dry_run', 'no_deps', 'override_channels',
                 'no_pin', 'force', 'all', 'use_index_cache', 'use_local',
                 'alt_hint')))

        cmd_list.extend(pkgs)

        return self._call_and_parse(cmd_list, abspath=kwargs.get('abspath',
                                                                 True))
375224
def bundle(context, yes, bundle_name):
    """"""
    bundle_obj = context.obj['store'].bundle(bundle_name)
    if bundle_obj is None:
        click.echo(click.style('bundle not found', fg='red'))
        context.abort()
    version_obj = bundle_obj.versions[0]
    if version_obj.included_at:
        question = f"remove bundle version from file system and database: {version_obj.full_path}"
    else:
        question = f"remove bundle version from database: {version_obj.created_at.date()}"
    if yes or click.confirm(question):
        if version_obj.included_at:
            shutil.rmtree(version_obj.full_path, ignore_errors=True)
        version_obj.delete()
        context.obj['store'].commit()
        click.echo(f"version deleted: {version_obj.full_path}")
1305911
public function updateAll(UpdateSettingRequest $request, System $bundle)
    {
        if ($request->isReset() === false) {
            $bundle = $this->repository->getBundle($bundle);
            $data = $request->json();
            foreach ($data as $name => $value) {
                if ($bundle->hasName($name) && $value != $bundle[$name]) {
                    $bundle[$name] = $value;
                }
            }
        }
        $bundle->persist();

        return $this->sendResponse($bundle, 'Setting updated successfully.');
    }
607666
def update_all(self):
        
        self.update_path_labels()
        self.update_core_config_list_store()
        self.update_gui_config_list_store()
        self.update_libraries_list_store()
        self.update_shortcut_settings()
        self.check_for_preliminary_config()
1045868
function update(args, done) {
    app = this.fractal;

    let typo3cli = path.join(typo3path, '../vendor/bin/typo3');
    let typo3args = ['extbase', 'component:discover'];
    try {
        if (fs.statSync(typo3cli).isFile()) {
            typo3args.shift();
        }
    } catch (e) {
        typo3cli = path.join(typo3path, 'typo3/cli_dispatch.phpsh');
    }

    try {
        if (fs.statSync(typo3cli).isFile()) {
            typo3args.unshift(typo3cli);
            const componentsJSON = execFileSync('php', typo3args).toString();
            const components = JSON.parse(componentsJSON);
            for (const component of components) {
                processComponent(component);
            }

            // Write the general shared context
            const context = { context: { typo3: typo3url } };
            writeFile(path.resolve(app.components.get('path'), 'components.config.json'), JSON.stringify(context, null, 4));

            // See if there's a component file manifest
            const manifest = path.resolve(app.components.get('path'), 'components.files.json');
            try {
                if (fs.statSync(manifest).isFile()) {
                    const currentFiles = new Set(files);
                    const prevFiles = new Set(JSON.parse(fs.readFileSync(manifest)));

                    // Delete all redundant files
                    [...prevFiles].filter(f => !currentFiles.has(f)).forEach(f => fs.unlinkSync(path.resolve(app.components.get('path'), f)));
                }
            } catch (e) {
                // Ignore errors
            } finally {
                writeFile(manifest, JSON.stringify(files));
                deleteEmpty.sync(app.components.get('path'));
            }
        }
        done();
    } catch (e) {
        console.log(e);
        process.exit(1);
    }
}
400253
def include(context, bundle_name, version):
    
    store = Store(context.obj['database'], context.obj['root'])
    if version:
        version_obj = store.Version.get(version)
        if version_obj is None:
            click.echo(click.style('version not found', fg='red'))
    else:
        bundle_obj = store.bundle(bundle_name)
        if bundle_obj is None:
            click.echo(click.style('bundle not found', fg='red'))
        version_obj = bundle_obj.versions[0]

    try:
        include_version(context.obj['root'], version_obj)
    except VersionIncludedError as error:
        click.echo(click.style(error.message, fg='red'))
        context.abort()

    version_obj.included_at = dt.datetime.now()
    store.commit()
    click.echo(click.style('included all files!', fg='green'))
280716
def new_bundle(self, name: str, created_at: dt.datetime=None) -> models.Bundle:
        """"""
        new_bundle = self.Bundle(name=name, created_at=created_at)
        return new_bundle
249081
def update_resource_entry(self, bundleId, languageId, resourceKey, data=None):
        """"""
        headers={'content-type':'application/json'}
        url = self.__get_base_bundle_url() + "/" + bundleId + "/" + languageId + "/" + resourceKey
        json_data = {}
        if not data is None:
            json_data = json.dumps(data)
        response = self.__perform_rest_call(requestURL=url, restType='POST', body=json_data, headers=headers)
        return response
73446
function updatePackageJSONVersion() {
  let packageJSONPath = path.join(__dirname, '..', 'package.json');

  let pkgContents = fs.readFileSync(packageJSONPath, { encoding: 'utf-8' });
  let pkg = JSON.parse(pkgContents);
  if (!pkg._originalVersion) {
    pkg._originalVersion = pkg.version;
  }
  pkg._versionPreviouslyCalculated = true;
  pkg.version = buildInfo.version;
  fs.writeFileSync(packageJSONPath, JSON.stringify(pkg, null, 2), {
    encoding: 'utf-8',
  });
}
998093
def add_bundle(self, data: dict) -> models.Bundle:
        
        bundle_obj = self.bundle(data['name'])
        if bundle_obj and self.version(bundle_obj.name, data['created']):
            LOG.debug('version of bundle already added')
            return None

        if bundle_obj is None:
            bundle_obj = self.new_bundle(name=data['name'], created_at=data['created'])

        version_obj = self.new_version(created_at=data['created'], expires_at=data.get('expires'))

        tag_names = set(tag_name for file_data in data['files'] for tag_name in file_data['tags'])
        tag_map = self._build_tags(tag_names)

        for file_data in data['files']:
            LOG.debug(f"adding file: {file_data['path']}")
            if not Path(file_data['path']).exists():
                raise FileNotFoundError(file_data['path'])
            tags = [tag_map[tag_name] for tag_name in file_data['tags']]
            new_file = self.new_file(file_data['path'], to_archive=file_data['archive'], tags=tags)
            version_obj.files.append(new_file)

        version_obj.bundle = bundle_obj
        return bundle_obj, version_obj
464784
public function update()
	{
		$mode = $this->output->getMode();

		if ($this->arguments->getOpt('f'))
		{
			if ($mode != 'minimal')
			{
				$this->output->addLine(
					'Updating the repository...',
					array(
						'color' => 'blue'
					),
					false
				);
			}

			// Check status and stash as needed
			if (!$this->mechanism->isClean())
			{
				$this->mechanism->stash();
			}

			// Create rollback point first
			$this->mechanism->createRollbackPoint();

			// Check whether or not we're allowing fast forward pulls only
			$allowNonFf = $this->arguments->getOpt('allow-non-ff');

			// Now do the update
			$response = $this->mechanism->update(false, $allowNonFf);
			if ($response['status'] == 'success')
			{
				// Now, check to see whether or not we need to go ahead and push this merge elsewhere
				if ($ref = $this->arguments->getOpt('git-auto-push-ref', false))
				{
					$response = $this->mechanism->push($ref);
					if ($response['status'] === 'success')
					{
						if ($mode != 'minimal')
						{
							$this->output->addLine(
								'complete',
								array(
									'color' => 'green'
								)
							);
						}
					}
					else
					{
						$this->output->addLine(
							strtolower($response['message']),
							array(
								'color' => 'red'
							)
						);
					}
				}
				else
				{
					if ($mode != 'minimal')
					{
						$this->output->addLine(
							'complete',
							array(
								'color' => 'green'
							)
						);
					}
				}

				// Also check to see if we need to update packages
				if ($this->arguments->getOpt('install-packages', false))
				{
					App::get('client')->call('repository:package', 'install', new Arguments([]), $this->output);
				}
			}
			else if ($response['status'] == 'fatal')
			{
				$this->output->addLine(
					strtolower($response['message']),
					array(
						'color' => 'red'
					)
				);
			}
			else
			{
				$this->output->addSpacer();
				$this->output->addRaw($response['raw']);
			}
		}
		else
		{
			$response = $this->mechanism->update();

			if (!empty($response))
			{
				if ($mode != 'minimal')
				{
					$this->output->addLine('The repository is behind by ' . count($response) . ' update(s):');
				}
				$logs = array();
				foreach ($response as $log)
				{
					if ($mode == 'minimal')
					{
						$this->output->addLine($log);
					}
					else
					{
						$logs[] = array(
							'message' => $log,
							'type' => array(
								'indentation' => 2,
								'color'       => 'blue'
							)
						);
					}
				}

				if ($mode != 'minimal')
				{
					$this->output->addLinesFromArray($logs);
				}
			}
			else
			{
				if ($mode != 'minimal')
				{
					$this->output->addLine('The repository is already up-to-date');
				}
			}
		}
	}
692466
function continuousBundle() {
    const bundle = b => b.bundle()
        .on('error', (err) => {
            notifier.notify({
                title: 'Browserify Error',
                message: err.message,
            });
            gutil.log('Browserify Error', err);
        })
        .pipe(source('crudl.js'))
        .pipe(gulp.dest(dist))
        .on('end', () => {
            notifier.notify({
                title: 'Browserify',
                message: 'OK',
            });
        })
    const opts = assign({}, watchify.args, browersifyOptions, { debug: true });
    const bundler = watchify(browserify(opts).transform(babelify.configure(babelifyOptions)));
    bundler.on('update', () => bundle(bundler)); // on any dep update, runs the bundler
    bundler.on('log', gutil.log); // output build logs to terminal

    return bundle(bundler)
}
512040
public function update()
	{
		// Get group config
		$groupsConfig = \Component::params('com_groups');

		// Path to group folder
		$directory  = PATH_APP . DS . trim($groupsConfig->get('uploadpath', '/site/groups'), DS);
		$directory .= DS . $this->group->get('gidNumber');

		// Get task, defaults to update
		$task = ($this->arguments->getOpt(3)) ? $this->arguments->getOpt(3) : 'update';

		// Set our group directory & call update
		$this->arguments->setOpt('r', $directory);
		\App::get('client')->call('repository', $task, $this->arguments, $this->output);
	}
571263
def upgrade():
    '''
    
    '''
    DETAILS = _load_state()
    pkgs = uptodate()
    DETAILS['packages'] = pkgs
    _save_state(DETAILS)
    return pkgs
103427
def update(self):
        
        logger.debug("")

        rd = self.repo_dir

        logger.debug("pkg path %s", rd)
        if not rd:
            print(
                "unable to find pkg '%s'. %s" % (self.name, did_u_mean(self.name))
            )

        cwd = os.getcwd()
        os.chdir(self.repo_dir)
        logger.debug("cwd: %s, updating %s ", cwd, self.repo_dir)
        try:
            p = git.pull('--rebase', '--progress',
                         _out=self._sh_stdout('blue'),
                         _err=self._sh_stderr('red'))
            p.wait()
        except Exception as e:
            pass
            # logger.warn(e)

        os.chdir(cwd)

        # Update or install any dependancies before running the
        # update script.
        self.install_update_deps()

        up = os.path.join(self.repo_dir, '_upkg', 'update')
        if os.path.exists(up):
            # We use subprocess instead of the sh module due to problems with
            # runing shell scripts with sh
            cwd = os.getcwd()
            os.chdir(os.path.join(self.repo_dir, '_upkg'))
            self.pr_info("Running update script for {} @ {}", self.name, up)
            subprocess.check_call(up, shell=True)
            os.chdir(cwd)
142582
function bundle() {
  return new Promise((resolve, reject) => {
    webpack(webpackConfig).run((err, stats) => {
      if (err) {
        return reject(err);
      }

      console.log(stats.toString(webpackConfig[0].stats));
      return resolve();
    });
  });
}