Пример #1
0
        foreach ($loc_files as $file) {
            $template = new I2CE_TemplateMeister();
            if (!$template->loadRootFile($file)) {
                echo "\tCould not load\n";
                continue;
            }
            if (!($res = $template->query('/I2CEConfiguration/metadata/version')) instanceof DOMNodeList || $res->length == 0) {
                echo "\tVersion not found\n";
                continue;
            }
            $versNode = $res->item(0);
            while ($versNode->hasChildNodes()) {
                $versNode->removeChild($versNode->firstChild);
            }
            $versNode->appendChild($template->createTextNode($new_version));
            file_put_contents($file, $template->getDisplay());
        }
    }
}
//end checking for changes since last release
$commit_changes = null;
$tag_release = null;
if ($do_versioning) {
    foreach ($top_mod_dirs as $mod => $dir) {
        $next_release = $last_release[$mod]['next_release'];
        $ret = 0;
        $out = array();
        $info = @exec("bzr status {$dir} 2> /dev/null", $out, $ret);
        if (count($out) > 0) {
            if (prompt("{$mod} has uncommitted changes. Commit them?\n[Assuming that {$mod} is bound to launchpad]", $commit_changes, implode("\n", $out))) {
                $cmd = "bzr commit {$dir} -m 'Automated version bumps for release {$next_release}'";
Пример #2
0
        I2CE::raiseError("No nodes found.  Bad query?");
        continue;
    }
    if ($nodes->length == 0) {
        I2CE::raiseError("No nodes found");
        continue;
    }
    $added = 0;
    foreach ($nodes as $node) {
        if ($node->hasAttribute('locale')) {
            continue;
        }
        $node->setAttribute('locale', I2CE_LOCALES::DEFAULT_LOCALE);
        $added++;
    }
    $out = $template->getDisplay();
    if (!$out) {
        I2CE::raiseError("Badnes");
        continue;
    }
    if (!file_put_contents($arg_file, $out)) {
        I2CE::raiseError("Could not overwrite {$arg_file}");
        continue;
    }
    I2CE::raiseError("Updated " . $added . " nodes in {$arg_file}");
}
function can_remove($node, $depth)
{
    global $cleaned;
    if (!$node instanceof DOMElement) {
        return true;
    $mod_file = false;
    $storage->setIfIsSet($mod_file, "/config/data/{$module}/file");
    if (!$mod_file) {
        I2CE::raiseError("No file recored for {$module}");
        continue;
    }
    $template = new I2CE_TemplateMeister();
    if (!$template->loadRootFile($mod_file)) {
        echo "\tCould not load\n";
        continue;
    }
    if (!($results = $template->query('/I2CEConfiguration/metadata/requirement/lessThan[@version="' . $base_vers . '"]')) instanceof DOMNodeList || $results->length == 0) {
        continue;
    }
    $changed = false;
    foreach ($results as $ltNode) {
        $res = $template->query('./atLeast', $ltNode->parentNode);
        if (!$res instanceof DOMNodeList || $res->length != 1) {
            echo "{$module} has no atLeast node\n";
            continue;
        }
        $changed = true;
        $ltNode->setAttribute('version', $next_vers);
        $res->item(0)->setAttribute('version', $base_vers);
    }
    if (!$changed) {
        continue;
    }
    echo "{$red}BUMPING REQUIREMENTS{$black} for {$module} \n";
    file_put_contents($mod_file, $template->getDisplay(true));
}