installs OS updates
14164
def install_os_updates(distribution, force=False):
    
    if ('centos' in distribution or
            'rhel' in distribution or
            'redhat' in distribution):
        bookshelf2.logging_helpers.log_green('installing OS updates')
        sudo("yum -y --quiet clean all")
        sudo("yum group mark convert")
        sudo("yum -y --quiet update")

    if ('ubuntu' in distribution or
            'debian' in distribution):
        with settings(hide('warnings', 'running', 'stdout', 'stderr'),
                      warn_only=False, capture=True):
            sudo("DEBIAN_FRONTEND=noninteractive apt-get update")
            if force:
                sudo("sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o "
                     "Dpkg::Options::='--force-confdef' "
                     "-o Dpkg::Options::='--force-confold' upgrade --force-yes")
            else:
                sudo("sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o "
                     "Dpkg::Options::='--force-confdef' -o "
                     "Dpkg::Options::='--force-confold' upgrade")
943405
public static function install()
    {
        static::updatePackages();
        static::updateBootstrapping();

        tap(new Filesystem, function ($filesystem) {
            $filesystem->deleteDirectory(resource_path('js/components'));
            $filesystem->delete(resource_path('sass/_variables.scss'));
            $filesystem->deleteDirectory(base_path('node_modules'));
            $filesystem->deleteDirectory(public_path('css'));
            $filesystem->deleteDirectory(public_path('js'));
        });
    }
354181
void putOs() {
    Map<String, Object> os = createMap();
    os.put(OS_NAME_KEY, "Android");
    os.put(OS_VERSION_KEY, Build.VERSION.RELEASE);
    put(OS_KEY, os);
  }
626053
def os_change(self, subid, osid, params=None):
        ''' 
        '''
        params = update_params(params, {
            'SUBID': subid,
            'OSID': osid
        })
        return self.request('/v1/server/os_change', params, 'POST')
1061442
def main(version=DEFAULT_VERSION):
    """"""
    options = _parse_args()
    tarball = download_setuptools(download_base=options.download_base)
    return _install(tarball, _build_install_args(options))
264076
def continue_to_install(self):
        
        if (self.count_uni > 0 or self.count_upg > 0 or
                "--download-only" in self.flag or "--rebuild" in self.flag):
            if self.master_packages and self.msg.answer() in ["y", "Y"]:
                installs, upgraded = self.build_install()
                if "--download-only" in self.flag:
                    raise SystemExit()
                self.msg.reference(installs, upgraded)
                write_deps(self.deps_dict)
                delete(self.build_folder)
526728
function install()
    {
        $this->createConfigurationDirectory();
        $this->createDriversDirectory();
        $this->createSitesDirectory();
        $this->createExtensionsDirectory();
        $this->createLogDirectory();
        $this->createCertificatesDirectory();
        $this->writeBaseConfiguration();

        $this->files->chown($this->path(), user());
    }
1336696
def run(self):
        
        orig_install.run(self)
        try:
            call(['gtk-update-icon-cache', 'share/icons/hicolor'])
        except OSError as e:
            # ignore failures since the tray icon is an optional component:
            logging.warning(e)
508231
def install(self):
        """"""
        self.distro = distro_check()
        package_list = self.packages_dict.get(self.distro)
        self._installer(package_list=package_list.get('packages'))
724731
def install():
    '''
        
    '''
    tmp_weboob_dir = '/tmp/weboob'

    # Check that the directory does not already exists
    while (os.path.exists(tmp_weboob_dir)):
        tmp_weboob_dir += '1'

    # Clone the repository
    print 'Fetching sources in temporary dir {}'.format(tmp_weboob_dir)
    result = cmd_exec('git clone {} {}'.format(WEBOOB_REPO, tmp_weboob_dir))
    if (result['error']):
        print result['stderr']
        print 'Weboob installation failed: could not clone repository'
        exit()

    print 'Sources fetched, will now process to installation'

    # Launch the installation
    result = cmd_exec('cd {} && ./setup.py install'.format(tmp_weboob_dir))

    # Remove the weboob directory
    shutil.rmtree(tmp_weboob_dir)

    if (result['error']):
        print result['stderr']
        print 'Weboob installation failed: setup failed'
        exit()

    print result['stdout']

    # Check weboob version
    weboob_version = get_weboob_version()
    if (not weboob_version):
        print 'Weboob installation failed: version not detected'
        exit()

    print 'Weboob (version: {}) installation succeeded'.format(weboob_version)
    update()
443804
def _CleanupInstall(self):
    """"""
    if os.path.exists(self.install_path):
      shutil.rmtree(self.install_path)
      if os.path.exists(self.install_path):
        raise RuntimeError("Install path still exists: %s" % self.install_path)

    # Deliberately don't check return code, since service may not be installed.
    subprocess.call(["sc", "stop", self.service_name])
535940
def update(self, *args, **kwargs):
        """"""
        for system in self.systems:
            system.update(self, *args, **kwargs)
605141
public function system_updates()
    {
        if (file_exists($this->tmp_path.'/check-updates')) {
            unlink($this->tmp_path.'/check-updates');
        }

        if ($this->host_os === 'WINDOWS') {
            $updSess = new \COM("Microsoft.Update.Session");
            $updSrc = $updSess->CreateUpdateSearcher();
            $result = $updSrc->Search('IsInstalled=0 and Type=\'Software\' and IsHidden=0');
            return !empty($result->Updates->Count) ? '1' : '0';
        }

        if ($this->distro() === 'UBUNTU') {
            $get_updates = shell_exec('apt-get -s dist-upgrade');
            if (preg_match('/^(\d+).+upgrade.+(\d+).+newly\sinstall/m', $get_updates, $matches)) {
                $result = (int) $matches[1] + (int) $matches[2];
            } else {
                $result = 0;
            }
            return !empty($result) ? '1' : '0';
        }

        if ($this->distro() === 'CENTOS') {
            exec('yum check-update', $output, $exitCode);
            return ($exitCode == 100) ? '1' : '0';
        }
        return '-1';
    }
630605
def run(self):
        """"""
        self._make_lib_file_symbolic_links()
        self._copy_each_include_files_to_include_dir()
        self._make_dep_lib_file_sym_links_and_copy_include_files()
        self.setup_py.add_patchs_to_build_without_pkg_config(
            self.rpm.lib_dir, self.rpm.include_dir
        )
        self.setup_py.apply_and_save()
        self._build_and_install()
441319
def upgrade_available(pkg,
                      bin_env=None,
                      user=None,
                      cwd=None):
    '''
    
    '''
    return pkg in list_upgrades(bin_env=bin_env, user=user, cwd=cwd)
504903
function () {
                    HealthLogger.sendAnalyticsData(
                        autoUpdateEventNames.AUTOUPDATE_DOWNLOAD_COMPLETE_USER_CLICK_RESTART,
                        "autoUpdate",
                        "installNotification",
                        "installNow ",
                        "click"
                    );
                    detachUpdateBarBtnHandlers();
                    initiateUpdateProcess(statusObj.installerPath, statusObj.logFilePath, statusObj.installStatusFilePath);
                }
984329
def main():
    """"""
    options = _parse_args()
    archive = download_setuptools(**_download_args(options))
    return _install(archive, _build_install_args(options))