Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: /svnutils/trunk/src/, /svnutils/trunk/unfinished/

svnutils
Discussion topic

Back to topic list

CVS update: /svnutils/trunk/src/, /svnutils/trunk/unfinished/

Author sunny256
Full name Øyvind A. Holm
Date 2004-09-12 15:30:59 PDT
Message User: sunny256
Date: 04/09/12 15:30:59

Removed:
 /svnutils/trunk/src/
  svnbck

Added:
 /svnutils/trunk/unfinished/
  svnbck

Log:
 r45 | sunny256 | 2004-09-11 15:52:57 +0000 | 12 lines
 
 Moved the unfinished svnbck script out of the way. Creating an
 â€œunfinished” directory where such things live.
 
 * /trunk/unfinished/
   New directory. Unfinished stuff go here.
 
 * /trunk/unfinished/svnbck
   Moved from /trunk/src/ r44...
 
 * /trunk/src/svnbck
   ...and then this is gone.

File Changes:

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

File [removed]: svnbck

Directory: /svnutils/trunk/unfinished/
====================​==================

File [added]: svnbck
Url: http://svnutils.tigr​is.org/source/browse​/svnutils/trunk/unfi​nished/svnbck?rev=1.​1&content-type=t​ext/vnd.viewcvs-mark​up
Added lines: 255
----------------
#!/usr/bin/perl -w

#===================​====================​====================​====
# $Id: svnbck 45 2004-09-11 15:52:57Z sunny256 $
# Backup of active Subversion repositories
#
# Character set:
# UTF-8
# Project page:
# http://svnutils.tigris.org
# Subversion repository:
# http://svn.sunbase.o​rg/repos/svnutils
# License:
# GNU General Public License
# Authors:
# Use "svn blame" or "svn log" against the Subversion repository to
# nail the responsible guys. As of 2004-06-07, it is only:
# - sunny, Ø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 45 2004-09-11 15:52:57Z sunny256 $';
$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 45 2004-09-11 15:52:57Z sunny256 $';
$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 45 2004-09-11 15:52:57Z sunny256 $

=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

Use "svn blame" or "svn log" against the Subversion repository to nail the responsible guys.

As of 2004-06-07, it is only:

=over 4

=item sunny — Øyvind A. Holm <sunny at sunbase dot org>

=back

=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 45 2004-09-11 15:52:57Z sunny256 $




--------------------​--------------------​--------------------​---------
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/trunk/src/, /svnutils/trunk/unfinished/ sunny256 Øyvind A. Holm 2004-09-12 15:30:59 PDT
Messages per page: