Commit e31f042f authored by unknown's avatar unknown
Browse files

Do-rpm:

  Small fix to handle the src rpm file correctly (contains '0', release number in spec file)


Build-tools/Do-rpm:
  Small fix to handle the src rpm file correctly (contains '0', release number in spec file)
parent 429f9d05
Loading
Loading
Loading
Loading
+38 −29
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ use Getopt::Long;
Getopt::Long::Configure ("bundling");
use Sys::Hostname;

$opt_nobuild = undef;
$opt_cc= undef;
$opt_cflags= undef;
$opt_clean= undef;
@@ -48,6 +49,7 @@ GetOptions(
	"help|h",
	"log|l:s",
	"mail|m=s",
        "nobuild",
	"verbose|v",
) || &print_help;

@@ -79,7 +81,10 @@ foreach (@spec)
	if (m/^%define\s*mysql_version\s*(.*)/)
	{
		$VERSION= $1;
                $VERSION_SRPM=$VERSION;
		($MAJOR, $MINOR, $RELEASE)= split(/\./,$VERSION);
                $VERSION_SRPM= $MAJOR . '.' . $MINOR . '.' . $RELEASE; 
                $VERSION_SRPM =~ s/\-\w+$//;
		($RELEASE, $SUFFIX)= split(/\-/,$RELEASE);
		$SUFFIX= "-" . $SUFFIX if ($SUFFIX);
	}
@@ -143,6 +148,8 @@ chomp($SRCRPMDIR= `$RPM --eval "%{_srcrpmdir}" 2> /dev/null`);

$SOURCEFILE= glob "mysql*-$VERSION.tar.gz";

unless($opt_nobuild) {

  &logger("Starting RPM build of MySQL-$VERSION on $HOST");

  foreach $file ($SOURCEFILE, $SPECFILE)
@@ -184,19 +191,21 @@ $command.= " $SPECDIR/";
  $command.= basename($SPECFILE);
  &logger("Building RPM.");
  &run_command($command, "Error while building the RPMs!"); 
}

#
# Move the resulting RPMs into the pwd
#
$command= "mv";
$command.= " -v " if ($opt_verbose);
$command.= " $SRCRPMDIR/MySQL*$VERSION*.src.rpm $PWD";
$command.= " $SRCRPMDIR/MySQL*$VERSION_SRPM*.src.rpm $PWD";
&logger("Moving source RPM to current dir.");
&run_command($command, "Error moving source RPM!");

$command= "mv";
$command.= " -v " if ($opt_verbose);
$command.= " $RPMDIR/$RPMARCH/MySQL*$VERSION*.$RPMARCH.rpm $PWD";
# $command.= " $RPMDIR/$RPMARCH/MySQL*$VERSION*.$RPMARCH.rpm $PWD";
$command.= " $RPMDIR/$RPMARCH/MySQL*$VERSION_SRPM*.$RPMARCH.rpm $PWD";
&logger("Moving binary RPMs to current dir.");
&run_command($command, "Error moving binary RPMs!");