<commit_before><?php
/**
 *	make_package.php
 *
 *  package.xml generator for Ethna
 *
 *	@license	http://www.opensource.org/licenses/bsd-license.php The BSD License
 *	@package	Ethna
 *	@version	$Id$
 */
include_once('PEAR.php');
include_once('Console/Getopt.php');
include_once('PEAR/PackageFileManager2.php');
include_once('PEAR/PackageFileManager/File.php');   // avoid bugs

// args
$getopt =& new Console_Getopt();
$arg_list = $getopt->readPHPArgv();
$state = "stable";
$is_old_package = false;
$get_version = false;

$r = $getopt->getopt($arg_list, "abov", array("alpha", "beta", "old-package", "version"));
foreach ($r[0] as $opt) {
    if ($opt[0] == "a" || $opt[0] == "--alpha") {
        $state = "alpha";
    }
    if ($opt[0] == "b" || $opt[0] == "--beta") {
        $state = "beta";
    }
    if ($opt[0] == "o" || $opt[0] == "--old-package") {
        $is_old_package = true;
    }
    if ($opt[0] == "v" || $opt[0] == "--version") {
        $get_version = true;
    }
}

$description = 'Ethna Web Application Framework';
$package = 'Ethna';

// x.0.y -> beta
// x.1.y -> stable
$major_version = "2.0";
$minor_version = "1";

if ($state == 'alpha' || $state == 'beta') {
    $version = $major_version . strftime('.%Y%m%d%H');
} else {
    $version = $major_version . "." . $minor_version;
}

if ($get_version) {
    print $version;
    exit();
}

$config = array(
    'baseinstalldir' => 'Ethna',
    'packagedirectory' => dirname(dirname(__FILE__)),
    'filelistgenerator' => 'file',
    'ignore' => array('CVS/', 'package.xml', 'ethna_make_package.php', 'ethna_make_package.sh'),
    'changelogoldtonew' => false,
    'exceptions' => array('README' => 'doc', 'LICENSE' => 'doc', 'CHANGES' => 'doc'),
    'description' => $description,
    'installexceptions' => array('bin/ethna.sh' => '/', 'bin/ethna.bat' => '/'),
    'installas' => array('bin/ethna.sh' => 'ethna'),
);
 
$packagexml = new PEAR_PackageFileManager2();
$packagexml->setOptions($config);
$packagexml->setPackage($package);
$packagexml->setSummary('Ethna PHP Framework Package');
$packagexml->setDescription($description);
$packagexml->setChannel('pear.ethna.jp');
$packagexml->setAPIVersion($version);
$packagexml->setReleaseVersion($version);
$packagexml->setReleaseStability($state);
$packagexml->setAPIStability($state);
$packagexml->setNotes('2.0.1 would be brand-new package');
$packagexml->setPackageType('php');<commit_msg>author: fujimoto<commit_after><?php
/**
 *	make_package.php
 *
 *  package.xml generator for Ethna
 *
 *	@license	http://www.opensource.org/licenses/bsd-license.php The BSD License
 *	@package	Ethna
 *	@version	$Id$
 */
include_once('PEAR.php');
include_once('Console/Getopt.php');
include_once('PEAR/PackageFileManager2.php');
include_once('PEAR/PackageFileManager/File.php');   // avoid bugs

// args
$getopt =& new Console_Getopt();
$arg_list = $getopt->readPHPArgv();
$state = "stable";
$is_old_package = false;
$get_version = false;

$r = $getopt->getopt($arg_list, "abov", array("alpha", "beta", "old-package", "version"));
foreach ($r[0] as $opt) {
    if ($opt[0] == "a" || $opt[0] == "--alpha") {
        $state = "alpha";
    }
    if ($opt[0] == "b" || $opt[0] == "--beta") {
        $state = "beta";
    }
    if ($opt[0] == "o" || $opt[0] == "--old-package") {
        $is_old_package = true;
    }
    if ($opt[0] == "v" || $opt[0] == "--version") {
        $get_version = true;
    }
}

$description = 'Ethna Web Application Framework';
$package = 'Ethna';

// x.0.y -> beta
// x.1.y -> stable
$major_version = "2.0";
$minor_version = "1";

if ($state == 'alpha' || $state == 'beta') {
    $version = $major_version . strftime('.%Y%m%d%H');
} else {
    $version = $major_version . "." . $minor_version;
}

if ($get_version) {
    print $version;
    exit();
}

$config = array(
    'baseinstalldir' => 'Ethna',
    'packagedirectory' => dirname(dirname(__FILE__)),
    'filelistgenerator' => 'file',
    'ignore' => array('CVS/', 'package.xml', 'ethna_make_package.php', 'ethna_make_package.sh'),
    'changelogoldtonew' => false,
    'exceptions' => array('README' => 'doc', 'LICENSE' => 'doc', 'CHANGES' => 'doc'),
    'description' => $description,
    'installexceptions' => array('bin/ethna.sh' => '/', 'bin/ethna.bat' => '/'),
    'installas' => array('bin/ethna.sh' => 'ethna', 'bin/ethna.bat' => 'ethna.bat'),
);
 
$packagexml = new PEAR_PackageFileManager2();
$packagexml->setOptions($config);
$packagexml->setPackage($package);
$packagexml->setSummary('Ethna PHP Framework Package');
$packagexml->setDescription($description);
$packagexml->setChannel('pear.ethna.jp');
$packagexml->setAPIVersion($version);
$packagexml->setReleaseVersion($version);
$packagexml->setReleaseStability($state);
$packagexml->setAPIStability($state);
$packagexml->setNotes('2.0.1 would be brand-new package');
$packagexml->setPackageType('php');
{'fraction_non_alphanumeric': 0.22229076701624512, 'fraction_numerical': 0.007814106518609911, 'mean_word_length': 4.28695652173913, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 64, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 28}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3189231', 'n_tokens_mistral': 1793, 'n_tokens_neox': 1761, 'n_words': 312}