Changeset 14299 for for-distributions
- Timestamp:
- 2007-08-02T11:24:48+12:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
for-distributions/trunk/bin/script/create_distributions.pl
r13517 r14299 10 10 # create_distributions.pl creates the following distribution source directories 11 11 # from the gsdl directory pointed to by $GSDLHOME (although it uses the 12 # main CVSrepository to get the latest source code distribution).12 # main SVN repository to get the latest source code distribution). 13 13 14 14 # CDROM - main distribution source: gsdl-x.xx-cdrom … … 24 24 # so ChangeLog contains lots of ancient stuff 25 25 26 # creates a copy of everything in cvsrepository in $tmpdir26 # creates a copy of everything in svn repository in $tmpdir 27 27 28 28 # edits /tmp/gsdl/etc/VERSION, /tmp/gsdl/src/w32server/fnord.cpp … … 31 31 32 32 # temporary working directory 33 my $tmpdir = '/tmp/'; 33 34 my $tmpdir = '/tmp/tmp'; 35 #my $tmpdir = '/research/oranfry/greenstone2-releases/2.74/dist/tmp/'; 34 36 35 37 # docs directory - up-to-date copy of everything to go in the docs directory … … 49 51 my $macosxbin = "$ENV{'GSDLHOME'}/bin/darwin"; 50 52 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'; 54 my $svnroot = "http://svn.greenstone.org"; 53 55 54 56 use strict; … … 67 69 print STDERR " -output_dir directory to output distributions to\n"; 68 70 print STDERR " -version_num version number of distribution (x.xx)\n"; 69 print STDERR " - cvs_tag cvstag from which to create distributions\n";71 print STDERR " -svn_tag svn tag from which to create distributions\n"; 70 72 print STDERR " - if not set latest versions will be used.\n"; 71 73 print STDERR " -unesco create unesco style release, i.e. only 4 languages enabled\n"; … … 74 76 print STDERR " -ChangeLogDate date from which to begin ChangeLog - note that ChangeLog\n"; 75 77 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"; 77 79 } 78 80 … … 81 83 my $newtmpdir; 82 84 my $version_num; 83 my $ cvs_tag;85 my $svn_tag; 84 86 my $unesco; 85 87 my $nochangelog; … … 93 95 'tmpdir/.*/', \$newtmpdir, 94 96 'version_num/\d\.\d\d[a-z]?', \$version_num, 95 ' cvs_tag/.*/', \$cvs_tag,97 'svn_tag/.*/', \$svn_tag, 96 98 'unesco', \$unesco, 97 99 'NoChangeLog', \$nochangelog, … … 107 109 mkdir ($output_dir, 0777) unless -d $output_dir; 108 110 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"; 113 115 } 114 116 … … 118 120 print STDERR "\nexporting gsdl to $tmpdir\n\n"; 119 121 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`; 121 125 # 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; 122 129 #`cvs -d $cvsanon export -r gsdl-2_70-distribution-branch gsdl`; 123 130 124 131 # 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 128 143 # use something like the following if you want a previous version 129 #` cvs -d $cvsanon export -r gsdl-2_70-distribution-branchgli`;144 #`svn export $svnroot/gli/branches/2.74 gli`; 130 145 131 146 # Compile gli … … 152 167 print STDERR "\ncompiling gli...\n"; 153 168 chdir(&util::filename_cat($tmpdir, "gsdl", "gli")); 154 `./makegli.sh`; 169 my $output; 170 $output=`./makegli.sh`; 171 print STDERR $output; 155 172 156 173 # JAR up the gli, then delete the class files … … 158 175 `./makejar.sh`; 159 176 &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 161 180 &util::rm_r(&util::filename_cat($tmpdir, "gsdl", "gli", "classes", "org")); 162 181 … … 581 600 &util::cp_r ($winbin, $winbindir); 582 601 583 # make sure there aren't any CVSdirectories laying around584 &remove_ cvs_dirs ($windir);602 # make sure there aren't any .svn directories laying around 603 &remove_svn_dirs ($windir); 585 604 } 586 605 … … 611 630 `chmod -R a+x $macosxbindir`; 612 631 613 # make sure there aren't any CVSdirectories laying around614 &remove_ cvs_dirs ($unixdir);632 # make sure there aren't any .svn directories laying around 633 &remove_svn_dirs ($unixdir); 615 634 } 616 635 … … 668 687 &util::cp_r ($from_perllib, $to_dir) if -d $from_perllib; 669 688 670 # make sure there aren't any CVSdirectories laying around671 &remove_ cvs_dirs ($to_dir);689 # make sure there aren't any .svn directories laying around 690 &remove_svn_dirs ($to_dir); 672 691 673 692 return 1; … … 703 722 if ($line =~ /\w/) { 704 723 ($tag, $date) = $line =~ /^(\S+)\t(.*)$/; 705 $changelogdate = $date unless ($tag eq $ cvs_tag);724 $changelogdate = $date unless ($tag eq $svn_tag); 706 725 } 707 726 $file .= $line; … … 710 729 } 711 730 712 if ((!defined $tag) || ($tag ne $ cvs_tag)) {731 if ((!defined $tag) || ($tag ne $svn_tag)) { 713 732 open (DATES, ">$datefile") || die; 714 733 print DATES $file if defined $file; 715 print DATES "$ cvs_tag\t" . `date`;734 print DATES "$svn_tag\t" . `date`; 716 735 close DATES; 717 736 } … … 725 744 726 745 # simply recurses directory structure beginning at $dir 727 # and deletes any CVSadministrative directories it comes746 # and deletes any .svn administrative directories it comes 728 747 # across 729 sub remove_ cvs_dirs {748 sub remove_svn_dirs { 730 749 my ($dir) = @_; 731 750 … … 740 759 my $fullpath = &util::filename_cat ($dir, $file); 741 760 if (-d $fullpath) { 742 if ($file eq " CVS") {761 if ($file eq ".svn") { 743 762 &util::rm_r ($fullpath); 744 763 } else { 745 &remove_ cvs_dirs ($fullpath);764 &remove_svn_dirs ($fullpath); 746 765 } 747 766 } … … 763 782 } 764 783 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"); 770 789 } 771 790 } … … 779 798 if ($line =~ s/(gsdl version: )x\.xx/$1$version_num/) { 780 799 $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/) { 782 801 $found ++; 783 802 } … … 798 817 $found = 0; $line = ""; $file = ""; 799 818 while (defined ($line = <GSDLCONF>)) { 819 800 820 if ($line =~ s/(\#define GSDL_VERSION \")x\.xx(\")/$1$version_num$2/) { 801 821 $found ++; … … 804 824 } 805 825 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"; 808 829 } 809 830
Note:
See TracChangeset
for help on using the changeset viewer.