Changeset 14299


Ignore:
Timestamp:
2007-08-02T11:24:48+12:00 (17 years ago)
Author:
oranfry
Message:

reworked the create_distributions.pl script to read from the new svn repository instead of the old cvs repository, so we can keep doing releases! n.b., the script which creates the changelog is still untouched and will need to be reworked at some stage. 'till then get changelogs from trac.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • for-distributions/trunk/bin/script/create_distributions.pl

    r13517 r14299  
    1010# create_distributions.pl creates the following distribution source directories
    1111# from the gsdl directory pointed to by $GSDLHOME (although it uses the
    12 # main CVS repository to get the latest source code distribution).
     12# main SVN repository to get the latest source code distribution).
    1313
    1414# CDROM - main distribution source: gsdl-x.xx-cdrom
     
    2424#    so ChangeLog contains lots of ancient stuff
    2525
    26 #    creates a copy of everything in cvs repository in $tmpdir
     26#    creates a copy of everything in svn repository in $tmpdir
    2727
    2828#    edits /tmp/gsdl/etc/VERSION, /tmp/gsdl/src/w32server/fnord.cpp
     
    3131
    3232# temporary working directory
    33 my $tmpdir = '/tmp/';
     33
     34my $tmpdir = '/tmp/tmp';
     35#my $tmpdir = '/research/oranfry/greenstone2-releases/2.74/dist/tmp/';
    3436
    3537# docs directory - up-to-date copy of everything to go in the docs directory
     
    4951my $macosxbin = "$ENV{'GSDLHOME'}/bin/darwin";
    5052
    51 my $cvsanon = ':pserver:[email protected]:2402/usr/local/global-cvs/gsdl-src';
    52 
     53#my $cvsanon = ':pserver:[email protected]:2402/usr/local/global-cvs/gsdl-src';
     54my $svnroot = "http://svn.greenstone.org";
    5355
    5456use strict;
     
    6769    print STDERR "   -output_dir            directory to output distributions to\n";
    6870    print STDERR "   -version_num           version number of distribution (x.xx)\n";
    69     print STDERR "   -cvs_tag               cvs tag from which to create distributions\n";
     71    print STDERR "   -svn_tag               svn tag from which to create distributions\n";
    7072    print STDERR "                          - if not set latest versions will be used.\n";
    7173    print STDERR "   -unesco                create unesco style release, i.e. only 4 languages enabled\n";
     
    7476    print STDERR "   -ChangeLogDate         date from which to begin ChangeLog - note that ChangeLog\n";
    7577    print STDERR "                          will always run from date to most recent commits, even if\n";
    76     print STDERR "                          cvs_tag is for a previous revision\n\n";
     78    print STDERR "                          svn_tag is for a previous revision\n\n";
    7779}
    7880
     
    8183my $newtmpdir;
    8284my $version_num;
    83 my $cvs_tag;
     85my $svn_tag;
    8486my $unesco;
    8587my $nochangelog;
     
    9395             'tmpdir/.*/', \$newtmpdir,
    9496             'version_num/\d\.\d\d[a-z]?', \$version_num,
    95              'cvs_tag/.*/', \$cvs_tag,
     97             'svn_tag/.*/', \$svn_tag,
    9698             'unesco', \$unesco,
    9799             'NoChangeLog', \$nochangelog,
     
    107109    mkdir ($output_dir, 0777) unless -d $output_dir;
    108110
    109     if ($cvs_tag !~ /\w/) {
    110     $cvs_tag = $version_num;
    111     $cvs_tag =~ s/\./\_/g;
    112     $cvs_tag = "gsdl-" . $cvs_tag . "-distribution";
     111    if ($svn_tag !~ /\w/) {
     112    $svn_tag = $version_num;
     113    $svn_tag =~ s/\./\_/g;
     114    $svn_tag = "gsdl-" . $svn_tag . "-distribution";
    113115    }
    114116
     
    118120    print STDERR "\nexporting gsdl to $tmpdir\n\n";
    119121    chdir($tmpdir);
    120     `cvs -d $cvsanon export -D "1 second ago" gsdl`;
     122    #`svn export $svnroot/gsdl/trunk gsdl`
     123
     124    #`cvs -d $cvsanon export -D "1 second ago" gsdl`;
    121125    # use something like the following if you want a previous version
     126    my $output;
     127    $output=`svn export $svnroot/gsdl/branches/gsdl-2.74 gsdl`;
     128    print STDERR $output;
    122129    #`cvs -d $cvsanon export -r gsdl-2_70-distribution-branch gsdl`;
    123130   
    124131    # Export gli to $tmpdir/gli
    125     print STDERR "\nexporting gli to " . &util::filename_cat($tmpdir, "gsdl") . "\n\n";
    126     chdir(&util::filename_cat($tmpdir, "gsdl"));
    127     `cvs -d $cvsanon export -D "1 second ago" gli`;
     132   chdir(&util::filename_cat($tmpdir, "gsdl"));
     133   
     134    print STDERR "\nexporting indexers to " . &util::filename_cat($tmpdir, "gsdl") . "\n\n";
     135    $output=`svn export $svnroot/indexers/trunk indexers`; 
     136    print STDERR $output;   
     137
     138    print STDERR "\nexporting gli to " . &util::filename_cat($tmpdir, "gsdl") . "\n\n";
     139    $output=`svn export $svnroot/gli/trunk gli`;
     140    print STDERR $output;
     141    #`cvs -d $cvsanon export -D "1 second ago" gli`;
     142
    128143    # use something like the following if you want a previous version
    129     #`cvs -d $cvsanon export -r gsdl-2_70-distribution-branch gli`;
     144    #`svn export $svnroot/gli/branches/2.74 gli`;
    130145   
    131146    # Compile gli
     
    152167    print STDERR "\ncompiling gli...\n";
    153168    chdir(&util::filename_cat($tmpdir, "gsdl", "gli"));
    154     `./makegli.sh`;
     169    my $output;
     170    $output=`./makegli.sh`;
     171    print STDERR $output;
    155172   
    156173    # JAR up the gli, then delete the class files
     
    158175    `./makejar.sh`;
    159176    &util::rm_r(&util::filename_cat($tmpdir, "gsdl", "gli", "jar"));
    160     &util::rm(&util::filename_cat($tmpdir, "gsdl", "gli", "metadata.zip"));
     177    #metadata.zip is deleted by makegli.sh
     178    #&util::rm(&util::filename_cat($tmpdir, "gsdl", "gli", "metadata.zip"));
     179   
    161180    &util::rm_r(&util::filename_cat($tmpdir, "gsdl", "gli", "classes", "org"));
    162181   
     
    581600    &util::cp_r ($winbin, $winbindir);
    582601
    583     # make sure there aren't any CVS directories laying around
    584     &remove_cvs_dirs ($windir);
     602    # make sure there aren't any .svn directories laying around
     603    &remove_svn_dirs ($windir);
    585604}
    586605
     
    611630    `chmod -R a+x $macosxbindir`;
    612631
    613     # make sure there aren't any CVS directories laying around
    614     &remove_cvs_dirs ($unixdir);
     632    # make sure there aren't any .svn directories laying around
     633    &remove_svn_dirs ($unixdir);
    615634}
    616635
     
    668687    &util::cp_r ($from_perllib, $to_dir) if -d $from_perllib;
    669688
    670     # make sure there aren't any CVS directories laying around
    671     &remove_cvs_dirs ($to_dir);
     689    # make sure there aren't any .svn directories laying around
     690    &remove_svn_dirs ($to_dir);
    672691
    673692    return 1;
     
    703722        if ($line =~ /\w/) {
    704723        ($tag, $date) = $line =~ /^(\S+)\t(.*)$/;
    705         $changelogdate = $date unless ($tag eq $cvs_tag);
     724        $changelogdate = $date unless ($tag eq $svn_tag);
    706725        }
    707726        $file .= $line;
     
    710729    }
    711730
    712     if ((!defined $tag) || ($tag ne $cvs_tag)) {
     731    if ((!defined $tag) || ($tag ne $svn_tag)) {
    713732    open (DATES, ">$datefile") || die;
    714733    print DATES $file if defined $file;
    715     print DATES "$cvs_tag\t" . `date`;
     734    print DATES "$svn_tag\t" . `date`;
    716735    close DATES;
    717736    }
     
    725744
    726745# simply recurses directory structure beginning at $dir
    727 # and deletes any CVS administrative directories it comes
     746# and deletes any .svn administrative directories it comes
    728747# across
    729 sub remove_cvs_dirs {
     748sub remove_svn_dirs {
    730749    my ($dir) = @_;
    731750
     
    740759    my $fullpath = &util::filename_cat ($dir, $file);
    741760    if (-d $fullpath) {
    742         if ($file eq "CVS") {
     761        if ($file eq ".svn") {
    743762        &util::rm_r ($fullpath);
    744763        } else {
    745         &remove_cvs_dirs ($fullpath);
     764        &remove_svn_dirs ($fullpath);
    746765        }
    747766    }
     
    763782    }
    764783    if ($mode != 1) {
    765     my $to = $zip_to . ".tgz";
    766     unlink ($to) if -e $to;
    767     print STDERR "tarring and gzipping $to\n";
    768     print STDERR "tar cvzf $to $zip_from\n";
    769     system ("tar cvzf $to $zip_from");
     784    my $to2 = $zip_to . ".tgz";
     785    unlink ($to2) if -e $to2;
     786    print STDERR "tarring and gzipping $to2\n";
     787    print STDERR "tar cvzf $to2 $zip_from\n";
     788    system ("tar cvzf $to2 $zip_from");
    770789    }
    771790}
     
    779798    if ($line =~ s/(gsdl version: )x\.xx/$1$version_num/) {
    780799        $found ++;
    781     } elsif ($line =~ s/(cvs tag: )gsdl-x_xx-distribution/$1$cvs_tag/) {
     800    } elsif ($line =~ s/(svn tag: )gsdl-x_xx-distribution/$1$svn_tag/) {
    782801        $found ++;
    783802    }
     
    798817    $found = 0; $line = ""; $file = "";
    799818    while (defined ($line = <GSDLCONF>)) {
     819
    800820    if ($line =~ s/(\#define GSDL_VERSION \")x\.xx(\")/$1$version_num$2/) {
    801821        $found ++;
     
    804824    }
    805825    close GSDLCONF;
    806     if (!$found) {
    807     die "error while editing $gsdlconf_file\n";
     826
     827    if ( !$found ) {
     828        die "error while editing $gsdlconf_file\n";
    808829    }
    809830   
Note: See TracChangeset for help on using the changeset viewer.