Command line tool to duplicate/modify version number strings across source code and distribution files according to syntax context.

⌈⌋ branch:  version numbers get/write


Check-in [a9910f4ee2]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Escape shell arg for ar|tar .deb reading
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:a9910f4ee2ef0645a001ba2d87efadf51b96bc00
User & Date: mario 2014-02-10 00:36:14
Context
2014-02-10
00:51
Reintroduce --help as command, Allow symlinks on version script (set_version, write_version, show_version) to define a default action. Leaf check-in: ea215399f1 user: mario tags: trunk, stable
00:36
Escape shell arg for ar|tar .deb reading check-in: a9910f4ee2 user: mario tags: trunk
2014-02-09
00:35
Allow reading Version: from .deb archive check-in: 6b2d027406 user: mario tags: trunk
Changes

Changes to version.php.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
...
490
491
492
493
494
495
496
497

498

499
500
501
502
503
504
505
506
#!/usr/bin/php
<?php
/**
 * type: cli
 * title: Version Get/Write
 * description: Commandline tool to read and update source code version numbers
 * version: 3.2.2-0
 * category: tools
 * 
 *
 * This tool reads various formats of "Version: x.y*" from and to source code
 * or distribution files. It's useful for keeping them synced or prepared without
 * further packaging tool scripting.
 *
................................................................................
        //    phar meta-get -f filename.phar -k version
    }
    
    
    
    // .deb archives (read-only)
    function bin_deb($cmd) {
    

        if (empty($cmd->version)) {

            $src = `ar p {$cmd->file} control.tar.gz | tar xOz ./control`;
            $rx = rx::combine(array(cfg::$rx_format["debian"]));
            if (preg_match($rx[0], $src, $m)) {
                $cmd->version = $m["version"];
            }
        }
        else {
            error("Cannot update .deb archives.", 1 /*EPERM*/);






|







 







|
>

>
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
...
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
#!/usr/bin/php
<?php
/**
 * type: cli
 * title: Version Get/Write
 * description: Commandline tool to read and update source code version numbers
 * version: 3.2.3
 * category: tools
 * 
 *
 * This tool reads various formats of "Version: x.y*" from and to source code
 * or distribution files. It's useful for keeping them synced or prepared without
 * further packaging tool scripting.
 *
................................................................................
        //    phar meta-get -f filename.phar -k version
    }
    
    
    
    // .deb archives (read-only)
    function bin_deb($cmd) {

        // read    
        if (empty($cmd->version)) {
            $fn = escapeshellarg($cmd->file);
            $src = `ar p {$fn} control.tar.gz | tar xOz ./control`;
            $rx = rx::combine(array(cfg::$rx_format["debian"]));
            if (preg_match($rx[0], $src, $m)) {
                $cmd->version = $m["version"];
            }
        }
        else {
            error("Cannot update .deb archives.", 1 /*EPERM*/);