App-Sqitch

 view release on metacpan or  search on metacpan

Build.PL  view on Meta::CPAN

    "Type::Library" => "0.040",
    "Type::Utils" => 0,
    "Types::Standard" => 0,
    "URI" => 0,
    "URI::QueryParam" => 0,
    "URI::db" => "0.20",
    "User::pwent" => 0,
    "XML::Tiny" => "2.07",
    "YAML::Tiny" => "1.76",
    "constant" => 0,
    "locale" => 0,
    "namespace::autoclean" => "0.16",
    "overload" => 0,
    "parent" => 0,
    "perl" => "5.010",
    "strict" => 0,
    "utf8" => 0,
    "warnings" => 0
  },
  "script_files" => [
    "bin/sqitch"

Changes  view on Meta::CPAN

       changes to be deployed or reverted with `-VV`. Thanks to Erik Wienhold
       for the PR (#787)!
     - Fixed invalid template resolution when adding a singe change to
       multiple engines at once. Thanks to Christian Riedel for the detailed
       bug report (#795)!
     - Fixed Oracle and Firebird test failures due to incorrect use of `chmod`.
       Thanks to Slaven Rezić for the report and the fix (#807)!
     - Tests now require Test::Warn 0.31 or later, as newline handling issues
       cause test failures in earlier versions. Thanks to Slaven Rezić for the
       test reports and for identifying the issue.
     - Updated the locale configuration to fix issues in more recent versions
       of Perl, and added tests to ensure that the sqitch CLI executes and
       properly emits localized messages (except on Windows, where the language
       codes are incompatible).
     - Fixed an issue where the MySQL engine failed to recognize the MariaDB
       `mysql` client installed by Homebrew on macOS. Thanks to Carlos Ramos
       for the bug report and PR (#791)!

1.4.0 2023-08-01T23:37:30Z
     - Fixed Snowflake warehouse and role setup to properly quote identifiers
       unless they're valid unquoted identifiers or already quoted. Thanks to

Changes  view on Meta::CPAN

     - Fixed an "uninitialized value" error when creating a registry database
       on Windows. Thanks to Steven C. Buttgereit for the report (Issue #289).
     - Fixed editor selection to prioritize the `core.editor` configuration
       variable over the `$EDITOR` environment variable. The `$SQITCH_EDITOR`
       environment variable still trumps all. Thanks to Jim Nasby for the pull
       request (#296).
     - Added detection of the `$VISUAL` environment variable to Editor
       selection, prioritized after the `core.editor` configuration variable
       and before the `$EDITOR` environment variable. Thanks to Jim Nasby for
       the pull request (#296).
     - Updated the DateTime code to set the locale via `set_locale()` instead
       of `set()`, as the latter may actually change the local time
       unintentionally, and has been deprecated since DateTime v1.04. Thanks
       to Dave Rolsky for the pull request (#304).

0.9994 2016-01-08T19:46:43Z
     - Reduced minimum required MySQL engine from 5.1.0 to 5.0.0. Thanks to
       @dgc-wh for testing it (Issue #251).
     - Fixed floating-point rounding issue with SQLite registry versions on
       Perls with 16-byte doubles. Thanks to H. Merijn Brand for the report
       and testing.

Changes  view on Meta::CPAN

       `$SQITCH_CONFIG` environment variable (issue #114).
     - The installer now respects the `distdir` option to `Build.PL` when
       searching for existing templates. Important for packaging.
     - Fixed the error "Table 'sqitch.changes' doesn't exist" when deploying
       to a MySQL database that exists but has not been initialized. Thanks to
       Jean-Michel REY for the report!
     - Refactored the handling of the C<--log-only> option so it sets an
       engine attribute, rather than passing the flag to a whole stack of
       method calls.
     - Fixed "Argument "en_us" isn't numeric" error on Windows.
     - Now using `LC_ALL` instead of `LC_MESSAGES` when setting the locale, as
       the latter is not present on Windows.
     - The sqitch-pg RPM now requires DBD::Pg 2.0.0 or higher.
     - Improved handling of invalid command names so that the error message is
       less ambiguous when triggered by a Perl parse error.
     - Added `-m` as an alias for `--note`, for you Git folks out there.
     - Added exception handling to the Postgres and Oracle engines to avoid
       unexpected errors when deploying to a database that has not been
       deployed to before.
     - Updated detection of an uninitialized database to double-check with the
       engine that it really thinks it's uninitialized, not just that the

Changes  view on Meta::CPAN

     - Now Require DBD::SQLite compiled with SQLite 3.7.11 or higher. It
       always has, but now it throws a meaningful exception if an older
       version is compiled into DBD::SQLite. Thanks to Damon Buckwalter for
       the report.
     - When a deploy fails because of missing dependencies, the list of
       missing dependencies no longer contains duplicates. Thanks to Damon
       Buckwalter for the report.

0.972  2013-05-31T23:26:52Z
     - Fixed test failures on Windows.
     - Fixed locale configuration on Windows so that `sqitch` will actually
       run, rather than exiting with an error about `LC_MESSAGES` not being
       set.
     - Fixed a test hang on Windows when DBD::Oracle is installed but the
       Oracle libraries (`OCI.dll`) are not or cannot be found. This was
       triggering a UI dialog that did not dismiss itself. Using Win32::API
       to work around this issue. Thanks to Jan Dubois for the fix.

0.971  2013-05-18T21:08:51Z
     - Removed most uses of the smartmatch operator, since as of Perl 5.17.11
       it is marked as experimental, and silenced the warning where it is

Changes  view on Meta::CPAN

     - Replaced all uses of `$/` in output to `"\n"`. Thanks to Jan Dubois for
       pointing out the incorrect use of `$/`.
     - Fixed build error that prevented installation on Perl 5.10 when the
       parent module was not installed.

0.964  2013-04-15T18:47:30Z
     - Fixed test failures on Perl versions lower than 5.14 when DBD::SQLite
       or DBD::Pg is not installed.
     - Removed DBD::SQLite from the list of build dependencies.
     - Fixed test failures due to encoded (wide-character) warnings on
       triggered on systems with non-english locales. Thanks to Alexandr
       Ciornii for the smoke testing that revealed this issue.
     - Removed overriding of Throwable's `previous_exception` in
       App::Sqitch::X on Throwable 0.200007 and higher, where it is no longer
       needed.
     - Changed test comparing file contents that fails on Windows to do a
       looser comparison and hopefully fix the test failure.

0.963  2013-04-12T19:11:29Z
     - Fixed a test failure when Git is in the execution path and the test is
       not run from a Git checkout.

Changes  view on Meta::CPAN


0.935 2012-10-02T19:21:05Z
     - Updated `dist/sqitch-pg.spec` to require `postgresql` rather than
       "postgresql91". The version doesn't matter so much.
     - All known Windows issues and failures fixed, with many thanks to Randy
       Stauner for repeatedly running tests and supplying patches:
       - Fixed "'2' is not recognized as an internal or external command,
         operable program or batch file" error on Windows.
       - Fixed multiple errors detecting Windows. The OS name is "MSWin32",
         not "Win32". The test failure thus addressed was the setting of the
         DateTime locale.
       - Fixed failing tests that were incorrectly comparing subprocess errors
         messages on Windows
       - Fixed bug in `bundle` where a file would be re-copied even if the
         source and destination had the same timestamps, as they seem to do
         during tests on Windows. Patch from Randy Stauner.
       - Fixed failing test that failed to include `.exe` in a file name on
         Windows. Patch from Randy Stauner.
     - Added French translation, with thanks to Arnaud (Arhuman) ASSAD!

0.934 2012-09-28T16:43:43Z

Changes  view on Meta::CPAN


0.913  2012-08-28T17:31:29Z
     - Fixed oversight in test that still relied on `$ENV{USER}` instead of
       `Sqitch->sysuser`,

0.912 2012-08-27T21:23:19Z
     - Fall back on `Sqitch->sysuser` when looking for the PostgreSQL user,
       rather than just `$ENV{USER}`. The method does a lot more work to find
       the system user name. This will hopefully also fix test failures on
       systems where `$ENV{USER}` is not set.
     - Use Win32::Locale to set the locale on DateTime objects on Windows.

0.911 2012-08-23T19:19:17Z
     - Fixed more platform-specific test failures in `t/base.t`.
     - Increased liklihood of finding a user's full name on Windows. Thanks to
       H. Merijn Brand for testing.

0.91  2012-08-23T00:37:36Z
     - Moved `requires` and `conflicts` array columns from the `changes` table
       to an new table, `dependencies`, where there is just one per row.
     - Requirements are now checked before reverting a change. If the change

META.json  view on Meta::CPAN

            "Type::Library" : "0.040",
            "Type::Utils" : "0",
            "Types::Standard" : "0",
            "URI" : "0",
            "URI::QueryParam" : "0",
            "URI::db" : "0.20",
            "User::pwent" : "0",
            "XML::Tiny" : "2.07",
            "YAML::Tiny" : "1.76",
            "constant" : "0",
            "locale" : "0",
            "namespace::autoclean" : "0.16",
            "overload" : "0",
            "parent" : "0",
            "perl" : "5.010",
            "strict" : "0",
            "utf8" : "0",
            "warnings" : "0"
         },
         "suggests" : {
            "DBD::Firebird" : "1.11",

META.yml  view on Meta::CPAN

  Type::Library: '0.040'
  Type::Utils: '0'
  Types::Standard: '0'
  URI: '0'
  URI::QueryParam: '0'
  URI::db: '0.20'
  User::pwent: '0'
  XML::Tiny: '2.07'
  YAML::Tiny: '1.76'
  constant: '0'
  locale: '0'
  namespace::autoclean: '0.16'
  overload: '0'
  parent: '0'
  perl: '5.010'
  strict: '0'
  utf8: '0'
  warnings: '0'
resources:
  bugtracker: https://github.com/sqitchers/sqitch/issues/
  homepage: https://sqitch.org/

bin/sqitch  view on Meta::CPAN

#!perl -w -CAS

our $VERSION = 'v1.6.1'; # VERSION
use locale;
use App::Sqitch;
exit App::Sqitch->go;

dist/cpanfile  view on Meta::CPAN

requires "Type::Library" => "0.040";
requires "Type::Utils" => "0";
requires "Types::Standard" => "0";
requires "URI" => "0";
requires "URI::QueryParam" => "0";
requires "URI::db" => "0.20";
requires "User::pwent" => "0";
requires "XML::Tiny" => "2.07";
requires "YAML::Tiny" => "1.76";
requires "constant" => "0";
requires "locale" => "0";
requires "namespace::autoclean" => "0.16";
requires "overload" => "0";
requires "parent" => "0";
requires "perl" => "5.010";
requires "strict" => "0";
requires "utf8" => "0";
requires "warnings" => "0";
recommends "Class::XSAccessor" => "1.18";
recommends "Pod::Simple" => "1.41";
recommends "Template" => "0";

lib/App/Sqitch.pm  view on Meta::CPAN

);

has sysuser => (
    is       => 'ro',
    isa      => Maybe[Str],
    lazy     => 1,
    default  => sub {
        $ENV{ SQITCH_ORIG_SYSUSER } || do {
            # Adapted from User.pm.
            require Encode::Locale;
            return Encode::decode( locale => getlogin )
                || Encode::decode( locale => scalar getpwuid( $< ) )
                || $ENV{ LOGNAME }
                || $ENV{ USER }
                || $ENV{ USERNAME }
                || try {
                    require Win32;
                    Encode::decode( locale => Win32::LoginName() )
                };
        };
    },
);

has user_name => (
    is      => 'ro',
    lazy    => 1,
    isa     => UserName,
    default => sub {

lib/App/Sqitch.pm  view on Meta::CPAN

        || do {
            my $sysname = $self->sysuser || hurl user => __(
                'Cannot find your name; run sqitch config --user user.name "YOUR NAME"'
            );
            if (ISWIN) {
                try { require Win32API::Net } || return $sysname;
                # https://stackoverflow.com/q/12081246/79202
                Win32API::Net::UserGetInfo( $ENV{LOGONSERVER}, $sysname, 10, my $info = {} );
                return $sysname unless $info->{fullName};
                require Encode::Locale;
                return Encode::decode( locale => $info->{fullName} );
            }
            require User::pwent;
            my $name = User::pwent::getpwnam($sysname) || return $sysname;
            $name = ($name->gecos)[0] || return $sysname;
            require Encode::Locale;
            return Encode::decode( locale => $name );
        };
    }
);

has user_email => (
    is      => 'ro',
    lazy    => 1,
    isa     => UserEmail,
    default => sub {
        my $self = shift;

lib/App/Sqitch/DateTime.pm  view on Meta::CPAN

    if ($format eq 'raw') {
        $dt->set_time_zone('UTC');
        return $dt->iso8601 . 'Z';
    }

    $dt->set_time_zone('local');

    if ( first { $format eq $_ } qw(iso iso8601) ) {
        return join ' ', $dt->ymd('-'), $dt->hms(':'), $dt->strftime('%z');
    } elsif ( first { $format eq $_ } qw(rfc rfc2822) ) {
        $dt->set_locale('en_US');
        ( my $rv = $dt->strftime('%a, %d %b %Y %H:%M:%S %z') ) =~
            s/\+0000$/-0000/;
        return $rv;
    } else {
        if (ISWIN) {
            require Win32::Locale;
            $dt->set_locale( Win32::Locale::get_locale() );
        } else {
            require POSIX;
            $dt->set_locale( POSIX::setlocale( POSIX::LC_TIME() ) );
        }
        return $dt->format_cldr($format) if $format =~ s/^cldr://;
        return $dt->strftime($format) if $format =~ s/^strftime://;
        my $meth = $dt->locale->can("datetime_format_$format") or hurl(
            datetime => __x(
                'Unknown date format "{format}"',
                format => $format
            )
        );
        return $dt->format_cldr( $dt->locale->$meth );
    }
}

1;

__END__

=head1 Name

App::Sqitch::DateTime - Sqitch DateTime object

lib/App/Sqitch/ItemFormatter.pm  view on Meta::CPAN

RFC-2822 format.

=item C<full>

=item C<long>

=item C<medium>

=item C<short>

A format length to pass to the system locale's C<LC_TIME> category.

=item C<raw>

Raw format, which is strict ISO-8601 in the UTC time zone.

=item C<strftime:$string>

An arbitrary C<strftime> pattern. See L<DateTime/strftime Paterns> for
comprehensive documentation of supported patterns.

lib/sqitch-log.pod  view on Meta::CPAN

Show timestamps in RFC-2822 format.

=item C<full>

=item C<long>

=item C<medium>

=item C<short>

Show timestamps in the specified format length, using the system locale's
C<LC_TIME> category.

=item C<raw>

Show timestamps in raw format, which is strict ISO-8601 in the UTC time zone.

=item C<strftime:$string>

Show timestamps using an arbitrary C<strftime> pattern. See
L<DateTime/strftime Paterns> for comprehensive documentation of supported

lib/sqitch-plan.pod  view on Meta::CPAN

Show timestamps in RFC-2822 format.

=item C<full>

=item C<long>

=item C<medium>

=item C<short>

Show timestamps in the specified format length, using the system locale's
C<LC_TIME> category.

=item C<raw>

Show timestamps in raw format, which is strict ISO-8601 in the UTC time zone.

=item C<strftime:$string>

Show timestamps using an arbitrary C<strftime> pattern. See
L<DateTime/strftime Paterns> for comprehensive documentation of supported

lib/sqitch-status.pod  view on Meta::CPAN

Show timestamps in RFC-2822 format.

=item C<full>

=item C<long>

=item C<medium>

=item C<short>

Show timestamps in the specified format length, using the system locale's
C<LC_TIME> category.

=item C<raw>

Show timestamps in raw format, which is strict ISO-8601 in the UTC time zone.

=item C<strftime:$string>

Show timestamps using an arbitrary C<strftime> pattern. See
L<DateTime/strftime Paterns> for comprehensive documentation of supported

t/datetime.t  view on Meta::CPAN

    rfc2822
    full
    long
    medium
    short
)], 'as_string_formats should be correct';

my $rfc = do {
    my $clone = $dt->clone;
    $clone->set_time_zone('local');
    $clone->set_locale('en_US');
    ( my $rv = $clone->strftime('%a, %d %b %Y %H:%M:%S %z') ) =~ s/\+0000$/-0000/;
    $rv;
};

my $iso = do {
    my $clone = $dt->clone;
    $clone->set_time_zone('local');
    join ' ', $clone->ymd('-'), $clone->hms(':'), $clone->strftime('%z')
};

my $ldt = do {
    my $clone = $dt->clone;
    $clone->set_time_zone('local');
    $clone->set_locale($LC::TIME);
    $clone;
};

my $raw = do {
    my $clone = $dt->clone;
    $clone->set_time_zone('UTC');
    $clone->iso8601 . 'Z';
};

for my $spec (
    [ full    => $ldt->format_cldr( $ldt->locale->datetime_format_full )],
    [ long    => $ldt->format_cldr( $ldt->locale->datetime_format_long )],
    [ medium  => $ldt->format_cldr( $ldt->locale->datetime_format_medium )],
    [ short   => $ldt->format_cldr( $ldt->locale->datetime_format_short )],
    [ raw     => $raw ],
    [ ''      => $raw ],
    [ iso     => $iso ],
    [ iso8601 => $iso ],
    [ rfc     => $rfc ],
    [ rfc2822 => $rfc ],
    [ q{cldr:HH'h' mm'm'} => $ldt->format_cldr( q{HH'h' mm'm'} ) ],
    [ 'strftime:%a at %H:%M:%S' => $ldt->strftime('%a at %H:%M:%S') ],
) {
    my $clone = $dt->clone;

t/item_formatter.t  view on Meta::CPAN

    committer_email => 'larry@example.com',
    committed_at    => $cdt,
    planner_name    => 'damian',
    planner_email   => 'damian@example.com',
    planned_at      => $pdt,
    note            => "For the LOLZ.\n\nYou know, funny stuff and cute kittens, right?",
    requires        => [qw(foo bar)],
    conflicts       => []
};

$_->set_locale($LC::TIME) for ($local_cdt, $local_pdt);

for my $spec (
    ['%e', { event => 'deploy' }, 'deploy' ],
    ['%e', { event => 'revert' }, 'revert' ],
    ['%e', { event => 'fail' },   'fail' ],

    ['%L', { event => 'deploy' }, __ 'Deploy' ],
    ['%L', { event => 'revert' }, __ 'Revert' ],
    ['%L', { event => 'fail' },   __ 'Fail' ],

t/lib/LC.pm  view on Meta::CPAN

package LC;

our $TIME = do {
    if ($^O eq 'MSWin32') {
        require Win32::Locale;
        Win32::Locale::get_locale();
    } else {
        require POSIX;
        POSIX::setlocale( POSIX::LC_TIME() );
    }
};

# https://github.com/sqitchers/sqitch/issues/230#issuecomment-103946451
# https://rt.cpan.org/Ticket/Display.html?id=104574
$TIME = 'en_US_POSIX' if $TIME eq 'C.UTF-8';

1;

t/lib/TestConfig.pm  view on Meta::CPAN

use base 'App::Sqitch::Config';
use Path::Class;

BEGIN {
    # Suppress warnings from Locale::Messages.
    # https://github.com/gflohr/libintl-perl/issues/14
    use Locale::Messages;
    if ($Locale::Messages::package eq 'gettext_pp' && Locale::Messages->VERSION < 1.35) {
        no warnings qw(redefine prototype);
        no strict 'refs';
        my $orig = \&Locale::gettext_pp::__locale_category;
        *{"Locale::gettext_pp::__locale_category"} = sub {
            local $SIG{__WARN__} = sub {};
            $orig->();
        }
    }
}

# Creates and returns a new TestConfig, which inherits from
# App::Sqitch::Config. Sets nonexistent values for the file locations and
# calls update() on remaining args.
#

t/log.t  view on Meta::CPAN

        $exp =~ s/__PDATE__/$piso/;
        is $log->formatter->format( $log->format, $event ), $exp,
            qq{Format "$spec->[0]" should output correctly without tags};
    }
}

###############################################################################
# Test all formatting characters.
my $local_cdt = $cdt->clone;
$local_cdt->set_time_zone('local');
$local_cdt->set_locale($LC::TIME);
my $local_pdt = $pdt->clone;
$local_pdt->set_time_zone('local');
$local_pdt->set_locale($LC::TIME);

my $formatter = $log->formatter;
for my $spec (
    ['%e', { event => 'deploy' }, 'deploy' ],
    ['%e', { event => 'revert' }, 'revert' ],
    ['%e', { event => 'fail' },   'fail' ],

    ['%L', { event => 'deploy' }, __ 'Deploy' ],
    ['%L', { event => 'revert' }, __ 'Revert' ],
    ['%L', { event => 'fail' },   __ 'Fail' ],

t/pg.t  view on Meta::CPAN

# instance on the local host trusting all local socket connections and the
# default postgres user, the test will connect, create the database it needs,
# run the tests, and then drop the database.
#
# Alternatively, provide the URL to connect to a Postgres database in the
# SQITCH_TEST_PG_URI environment variable. this is a standard URI::db URI, and
# should look something like this:
#
#     export SQITCH_TEST_PG_URI=db:pg://postgres:password@localhost:5432/sqitchtest
#
# It should use the C locale (`ALTER DATABASE $db SET lc_messages = 'C'`) to
# ensure proper sorting while testing. Sqitch will connect to this database and
# create two schemas to run the tests in, `sqitch` and `__sqitchtest`, and will
# drop them when the tests complete.
#

use strict;
use warnings;
use 5.010;
use Test::More 0.94;
use Test::MockModule;

t/plan_cmd.t  view on Meta::CPAN

        (my $exp = $spec->[1]) =~ s/__PDATE__/$piso/;
        is $cmd->formatter->format( $cmd->format, $change ), $exp,
            qq{Format "$spec->[0]" should output correctly without tags};
    }
}

###############################################################################
# Test all formatting characters.
my $local_pdt = $pdt->clone;
$local_pdt->set_time_zone('local');
$local_pdt->set_locale($LC::TIME);

my $formatter = $cmd->formatter;
for my $spec (
    ['%e', { event => 'deploy' }, 'deploy' ],
    ['%e', { event => 'revert' }, 'revert' ],
    ['%e', { event => 'fail' },   'fail' ],

    ['%L', { event => 'deploy' }, __ 'Deploy' ],
    ['%L', { event => 'revert' }, __ 'Revert' ],
    ['%L', { event => 'fail' },   __ 'Fail' ],

t/sqitch  view on Meta::CPAN

#!/usr/bin/env perl -CAS

use locale;
use FindBin;
use lib "$FindBin::Bin/../lib";
use App::Sqitch;

exit App::Sqitch->go;



( run in 1.330 second using v1.01-cache-2.11-cpan-ceb78f64989 )