cvs-autoreleasedeb-0.12/0000755000175000017500000000000010470572420014312 5ustar ruosoruosocvs-autoreleasedeb-0.12/cvs-autoreleasedeb0000755000175000017500000003231010464646621020024 0ustar ruosoruoso#!/usr/bin/perl use AptPkg::Config '$_config'; use AptPkg::System '$_system'; use AptPkg::Version; $_config->init; $_system = $_config->system; my $vs = $_system->versioning; use strict; =head1 NAME cvs-autoreleasedeb - Automatic Release of debian packages from CVS =head1 DESCRIPTION This script generates and uploads the debian package for cvs modules managed by cvs-buildpackage. cvs-autoreleasedeb will maintain a state file of all the packages you want to be automatically published, and every time you commit the debian/changelog file of your package, changing the debian version to a greater value, it will be published. All the parameters to the script are configured in the conffile. There is no command-line switch. See cvs-autoreleasedeb.conf(5) for more information. =head1 USING There are two ways of using this script: 1) Run as user cvs-autoreleasedeb in cron. This is very useful for software houses that want to have the "nightily build" version of the software published automatically. In this case, the config file will be "/etc/cvs-autoreleasedeb.conf" and it will use /var/lib/cvs-autoreleasedeb/ as scratch dir. NOTE: edit /etc/default/cvs-autoreleasedeb to control this behavior NOTE 2: all output will be thrown in /var/log/cvs-autoreleasedeb/run.log 2) Run as yourself, it will automatizate the work you will have if you have your packages in CVS. In this case, the config file will be $HOME/.cvs-autoreleasedeb/conf and the scratch dir will be $HOME/.cvs-autoreleasedeb. cvs-autoreleasedeb will not create defaults, you must have the configuration file created before running cvs-autoreleasedeb. See cvs-autoreleasedeb.conf(5). =head1 TODO - Use a snapshot of the time of the commit in the changelog to checkout the source - Localize the messages. - Work with other than all lowercase in conffile. - Use a better format for conffile. =head1 _EXIT CODES _exit codes: 0 = Clean _exit 1 = Config file not found 2 = No packages in config file 3 = Couldn't open the state file 4 = Couldn't open the state file for writing 5 = Couldn't determine architecture =head1 SEE ALSO cvs-buildpackage(1), cvs(1), cvs-autoreleasedeb.conf(5), dupload(1) =head1 AUTHOR This manual page was written by Daniel Ruoso , for the Debian GNU/Linux system. =cut # Constants $::USERCONF = $ENV{HOME}."/.cvs-autoreleasedeb/conf"; $::CONFFILE = "/etc/cvs-autoreleasedeb.conf"; # Read the configfile. This function defines if # the script is running as the cvs-autoreleasedeb # user. And in this case, it will use the directory # in /var/lib, else will use $HOME/.cvs-autoreleasedeb/ # The definition of what directory will be used is setted # in $::VARDIR. if (getpwuid($>) eq "cvs-autoreleasedeb") { $::VARDIR = "/var/lib/cvs-autoreleasedeb/"; } else { $::VARDIR = $ENV{HOME}."/.cvs-autoreleasedeb/"; } $::STATEFILE = $::VARDIR."packages.state"; $::CVSDIR = $::VARDIR."cvs/"; $::PACKDIR = $::VARDIR."packages/"; $::CVS = "cvs -Q"; # before anything, will see if another cvs-autoreleasedeb is running if (-e $::VARDIR."cvs-autoreleasedeb.lock") { open PIDFILE, $::VARDIR."cvs-autoreleasedeb.lock"; my $pid = ; close PIDFILE; chomp $pid; if (kill 0, $pid) { # Another instance is running # will hung up now. print "Another instance is already running, will not try to run now.\n"; exit 0; } else { # stale lock file, will overwrite print "Overwriting tale lock file.\n"; } } open PIDFILE, ">".$::VARDIR."cvs-autoreleasedeb.lock"; print PIDFILE $$; close PIDFILE; sub _exit { my $_exit_code = shift; unlink $::VARDIR."cvs-autoreleasedeb.lock"; exit $_exit_code; } my $conf_struct = &read_conf_file; # Get architecture my $arch = ''; ######## # This code was taken from debuild script!!!!!!! THANKS!!!!! ######## if (system("command -v dpkg-architecture >/dev/null 2>&1") == 0) { $arch=`dpkg-architecture -qDEB_HOST_ARCH 2>/dev/null`; chomp($arch); } $arch ||= `dpkg --print-architecture 2>/dev/null`; chomp($arch); if (!$arch) { print "Couldn't determine architecture!?"; _exit 5; } #### # end of code from debuild #### # Let's start the action # Read the state of the packages he want to # watch my $state_struct = &read_state_file; # If there is no state, tell the user that the # script will create the state file, and # generate all the packages if (ref($state_struct) ne "HASH") { print "No state was found, this means you never runned this script \n"; print "before, so, all the packages in $::CONFFILE will be generated.\n"; } # Grab the actual state of the watched packages my $newstate_struct = &grab_packages_state($conf_struct); # Those who have difference will be generated. my $newpacks_struct = &list_state_diffs($conf_struct,$state_struct,$newstate_struct); # If no packages to generate if (ref($newpacks_struct) ne "HASH") { print "No packages to generate.\n"; _exit 0; } mkdir $::CVSDIR; mkdir $::PACKDIR; my %failed_packages; foreach my $s (keys %{$newpacks_struct}) { $failed_packages{$s} = []; next if ref($newpacks_struct->{$s}) ne "HASH"; print " ======= Starting to work with server $s ======== \n"; print " creating directory ".$::CVSDIR.$s."\n"; mkdir($::CVSDIR.$s); print " creating directory ".$::PACKDIR.$s."\n"; mkdir($::PACKDIR.$s); my $oldpwd = `pwd`; foreach my $p (keys %{$newpacks_struct->{$s}}) { print " = Starting to work with package $p = \n"; my $cmd; # var for commands ###################### # Checkout the package ###################### # cvsroot MUST be defined, # prefix is optional unless ($conf_struct->{$s}{$p}{cvsroot} =~ /\S+/) { print "Skipping, because no CVSROOT defined.\n"; push @{$failed_packages{$s}}, $p; next; } chdir($::CVSDIR.$s); $cmd = "$::CVS -d ".$conf_struct->{$s}{$p}{cvsroot}." checkout "; # If the user sets a tag, use it instead of HEAD. if ($conf_struct->{$s}{$p}{tag} =~ /S+/) { $cmd .= " -r ".$conf_struct->{$s}{$p}{tag}." "; } else { $cmd .= " -A "; } $cmd .= $conf_struct->{$s}{$p}{prefix}.$p; print $cmd."\n"; unless (system($cmd) == 0) { print "CVS Checkout failed. going to try again in the next run!\n"; push @{$failed_packages{$s}}, $p; next; } # Generate the package mkdir($::PACKDIR.$s."/".$p); chdir($::CVSDIR.$s."/".$conf_struct->{$s}{$p}{prefix}."/".$p); $cmd = "cvs-buildpackage -W".$::PACKDIR.$s."/".$p." "; if ($conf_struct->{$s}{$p}{prefix}) { $cmd .= "-x".$conf_struct->{$s}{$p}{prefix}; } $cmd .= " -rfakeroot "; $cmd .= $CVSAutoreleasedeb::XMLconf::SERVER_OPT{$s}; if ($conf_struct->{$s}{$p}{option}{"binary-source"}) { $cmd .= " -b"; } print $cmd."\n"; unless (system($cmd) == 0) { print "cvs-buildpackage failed. going to try again in the next run!\n"; push @{$failed_packages{$s}}, $p; next; } # Upload the packages chdir($::PACKDIR.$s."/".$p); my $stripedVer = $newstate_struct->{$s}{$p}; # Remove epoch numbers, that don't go to file name if($stripedVer =~ m/^[^:]+:(.+)$/) { $stripedVer = $1; } $cmd = "dupload --to ".$s." ".$p."_".$stripedVer."_".$arch.".changes"; print $cmd."\n"; unless (system($cmd) == 0) { push @{$failed_packages{$s}}, $p; print "dupload failed. going to try again in the next run!\n"; next; } } # Clean the directories my $cmd; chdir($oldpwd); $cmd = "rm -rf ".$::CVSDIR.$s; print $cmd."\n"; system $cmd; $cmd = "rm -rf ".$::PACKDIR.$s; print $cmd."\n"; system $cmd; } # revert to the old state the failed packages, so they # will be generated again in next run. foreach my $s (keys %failed_packages) { foreach my $p (@{$failed_packages{$s}}) { if (exists $state_struct->{$s}{$p}) { $newstate_struct->{$s}{$p} = $state_struct->{$s}{$p}; } else { delete $newstate_struct->{$s}{$p}; } } } # Save the new state &write_state_file($newstate_struct); # Everything was ok!!! # Clean _exit _exit 0; ################################################### # SUBROUTINES ################################################### ################################################### # read_conf_file # READS THE CONFIGURATION FILE, AND RETURNS AS A # HASH_REF. ################################################### sub read_conf_file { # if the script is running as a user different # of "cvs-autoreleasedeb", it will use the # file in the home of the user, else it will use # the file in /etc/ my $conffile; if (getpwuid($>) eq "cvs-autoreleasedeb") { $conffile = $::CONFFILE; } else { $conffile = $::USERCONF; } my $conf_struct; if (!-f $conffile) { print "The file $conffile was not found.\n"; _exit 1; } else { require XML::Parser; my $p = eval { my $conf_parser = new XML::Parser(Style => "CVSAutoreleasedeb::XMLconf"); $conf_struct = $conf_parser->parsefile($conffile); # parser package below }; if ($@ || !$p) { print "There were errors while trying to read $conffile. Follows the error:$@\n"; _exit 2; } } # If the configfile is empty, send message of # what the user must do and _exit if (ref($conf_struct) ne "HASH") { print "No servers in $conffile. See cvs-autoreleasedeb.conf(5).\n"; _exit 2; } else { my ($first) = keys %{$conf_struct}; if (ref($conf_struct->{$first}) ne "HASH") { print "No packages in $conffile. See cvs-autoreleasedeb.conf(5).\n"; _exit 2; } } return $conf_struct; } ################################################### # read_state_file # READS THE STATE FILE, AND RETURNS AS A # HASH_REF. ################################################### sub read_state_file { my $state_struct; if (-f $::STATEFILE) { unless (open (STATE, $::STATEFILE)) { print "Cannot open $::STATEFILE, I don't know why! Follows the error: $!\n"; _exit 3; } while () { my ($s,$p,$v) = split(/;/, $_); $state_struct->{$s}{$p} = $v; } close STATE; } return $state_struct; } ################################################## # write_state_file ($state_struct) # WRITES THE STATE FILE ################################################## sub write_state_file { my $state_struct = shift; return undef unless ref($state_struct) eq "HASH"; unless (open (STATE, ">".$::STATEFILE)) { print "Cannot open $::STATEFILE for writing,\n I don't know why! Follows the error: \n$!\n"; _exit 4; } foreach my $s (keys %{$state_struct}) { next if ref($state_struct->{$s}) ne "HASH"; foreach my $p (keys %{$state_struct->{$s}}) { print STATE join(';',($s,$p,$state_struct->{$s}{$p})); print STATE "\n"; } } close STATE; return 1; } ################################################# # grab_packages_state ($conf_struct) # GRAB THE ACTUAL STATE OF THE PACKAGES ################################################# sub grab_packages_state { my $conf_struct = shift; my $newstate_struct; return undef unless ref ($conf_struct) eq "HASH"; foreach my $s (keys %{$conf_struct}) { print "Grabbing the state of packages in server $s\n"; next if ref $conf_struct->{$s} ne "HASH"; foreach my $p (keys %{$conf_struct->{$s}}) { my $cmd; # Used for commands; # cvsroot MUST be defined, # prefix is optional unless ($conf_struct->{$s}{$p}{cvsroot} =~ /\S+/) { print "Skipping $p, because no CVSROOT defined.\n"; next; } $cmd = "$::CVS -d ".$conf_struct->{$s}{$p}{cvsroot}." checkout -A -p ". $conf_struct->{$s}{$p}{prefix}.$p."/debian/changelog"; my $changelog = `$cmd`; my $version; ($version = $changelog) =~ s/^$p \((.+?)\).+$/$1/s; print "Package $p in version $version\n"; $newstate_struct->{$s}{$p} = $version; } } return $newstate_struct; } ################################################# # list_state_diffs ($conf_struct,$state_struct,$newstate_struct) # LIST THE PACKAGES THAT MUST BE GENERATED ################################################# sub list_state_diffs { my $conf_struct = shift; my $state_struct = shift; my $newstate_struct = shift; my $newpacks_struct; return undef if ref $conf_struct ne "HASH"; foreach my $s (keys %{$conf_struct}) { next if ref $conf_struct->{$s} ne "HASH"; foreach my $p (keys %{$conf_struct->{$s}}) { if ($vs->compare($newstate_struct->{$s}{$p}, $state_struct->{$s}{$p}) > 0) { # Use the date of the commit here. $newpacks_struct->{$s}{$p} = scalar(localtime); } } } return $newpacks_struct; } ################################################################# # PACKAGE FOR XML READING ################################################################# package CVSAutoreleasedeb::XMLconf; $CVSAutoreleasedeb::XMLconf::SERVER = ''; $CVSAutoreleasedeb::XMLconf::PACKAGE = ''; %CVSAutoreleasedeb::XMLconf::STRUCT = (); sub Start { my $p = shift; my $elem = shift; my %vars = @_; if ($elem eq "server") { $CVSAutoreleasedeb::XMLconf::SERVER = $vars{name}; $CVSAutoreleasedeb::XMLconf::SERVER_OPT{$vars{name}} = $vars{options}; } elsif ($elem eq "package") { $CVSAutoreleasedeb::XMLconf::PACKAGE = $vars{name}; $CVSAutoreleasedeb::XMLconf::STRUCT{$CVSAutoreleasedeb::XMLconf::SERVER}{$CVSAutoreleasedeb::XMLconf::PACKAGE} = \%vars; } elsif ($elem eq "option") { $CVSAutoreleasedeb::XMLconf::STRUCT{$CVSAutoreleasedeb::XMLconf::SERVER}{$CVSAutoreleasedeb::XMLconf::PACKAGE}{option}{$vars{name}} = $vars{value}; } } sub End { my $p = shift; my $elem = shift; if ($elem eq "server") { $CVSAutoreleasedeb::XMLconf::SERVER = '' } elsif ($elem eq "package") { $CVSAutoreleasedeb::XMLconf::PACKAGE = ''; } } sub Final { return \%CVSAutoreleasedeb::XMLconf::STRUCT; } cvs-autoreleasedeb-0.12/cvs-autoreleasedeb.conf0000644000175000017500000000115710464646621020752 0ustar ruosoruoso ]> cvs-autoreleasedeb-0.12/cvs-autoreleasedeb.10000644000175000017500000001407310466331601020155 0ustar ruosoruoso.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "CVS-AUTORELEASEDEB 1" .TH CVS-AUTORELEASEDEB 1 "2006-08-04" "perl v5.8.7" "User Contributed Perl Documentation" .SH "NAME" cvs\-autoreleasedeb \- Automatic Release of debian packages from CVS .SH "DESCRIPTION" .IX Header "DESCRIPTION" This script generates and uploads the debian package for cvs modules managed by cvs\-buildpackage. .PP cvs-autoreleasedeb will maintain a state file of all the packages you want to be automatically published, and every time you commit the debian/changelog file of your package, changing the debian version to a greater value, it will be published. .PP All the parameters to the script are configured in the conffile. There is no command-line switch. See \&\fIcvs\-autoreleasedeb.conf\fR\|(5) for more information. .SH "USING" .IX Header "USING" There are two ways of using this script: .PP 1) Run as user cvs-autoreleasedeb in cron. This is very useful for software houses that want to have the \*(L"nightily build\*(R" version of the software published automatically. In this case, the config file will be \*(L"/etc/cvs\-autoreleasedeb.conf\*(R" and it will use /var/lib/cvs\-autoreleasedeb/ as scratch dir. .PP .Vb 2 \& NOTE: edit /etc/default/cvs\-autoreleasedeb to control this behavior \& NOTE 2: all output will be thrown in /var/log/cvs\-autoreleasedeb/run.log .Ve .PP 2) Run as yourself, it will automatizate the work you will have if you have your packages in \s-1CVS\s0. In this case, the config file will be \f(CW$HOME\fR/.cvs\-autoreleasedeb/conf and the scratch dir will be \f(CW$HOME\fR/.cvs\-autoreleasedeb. cvs-autoreleasedeb will not create defaults, you must have the configuration file created before running cvs\-autoreleasedeb. See \&\fIcvs\-autoreleasedeb.conf\fR\|(5). .SH "TODO" .IX Header "TODO" .Vb 5 \& \- Use a snapshot of the time of the commit in \& the changelog to checkout the source \& \- Localize the messages. \& \- Work with other than all lowercase in conffile. \& \- Use a better format for conffile. .Ve .SH "_EXIT CODES" .IX Header "_EXIT CODES" .Vb 7 \& _exit codes: \& 0 = Clean _exit \& 1 = Config file not found \& 2 = No packages in config file \& 3 = Couldn't open the state file \& 4 = Couldn't open the state file for writing \& 5 = Couldn't determine architecture .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIcvs\-buildpackage\fR\|(1), \fIcvs\fR\|(1), \fIcvs\-autoreleasedeb.conf\fR\|(5), \fIdupload\fR\|(1) .SH "AUTHOR" .IX Header "AUTHOR" This manual page was written by Daniel Ruoso , for the Debian GNU/Linux system. cvs-autoreleasedeb-0.12/cvs-autoreleasedeb.conf.pod0000644000175000017500000000544710464646621021541 0ustar ruosoruoso=head1 NAME cvs-autoreleasedeb.conf - Configuration for cvs-autoreleasedeb =head1 SYNOPSIS /etc/cvs-autoreleasedeb.conf $HOME/.cvs-autoreleasedeb/conf =head1 DESCRIPTION The cvs-autoreleasedeb configuration file is writed in XML, because XML is easy to work with multiple-level data, but it's already in the TODO list to use a better format. As a good XML file, this config file has the following header. ]> Which, in fact, tells the structure of the XML file. But in the case you don't know XML, this header tells that, in the sources, you have servers, which have packages, which have options. A server has the "name" and the "option" properies, a package has "name", "cvsroot", "prefix" and "tag" properties and an option has "name" and "value" property. Before explaining how the options affects the script, you must know that in the current version, all the tags and properties MUST be lowercase (it's already on the TODO list). =head1 CONFIGURATION SECTIONS =head2 server This is the master section, tells what server to dupload. Actually, the "name" property of the server is used as the "--to" parameter to dupload. Packages are declared inside servers. Also, the "options" property tells aditional parameters to cvs-buildpackage for every package in this server. =head2 package The package itself, the "name" property is used as the module name for cvs checkout. The "cvsroot" property is passed to cvs as the CVSROOT and the "prefix" is placed before the module name, used if your package is inside some other directory than the cvs root. Optionally, you can inform a tag to checkout the sources from. =head2 option Specify an option to a package. The following options are accepted and increment the following text to the cvs-buildpackage command: binary-source = 1: "-b" =head1 EXAMPLE In the case you still didn't understand the config file, follows an example: =head1 SEE ALSO cvs-buildpackage(1), cvs(1), cvs-autoreleasedeb(1), dupload(1) =head1 AUTHOR This manual page was written by Daniel Ruoso , for the Debian GNU/Linux system. =cut cvs-autoreleasedeb-0.12/cvs-autoreleasedeb.cron0000644000175000017500000000026010464646621020760 0ustar ruosoruoso# Cron file for cvs-autoreleasedeb */5 * * * * cvs-autoreleasedeb . /etc/default/cvs-autoreleasedeb && /usr/bin/cvs-autoreleasedeb 2>&1 >> /var/log/cvs-autoreleasedeb/run.log cvs-autoreleasedeb-0.12/cvs-autoreleasedeb.defaults0000644000175000017500000000054510464646621021634 0ustar ruosoruoso# This file is used to define the behavior of cvs-autoreleasedeb. # Cvs-autoreleasedeb cron sources this file before running the program. # Use this file to stop it from running in cron. # Just to check if the package is installed test -x /usr/bin/cvs-autoreleasedeb || exit 0; # Now the command to run or not. # exit 1 = run # exit 0 = don't run exit 1; cvs-autoreleasedeb-0.12/cvs-autoreleasedeb.logrotate0000644000175000017500000000011510464646621022016 0ustar ruosoruoso/var/log/cvs-autoreleasedeb/*.log { rotate 12 daily compress missingok } cvs-autoreleasedeb-0.12/Makefile0000644000175000017500000000307710464646621015771 0ustar ruosoruoso PREFIX = ${DESTDIR} BINDIR = ${PREFIX}/usr/bin ETCDIR = ${PREFIX}/etc CRONDIR = ${ETCDIR}/cron.d/ DEFDIR = ${ETCDIR}/default/ LOGRDIR = ${ETCDIR}/logrotate.d/ all: pod2man cvs-autoreleasedeb > cvs-autoreleasedeb.1 pod2man -s 5 cvs-autoreleasedeb.conf.pod > cvs-autoreleasedeb.conf.5 chmod ugo+x cvs-autoreleasedeb pod2man svn-autoreleasedeb > svn-autoreleasedeb.1 pod2man -s 5 svn-autoreleasedeb.conf.pod > svn-autoreleasedeb.conf.5 chmod ugo+x svn-autoreleasedeb clean: rm -rf cvs-autoreleasedeb.1 rm -rf cvs-autoreleasedeb.conf.5 rm -rf svn-autoreleasedeb.1 rm -rf svn-autoreleasedeb.conf.5 rm -rf *~ install: install-cvs install-svn install-cvs: cp cvs-autoreleasedeb ${BINDIR} chmod 755 ${BINDIR}/cvs-autoreleasedeb cp cvs-autoreleasedeb.conf ${ETCDIR} chmod 644 ${ETCDIR}/cvs-autoreleasedeb.conf cp cvs-autoreleasedeb.cron ${CRONDIR}/cvs-autoreleasedeb chmod 644 ${CRONDIR}/cvs-autoreleasedeb cp cvs-autoreleasedeb.defaults ${DEFDIR}/cvs-autoreleasedeb chmod 644 ${DEFDIR}/cvs-autoreleasedeb cp cvs-autoreleasedeb.logrotate ${LOGRDIR}/cvs-autoreleasedeb chmod 644 ${LOGRDIR}/cvs-autoreleasedeb install-svn: cp svn-autoreleasedeb ${BINDIR} chmod 755 ${BINDIR}/svn-autoreleasedeb cp svn-autoreleasedeb.conf ${ETCDIR} chmod 644 ${ETCDIR}/svn-autoreleasedeb.conf cp svn-autoreleasedeb.cron ${CRONDIR}/svn-autoreleasedeb chmod 644 ${CRONDIR}/svn-autoreleasedeb cp svn-autoreleasedeb.defaults ${DEFDIR}/svn-autoreleasedeb chmod 644 ${DEFDIR}/svn-autoreleasedeb cp svn-autoreleasedeb.logrotate ${LOGRDIR}/svn-autoreleasedeb chmod 644 ${LOGRDIR}/svn-autoreleasedeb cvs-autoreleasedeb-0.12/svn-autoreleasedeb0000755000175000017500000003267010470572407020045 0ustar ruosoruoso#!/usr/bin/perl use AptPkg::Config '$_config'; use AptPkg::System '$_system'; use AptPkg::Version; $_config->init; $_system = $_config->system; my $vs = $_system->versioning; use strict; =head1 NAME svn-autoreleasedeb - Automatic Release of debian packages from =head1 DESCRIPTION This script generates and uploads the debian package for svn modules managed by svn-buildpackage. svn-autoreleasedeb will maintain a state file of all the packages you want to be automatically published, and every time you commit the debian/changelog file of your package, changing the debian version to a greater value, it will be published. All the parameters to the script are configured in the conffile. There is no command-line switch. See svn-autoreleasedeb.conf(5) for more information. =head1 USING There are two ways of using this script: 1) Run as user svn-autoreleasedeb in cron. This is very useful for software houses that want to have the "nightily build" version of the software published automatically. In this case, the config file will be "/etc/svn-autoreleasedeb.conf" and it will use /var/lib/svn-autoreleasedeb/ as scratch dir. NOTE: edit /etc/default/svn-autoreleasedeb to control this behavior NOTE 2: all output will be thrown in /var/log/svn-autoreleasedeb/run.log 2) Run as yourself, it will automatizate the work you will have if you have your packages in SVN. In this case, the config file will be $HOME/.svn-autoreleasedeb/conf and the scratch dir will be $HOME/.svn-autoreleasedeb. svn-autoreleasedeb will not create defaults, you must have the configuration file created before running svn-autoreleasedeb. See svn-autoreleasedeb.conf(5). =head1 TODO - Use a snapshot of the time of the commit in the changelog to checkout the source - Localize the messages. - Work with other than all lowercase in conffile. - Use a better format for conffile. =head1 _EXIT CODES _exit codes: 0 = Clean _exit 1 = Config file not found 2 = No packages in config file 3 = Couldn't open the state file 4 = Couldn't open the state file for writing 5 = Couldn't determine architecture =head1 SEE ALSO svn-buildpackage(1), svn(1), svn-autoreleasedeb.conf(5), dupload(1) =head1 AUTHOR This manual page was written by Daniel Ruoso , for the Debian GNU/Linux system. =cut # Constants $::USERCONF = $ENV{HOME}."/.svn-autoreleasedeb/conf"; $::CONFFILE = "/etc/svn-autoreleasedeb.conf"; # Read the configfile. This function defines if # the script is running as the svn-autoreleasedeb # user. And in this case, it will use the directory # in /var/lib, else will use $HOME/.svn-autoreleasedeb/ # The definition of what directory will be used is setted # in $::VARDIR. if (getpwuid($>) eq "svn-autoreleasedeb") { $::VARDIR = "/var/lib/svn-autoreleasedeb/"; } else { $::VARDIR = $ENV{HOME}."/.svn-autoreleasedeb/"; } $::STATEFILE = $::VARDIR."packages.state"; $::SVNDIR = $::VARDIR."svn/"; $::PACKDIR = $::VARDIR."packages/"; $::SVN = "svn"; # before anything, will see if another svn-autoreleasedeb is running if (-e $::VARDIR."svn-autoreleasedeb.lock") { open PIDFILE, $::VARDIR."svn-autoreleasedeb.lock"; my $pid = ; close PIDFILE; chomp $pid; if (kill 0, $pid) { # Another instance is running # will hung up now. print "Another instance is already running, will not try to run now.\n"; exit 0; } else { # stale lock file, will overwrite print "Overwriting tale lock file.\n"; } } open PIDFILE, ">".$::VARDIR."svn-autoreleasedeb.lock"; print PIDFILE $$; close PIDFILE; sub _exit { my $_exit_code = shift; unlink $::VARDIR."svn-autoreleasedeb.lock"; exit $_exit_code; } my $conf_struct = &read_conf_file; # Get architecture my $arch = ''; ######## # This code was taken from debuild script!!!!!!! THANKS!!!!! ######## if (system("command -v dpkg-architecture >/dev/null 2>&1") == 0) { $arch=`dpkg-architecture -qDEB_HOST_ARCH 2>/dev/null`; chomp($arch); } $arch ||= `dpkg --print-architecture 2>/dev/null`; chomp($arch); if (!$arch) { print "Couldn't determine architecture!?"; _exit 5; } #### # end of code from debuild #### # Let's start the action # Read the state of the packages he want to # watch my $state_struct = &read_state_file; # If there is no state, tell the user that the # script will create the state file, and # generate all the packages if (ref($state_struct) ne "HASH") { print "No state was found, this means you never runned this script \n"; print "before, so, all the packages in $::CONFFILE will be generated.\n"; } # Grab the actual state of the watched packages my $newstate_struct = &grab_packages_state($conf_struct); # Those who have difference will be generated. my $newpacks_struct = &list_state_diffs($conf_struct,$state_struct,$newstate_struct); # If no packages to generate if (ref($newpacks_struct) ne "HASH") { print "No packages to generate.\n"; _exit 0; } mkdir $::SVNDIR; mkdir $::PACKDIR; my %failed_packages; foreach my $s (keys %{$newpacks_struct}) { $failed_packages{$s} = []; next if ref($newpacks_struct->{$s}) ne "HASH"; print " ======= Starting to work with server $s ======== \n"; print " creating directory ".$::SVNDIR.$s."\n"; mkdir($::SVNDIR.$s); print " creating directory ".$::PACKDIR.$s."\n"; mkdir($::PACKDIR.$s); my $oldpwd = `pwd`; foreach my $p (keys %{$newpacks_struct->{$s}}) { print " = Starting to work with package $p = \n"; my $cmd; # var for commands ###################### # Checkout the package ###################### # svnserver MUST be defined, # prefix is optional unless ($conf_struct->{$s}{$p}{svnserver} =~ /\S+/) { print "Skipping, because no svnserver defined.\n"; push @{$failed_packages{$s}}, $p; next; } unless ($conf_struct->{$s}{$p}{tag} =~ /\S+/) { print "Skipping, because no tag defined.\n"; push @{$failed_packages{$s}}, $p; next; } chdir($::SVNDIR.$s); $cmd = "$::SVN checkout ".$conf_struct->{$s}{$p}{svnserver}.q(/).$conf_struct->{$s}{$p}{prefix}. q(/).$p.q(/).$conf_struct->{$s}{$p}{tag}."/ ".($conf_struct->{$s}{$p}{prefix}?$conf_struct->{$s}{$p}{prefix}.q(/):'').$p; print $cmd."\n"; unless (system($cmd) == 0) { print "SVN Checkout failed. going to try again in the next run!\n"; push @{$failed_packages{$s}}, $p; next; } # Generate the package mkdir($::PACKDIR.$s."/".$p); chdir($::SVNDIR.$s."/".$conf_struct->{$s}{$p}{prefix}."/".$p); $cmd = "svn-buildpackage --svn-override=buildArea=".$::PACKDIR.$s."/".$p." "; unless (system($cmd) == 0) { print "svn-buildpackage failed. going to try again in the next run!\n"; push @{$failed_packages{$s}}, $p; next; } if ($conf_struct->{$s}{$p}{option}{local}) { # no uploading of local packages next; } # Upload the packages chdir($::PACKDIR.$s."/".$p); my $stripedVer = $newstate_struct->{$s}{$p}; # Remove epoch numbers, that don't go to file name if($stripedVer =~ m/^[^:]+:(.+)$/) { $stripedVer = $1; } $cmd = "dupload --to ".$s." ".$p."_".$stripedVer."_".$arch.".changes"; print $cmd."\n"; unless (system($cmd) == 0) { push @{$failed_packages{$s}}, $p; print "dupload failed. going to try again in the next run!\n"; next; } } # Clean the directories my $cmd; chdir($oldpwd); $cmd = "rm -rf ".$::SVNDIR.$s; print $cmd."\n"; system $cmd; $cmd = "rm -rf ".$::PACKDIR.$s; print $cmd."\n"; system $cmd; } # revert to the old state the failed packages, so they # will be generated again in next run. foreach my $s (keys %failed_packages) { foreach my $p (@{$failed_packages{$s}}) { if (exists $state_struct->{$s}{$p}) { $newstate_struct->{$s}{$p} = $state_struct->{$s}{$p}; } else { delete $newstate_struct->{$s}{$p}; } } } # Save the new state &write_state_file($newstate_struct); # Everything was ok!!! # Clean _exit _exit 0; ################################################### # SUBROUTINES ################################################### ################################################### # read_conf_file # READS THE CONFIGURATION FILE, AND RETURNS AS A # HASH_REF. ################################################### sub read_conf_file { # if the script is running as a user different # of "svn-autoreleasedeb", it will use the # file in the home of the user, else it will use # the file in /etc/ my $conffile; if (getpwuid($>) eq "svn-autoreleasedeb") { $conffile = $::CONFFILE; } else { $conffile = $::USERCONF; } my $conf_struct; if (!-f $conffile) { print "The file $conffile was not found.\n"; _exit 1; } else { require XML::Parser; my $p = eval { my $conf_parser = new XML::Parser(Style => "SVNAutoreleasedeb::XMLconf"); $conf_struct = $conf_parser->parsefile($conffile); # parser package below }; if ($@ || !$p) { print "There were errors while trying to read $conffile. Follows the error:$@\n"; _exit 2; } } # If the configfile is empty, send message of # what the user must do and _exit if (ref($conf_struct) ne "HASH") { print "No servers in $conffile. See svn-autoreleasedeb.conf(5).\n"; _exit 2; } else { my ($first) = keys %{$conf_struct}; if (ref($conf_struct->{$first}) ne "HASH") { print "No packages in $conffile. See svn-autoreleasedeb.conf(5).\n"; _exit 2; } } return $conf_struct; } ################################################### # read_state_file # READS THE STATE FILE, AND RETURNS AS A # HASH_REF. ################################################### sub read_state_file { my $state_struct; if (-f $::STATEFILE) { unless (open (STATE, $::STATEFILE)) { print "Cannot open $::STATEFILE, I don't know why! Follows the error: $!\n"; _exit 3; } while () { my ($s,$p,$v) = split(/;/, $_); $state_struct->{$s}{$p} = $v; } close STATE; } return $state_struct; } ################################################## # write_state_file ($state_struct) # WRITES THE STATE FILE ################################################## sub write_state_file { my $state_struct = shift; return undef unless ref($state_struct) eq "HASH"; unless (open (STATE, ">".$::STATEFILE)) { print "Cannot open $::STATEFILE for writing,\n I don't know why! Follows the error: \n$!\n"; _exit 4; } foreach my $s (keys %{$state_struct}) { next if ref($state_struct->{$s}) ne "HASH"; foreach my $p (keys %{$state_struct->{$s}}) { print STATE join(';',($s,$p,$state_struct->{$s}{$p})); print STATE "\n"; } } close STATE; return 1; } ################################################# # grab_packages_state ($conf_struct) # GRAB THE ACTUAL STATE OF THE PACKAGES ################################################# sub grab_packages_state { my $conf_struct = shift; my $newstate_struct; return undef unless ref ($conf_struct) eq "HASH"; foreach my $s (keys %{$conf_struct}) { print "Grabbing the state of packages in server $s\n"; next if ref $conf_struct->{$s} ne "HASH"; foreach my $p (keys %{$conf_struct->{$s}}) { my $cmd; # Used for commands; # svnserver MUST be defined, # prefix is optional unless ($conf_struct->{$s}{$p}{svnserver} =~ /\S+/) { print "Skipping $p, because no svnserver defined.\n"; next; } unless ($conf_struct->{$s}{$p}{tag} =~ /\S+/) { print "Skipping $p, because no tag defined.\n"; next; } $cmd = "$::SVN cat ".$conf_struct->{$s}{$p}{svnserver}.q(/).$conf_struct->{$s}{$p}{prefix}. q(/).$p.q(/).$conf_struct->{$s}{$p}{tag}."/debian/changelog"; print $cmd."\n"; my $changelog = `$cmd`; my $version; ($version = $changelog) =~ s/^$p \((.+?)\).+$/$1/s; print "Package $p in version $version\n"; $newstate_struct->{$s}{$p} = $version; } } return $newstate_struct; } ################################################# # list_state_diffs ($conf_struct,$state_struct,$newstate_struct) # LIST THE PACKAGES THAT MUST BE GENERATED ################################################# sub list_state_diffs { my $conf_struct = shift; my $state_struct = shift; my $newstate_struct = shift; my $newpacks_struct; return undef if ref $conf_struct ne "HASH"; foreach my $s (keys %{$conf_struct}) { next if ref $conf_struct->{$s} ne "HASH"; foreach my $p (keys %{$conf_struct->{$s}}) { if ($vs->compare($newstate_struct->{$s}{$p}, $state_struct->{$s}{$p}) > 0) { # Use the date of the commit here. $newpacks_struct->{$s}{$p} = scalar(localtime); } } } return $newpacks_struct; } ################################################################# # PACKAGE FOR XML READING ################################################################# package SVNAutoreleasedeb::XMLconf; $SVNAutoreleasedeb::XMLconf::SERVER = ''; $SVNAutoreleasedeb::XMLconf::PACKAGE = ''; %SVNAutoreleasedeb::XMLconf::STRUCT = (); sub Start { my $p = shift; my $elem = shift; my %vars = @_; if ($elem eq "server") { $SVNAutoreleasedeb::XMLconf::SERVER = $vars{name}; $SVNAutoreleasedeb::XMLconf::SERVER_OPT{$vars{name}} = $vars{options}; } elsif ($elem eq "package") { $SVNAutoreleasedeb::XMLconf::PACKAGE = $vars{name}; $SVNAutoreleasedeb::XMLconf::STRUCT{$SVNAutoreleasedeb::XMLconf::SERVER}{$SVNAutoreleasedeb::XMLconf::PACKAGE} = \%vars; } elsif ($elem eq "option") { $SVNAutoreleasedeb::XMLconf::STRUCT{$SVNAutoreleasedeb::XMLconf::SERVER}{$SVNAutoreleasedeb::XMLconf::PACKAGE}{option}{$vars{name}} = $vars{value}; } } sub End { my $p = shift; my $elem = shift; if ($elem eq "server") { $SVNAutoreleasedeb::XMLconf::SERVER = '' } elsif ($elem eq "package") { $SVNAutoreleasedeb::XMLconf::PACKAGE = ''; } } sub Final { return \%SVNAutoreleasedeb::XMLconf::STRUCT; } cvs-autoreleasedeb-0.12/svn-autoreleasedeb.10000644000175000017500000001407010466331602020166 0ustar ruosoruoso.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "SVN-AUTORELEASEDEB 1" .TH SVN-AUTORELEASEDEB 1 "2006-08-04" "perl v5.8.7" "User Contributed Perl Documentation" .SH "NAME" svn\-autoreleasedeb \- Automatic Release of debian packages from .SH "DESCRIPTION" .IX Header "DESCRIPTION" This script generates and uploads the debian package for svn modules managed by svn\-buildpackage. .PP svn-autoreleasedeb will maintain a state file of all the packages you want to be automatically published, and every time you commit the debian/changelog file of your package, changing the debian version to a greater value, it will be published. .PP All the parameters to the script are configured in the conffile. There is no command-line switch. See \&\fIsvn\-autoreleasedeb.conf\fR\|(5) for more information. .SH "USING" .IX Header "USING" There are two ways of using this script: .PP 1) Run as user svn-autoreleasedeb in cron. This is very useful for software houses that want to have the \*(L"nightily build\*(R" version of the software published automatically. In this case, the config file will be \*(L"/etc/svn\-autoreleasedeb.conf\*(R" and it will use /var/lib/svn\-autoreleasedeb/ as scratch dir. .PP .Vb 2 \& NOTE: edit /etc/default/svn\-autoreleasedeb to control this behavior \& NOTE 2: all output will be thrown in /var/log/svn\-autoreleasedeb/run.log .Ve .PP 2) Run as yourself, it will automatizate the work you will have if you have your packages in \s-1SVN\s0. In this case, the config file will be \f(CW$HOME\fR/.svn\-autoreleasedeb/conf and the scratch dir will be \f(CW$HOME\fR/.svn\-autoreleasedeb. svn-autoreleasedeb will not create defaults, you must have the configuration file created before running svn\-autoreleasedeb. See \&\fIsvn\-autoreleasedeb.conf\fR\|(5). .SH "TODO" .IX Header "TODO" .Vb 5 \& \- Use a snapshot of the time of the commit in \& the changelog to checkout the source \& \- Localize the messages. \& \- Work with other than all lowercase in conffile. \& \- Use a better format for conffile. .Ve .SH "_EXIT CODES" .IX Header "_EXIT CODES" .Vb 7 \& _exit codes: \& 0 = Clean _exit \& 1 = Config file not found \& 2 = No packages in config file \& 3 = Couldn't open the state file \& 4 = Couldn't open the state file for writing \& 5 = Couldn't determine architecture .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIsvn\-buildpackage\fR\|(1), \fIsvn\fR\|(1), \fIsvn\-autoreleasedeb.conf\fR\|(5), \fIdupload\fR\|(1) .SH "AUTHOR" .IX Header "AUTHOR" This manual page was written by Daniel Ruoso , for the Debian GNU/Linux system. cvs-autoreleasedeb-0.12/svn-autoreleasedeb.conf0000644000175000017500000000115410464646621020762 0ustar ruosoruoso ]> cvs-autoreleasedeb-0.12/cvs-autoreleasedeb.conf.50000644000175000017500000001600710466331602021105 0ustar ruosoruoso.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "CVS-AUTORELEASEDEB.CONF 5" .TH CVS-AUTORELEASEDEB.CONF 5 "2006-08-04" "perl v5.8.7" "User Contributed Perl Documentation" .SH "NAME" cvs\-autoreleasedeb.conf \- Configuration for cvs\-autoreleasedeb .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& /etc/cvs\-autoreleasedeb.conf \& $HOME/.cvs\-autoreleasedeb/conf .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The cvs-autoreleasedeb configuration file is writed in \s-1XML\s0, because \&\s-1XML\s0 is easy to work with multiple-level data, but it's already in the \s-1TODO\s0 list to use a better format. .PP As a good \s-1XML\s0 file, this config file has the following header. .PP .Vb 18 \& \& \& \& \& \& \& \& \& ]> .Ve .PP Which, in fact, tells the structure of the \s-1XML\s0 file. But in the case you don't know \s-1XML\s0, this header tells that, in the sources, you have servers, which have packages, which have options. A server has the \&\*(L"name\*(R" and the \*(L"option\*(R" properies, a package has \*(L"name\*(R", \*(L"cvsroot\*(R", \&\*(L"prefix\*(R" and \*(L"tag\*(R" properties and an option has \*(L"name\*(R" and \*(L"value\*(R" property. .PP Before explaining how the options affects the script, you must know that in the current version, all the tags and properties \s-1MUST\s0 be lowercase (it's already on the \s-1TODO\s0 list). .SH "CONFIGURATION SECTIONS" .IX Header "CONFIGURATION SECTIONS" .Sh "server" .IX Subsection "server" This is the master section, tells what server to dupload. Actually, the \*(L"name\*(R" property of the server is used as the \*(L"\-\-to\*(R" parameter to dupload. Packages are declared inside servers. Also, the \*(L"options\*(R" property tells aditional parameters to cvs-buildpackage for every package in this server. .Sh "package" .IX Subsection "package" The package itself, the \*(L"name\*(R" property is used as the module name for cvs checkout. The \*(L"cvsroot\*(R" property is passed to cvs as the \&\s-1CVSROOT\s0 and the \*(L"prefix\*(R" is placed before the module name, used if your package is inside some other directory than the cvs root. Optionally, you can inform a tag to checkout the sources from. .Sh "option" .IX Subsection "option" Specify an option to a package. The following options are accepted and increment the following text to the cvs-buildpackage command: binary-source = 1: \*(L"\-b\*(R" .SH "EXAMPLE" .IX Header "EXAMPLE" In the case you still didn't understand the config file, follows an example: .PP .Vb 7 \& \& \& \& \& \& .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIcvs\-buildpackage\fR\|(1), \fIcvs\fR\|(1), \fIcvs\-autoreleasedeb\fR\|(1), \fIdupload\fR\|(1) .SH "AUTHOR" .IX Header "AUTHOR" This manual page was written by Daniel Ruoso , for the Debian GNU/Linux system. cvs-autoreleasedeb-0.12/svn-autoreleasedeb.conf.pod0000644000175000017500000000561610464646621021552 0ustar ruosoruoso=head1 NAME svn-autoreleasedeb.conf - Configuration for svn-autoreleasedeb =head1 SYNOPSIS /etc/svn-autoreleasedeb.conf $HOME/.svn-autoreleasedeb/conf =head1 DESCRIPTION The svn-autoreleasedeb configuration file is writed in XML, because XML is easy to work with multiple-level data, but it's already in the TODO list to use a better format. As a good XML file, this config file has the following header. ]> Which, in fact, tells the structure of the XML file. But in the case you don't know XML, this header tells that, in the sources, you have servers, which have packages, which have options. A server has the "name" and the "option" properies, a package has "name", "svnserver", "prefix" and "tag" properties and an option has "name" and "value" property. Before explaining how the options affects the script, you must know that in the current version, all the tags and properties MUST be lowercase (it's already on the TODO list). =head1 CONFIGURATION SECTIONS =head2 server This is the master section, tells what server to dupload. Actually, the "name" property of the server is used as the "--to" parameter to dupload. Packages are declared inside servers. Also, the "options" property tells aditional parameters to svn-buildpackage for every package in this server. =head2 package The package itself, the "name" property is used as the module name for svn checkout. The "svnserver" property is passed to svn and the "prefix" is placed before the module name, used if your package is inside some other directory than the svn root. You must inform the tag to checkout the sources from. This tag should be used to point where to get the release from. "stable" is a good name for a tag. =head2 option Specify an option to a package. The following options are accepted and increment the following text to the svn-buildpackage command: binary-source = 1: "-b" =head1 EXAMPLE In the case you still didn't understand the config file, follows an example: =head1 SEE ALSO svn-buildpackage(1), svn(1), svn-autoreleasedeb(1), dupload(1) =head1 AUTHOR This manual page was written by Daniel Ruoso , for the Debian GNU/Linux system. =cut cvs-autoreleasedeb-0.12/svn-autoreleasedeb.cron0000644000175000017500000000026010464646621020773 0ustar ruosoruoso# Cron file for svn-autoreleasedeb */5 * * * * svn-autoreleasedeb . /etc/default/svn-autoreleasedeb && /usr/bin/svn-autoreleasedeb 2>&1 >> /var/log/svn-autoreleasedeb/run.log cvs-autoreleasedeb-0.12/svn-autoreleasedeb.defaults0000644000175000017500000000054510464646621021647 0ustar ruosoruoso# This file is used to define the behavior of svn-autoreleasedeb. # svn-autoreleasedeb cron sources this file before running the program. # Use this file to stop it from running in cron. # Just to check if the package is installed test -x /usr/bin/svn-autoreleasedeb || exit 0; # Now the command to run or not. # exit 1 = run # exit 0 = don't run exit 1; cvs-autoreleasedeb-0.12/svn-autoreleasedeb.logrotate0000644000175000017500000000011510464646621022031 0ustar ruosoruoso/var/log/svn-autoreleasedeb/*.log { rotate 12 daily compress missingok } cvs-autoreleasedeb-0.12/svn-autoreleasedeb.conf.50000644000175000017500000001615710466331602021126 0ustar ruosoruoso.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "SVN-AUTORELEASEDEB.CONF 5" .TH SVN-AUTORELEASEDEB.CONF 5 "2006-08-04" "perl v5.8.7" "User Contributed Perl Documentation" .SH "NAME" svn\-autoreleasedeb.conf \- Configuration for svn\-autoreleasedeb .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& /etc/svn\-autoreleasedeb.conf \& $HOME/.svn\-autoreleasedeb/conf .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The svn-autoreleasedeb configuration file is writed in \s-1XML\s0, because \&\s-1XML\s0 is easy to work with multiple-level data, but it's already in the \s-1TODO\s0 list to use a better format. .PP As a good \s-1XML\s0 file, this config file has the following header. .PP .Vb 18 \& \& \& \& \& \& \& \& \& ]> .Ve .PP Which, in fact, tells the structure of the \s-1XML\s0 file. But in the case you don't know \s-1XML\s0, this header tells that, in the sources, you have servers, which have packages, which have options. A server has the \&\*(L"name\*(R" and the \*(L"option\*(R" properies, a package has \*(L"name\*(R", \*(L"svnserver\*(R", \&\*(L"prefix\*(R" and \*(L"tag\*(R" properties and an option has \*(L"name\*(R" and \*(L"value\*(R" property. .PP Before explaining how the options affects the script, you must know that in the current version, all the tags and properties \s-1MUST\s0 be lowercase (it's already on the \s-1TODO\s0 list). .SH "CONFIGURATION SECTIONS" .IX Header "CONFIGURATION SECTIONS" .Sh "server" .IX Subsection "server" This is the master section, tells what server to dupload. Actually, the \*(L"name\*(R" property of the server is used as the \*(L"\-\-to\*(R" parameter to dupload. Packages are declared inside servers. Also, the \*(L"options\*(R" property tells aditional parameters to svn-buildpackage for every package in this server. .Sh "package" .IX Subsection "package" The package itself, the \*(L"name\*(R" property is used as the module name for svn checkout. The \*(L"svnserver\*(R" property is passed to svn and the \&\*(L"prefix\*(R" is placed before the module name, used if your package is inside some other directory than the svn root. You must inform the tag to checkout the sources from. This tag should be used to point where to get the release from. \*(L"stable\*(R" is a good name for a tag. .Sh "option" .IX Subsection "option" Specify an option to a package. The following options are accepted and increment the following text to the svn-buildpackage command: binary-source = 1: \*(L"\-b\*(R" .SH "EXAMPLE" .IX Header "EXAMPLE" In the case you still didn't understand the config file, follows an example: .PP .Vb 7 \& \& \& \& \& \& .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIsvn\-buildpackage\fR\|(1), \fIsvn\fR\|(1), \fIsvn\-autoreleasedeb\fR\|(1), \fIdupload\fR\|(1) .SH "AUTHOR" .IX Header "AUTHOR" This manual page was written by Daniel Ruoso , for the Debian GNU/Linux system.