Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: /svnutils/branches/dvl-sunny/src/, /svnutils/trunk/src/

svnutils
Discussion topic

Back to topic list

CVS update: /svnutils/branches/dvl-sunny/src/, /svnutils/trunk/src/

Reply

Author sunny
Full name Øyvind A. Holm
Date 2004-06-06 19:46:42 PDT
Message User: sunny
Date: 04/06/06 19:46:42

Removed:
 /svnutils/branches/d​vl-sunny/src/
  svnbck

Added:
 /svnutils/trunk/src/
  svnbck

Log:
 r32 | sunny | 2004-06-07 04:44:08 +0200 (Mon, 07 Jun 2004) | 6 lines
 Changed paths:
    D /branches/dvl-sunny/src/svnbck
    A /trunk/src/svnbck (from /branches/dvl-sunny/​src/svnbck:31)
 
 svnutils$ svn mv branches/dvl-sunny/src/svnbck trunk/src/
 
 Moving the script to trunk/src instead. It doesn’t mess up anything even in
 its unfinished state, and it makes no use down in branches/dvl-sunny/
 anyway.

File Changes:

Directory: /svnutils/branches/d​vl-sunny/src/
====================​====================​====

File [removed]: svnbck

Directory: /svnutils/trunk/src/
===============================

File [added]: svnbck
Url: http://svnutils.tigr​is.org/source/browse​/svnutils/trunk/src/​svnbck?rev=1.1&c​ontent-type=text/vnd​.viewcvs-markup
Added lines: 238
----------------
#!/usr/bin/perl -w

#===================​====================​====================​====
# $Id: svnbck 32 2004-06-07 02:44:08Z sunny $
# Backup of active Subversion repositories
#
# Character set: UTF-8
# License: GNU General Public License ♥
# ©opyleft 2004 Øyvind A. Holm <sunny at sunbase dot org>
#===================​====================​====================​====

use strict;
# use utf8; # I don’t like this, it slows down Perl and tastes kludgy. If you are in a non-UTF-8 locale, it should probably be uncommented.
use Env qw{HOME};
use Getopt::Std;
our ($opt_f, $opt_h) =
    ("", 0 );

$| = 1;

getopts('f:h') || die("Option error. Use -h for help.");

my $Simulate = 1;

my $prog_name = $0;
$prog_name =~ s/^(.*\/)(.*?)$/$2/;
my $svn_Id = '$Id: svnbck 32 2004-06-07 02:44:08Z sunny $';
$svn_Id =~ s/^\$Id: (.*) \$/$1/;
my ($rev_nr, $rev_date) =
   ("", "" );
if ($svn_Id =~ /^(\S+) (\d+) (\S+ \S+)/) {
    $rev_nr = $2;
    $rev_date = $3;
}

my @repos_array = ();

$opt_h && usage(0);

print("$prog_name r$rev_nr ($rev_date)\n");
print("\nSorry ma, ain’t workin’ yet.\n");
exit;

defined($HOME) || die("$prog_name: The HOME environment variable is not defined. Aborting...\n");

my $config_file = length($opt_f) ? $opt_f : "$HOME/.svnbckrc";

my $rcs_id = '$Id: svnbck 32 2004-06-07 02:44:08Z sunny $';
$rcs_id =~ s/\$Id: (.*) \$/$1/;

parse_config_file();

sub mysystem {
    # Wrapper around the system() call to enable simulation {{{
    chomp(my $Cmd = shift);
    if ($Simulate) {
        print("Simulating \"$Cmd\"\n");
    } else {
        print("Executing \"$Cmd\"\n");
        # system($Cmd);
    }
    # }}}
} # mysystem()

sub parse_config_file {
    my $repos_found = 0;
    if (open(ConfigFP, "<$config_file")) {
        while (<ConfigFP>) {
            chomp();
            s/\s+$//g;
            if (/^[repositories]/) {
                $repos_found = 1;
            } else {
                if ($repos_found) {
                    if (/^(.+)$/) {
                        push(@repos_array, glob($1));
                    }
                } else {

                }
            }
        }
    } else {
        die("$prog_name: $config_file: Unable to open configuration file for read\n");
    }
} # parse_config_file()

sub usage {
    # Prints a help screen {{{
    my $Retval = shift;
    print(<<END);

$prog_name r$rev_nr ($rev_date)

Syntac: $prog_name [options]

Please refer to the POD (Plain Old Documentation) inside the $0 Perl script.
You can create a man page from this documentation by executing

  pod2man $0 >$0.1

END
    exit($Retval);
    # }}}
} usage()

__END__

# POD — Plain Old Documentation {{{

=pod

=head1 NAME

svnbck -- Backup utility for Subversion repositories

=head1 REVISION

$Id: svnbck 32 2004-06-07 02:44:08Z sunny $

=head1 SYNOPSIS

svnbck [options]

=head1 DESCRIPTION

A frontend against svn that will create dumpfiles in various ways, based on configuration options in config files.

=head1 OPTIONS

=over 4

=item B<-f x>

Use x as configuration file instead of F<~/.svnbckrc> .

=item B<-h>

Print a help message.

=back

=head1 FILES

=over 4

=item F<~/.svnbckrc>

Default configuration file

=back

=head1 BUGS

Well, it is unfinished at the moment.

=head1 COPYRIGHT

Copyright © 2004 Free Software Foundation, Inc.
This is free software; see the file F<COPYING> for legalese stuff.

=head1 AUTHOR

Øyvind A. Holm E<lt>sunny@sun​base.orgE<gt>

=head1 LICENCE

GNU General Public License.
The greatest of them all.
Thanks, RMS.

=head1 SEE ALSO

svn(1)

=cut

# }}}

# Thoughts (POD) {{{

=head1 THOUGHTS

=head2 Format of the ~/.svnbckrc file

All configuration options should be kept in this (or any other) config file.
Several repositories can be specified under the [repositories] section, and exactly one is allowed/needed in the [destdir] section.

The [blabla] format is used as section headers to follow the F<~/.subversion/config> style.

  # This is a comment. The # has to be in the first column.

  [repositories]

  /full/path/to/repos1
  /full/path/to/repos2
  /full/path/to/repos3
  /another/path/with/wildcards/*

Only one destination dir is allowed at the moment.

  [destdir]
  # strftime(3) time specifiers can be inserted into the destination directory.
  # Specifiers available:
  # %Y Year with four digits
  # %m Month (00..12)
  # %d Day of month (00..31)
  # %H Hour (00..23)
  # %M Minutes (00..59)
  # %S Seconds (00..61)
  # %% Regular percent sign
  # At the moment only GMT is used.
  /home/user/reposback​up/%Y/%Y-%m-%d

  [options]

  # backup_format is B<dump> for regular dump files, or B<repository> for repository.
  backup_format = dump

  # incremental can be B<yes> or B<no> to enable/disable incremental backups.
  # When backup_format = repository an error will be generated if incremental = yes.
  incremental = yes

  # The dump files can be compressed after backup. Available options are gzip, bzip2 or none.
  compression = gzip

  # notify_emails is where backup reports is sent
  notify_emails = user1 at example dot com, user2 at tigris dot org, user3 at example dot com

  # Logging of the backups is also available.
  logfile = /foo/bar/logfiles/%Y​/reposbackup.log

=cut

# }}}

# vim: set fileencoding=UTF-8 filetype=perl foldmethod=marker foldlevel=0 :
# End of file $Id: svnbck 32 2004-06-07 02:44:08Z sunny $




--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: cvs-unsubscribe@svnu​tils.tigris.org
For additional commands, e-mail: cvs-help at svnutils dot tigris dot org

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: /svnutils/branches/dvl-sunny/src/, /svnutils/trunk/src/ sunny Øyvind A. Holm 2004-06-06 19:46:42 PDT
Messages per page: