ooo-build r13748 - in trunk: . patches/dev300 scratch/packaging
- From: pmladek svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r13748 - in trunk: . patches/dev300 scratch/packaging
- Date: Mon, 1 Sep 2008 19:20:01 +0000 (UTC)
Author: pmladek
Date: Mon Sep 1 19:20:01 2008
New Revision: 13748
URL: http://svn.gnome.org/viewvc/ooo-build?rev=13748&view=rev
Log:
2008-09-01 Petr Mladek <pmladek suse cz>
* patches/dev300/redirect-extensions.diff:
* patches/dev300/redirect-extensions-m30.diff:
* patches/dev300/apply: udpate for ooo300-m4
* scratch/packaging/ooo-build-release:
* scratch/packaging/ooo-build-package: check free space in any
directory; allow to download the built packages; allow to skip
already finished build or upload; some more fixes
* scratch/packaging/ooo-abuild-all: initial support the even more
split build
Added:
trunk/patches/dev300/redirect-extensions-m30.diff
- copied unchanged from r13746, /trunk/patches/dev300/redirect-extensions.diff
Modified:
trunk/ChangeLog
trunk/patches/dev300/apply
trunk/patches/dev300/redirect-extensions.diff
trunk/scratch/packaging/ooo-abuild-all
trunk/scratch/packaging/ooo-build-package
trunk/scratch/packaging/ooo-build-release
Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply (original)
+++ trunk/patches/dev300/apply Mon Sep 1 19:20:01 2008
@@ -346,14 +346,17 @@
# add mozilla certificate dir detection to soffice
soffice-detect-mozilla-certificates.diff
+[ FixesNotForUpstream <= dev300-m30 <= ooo300-m3 ]
+redirect-extensions-m30.diff
+[ FixesNotForUpstream > dev300-m30 > ooo300-m3 ]
+# re-direct to plugins via http://extensions.go-oo.org/
+redirect-extensions.diff
+
[ FixesNotForUpstream ]
#upload a new libwpd + fix an exception with condensed paragraphs
libwpd.diff, fridrich
writerperfect-nocondensedparagraphs.diff, fridrich
-# re-direct to plugins via http://extensions.go-oo.org/
-redirect-extensions.diff
-
# no bogus license question when registering these extensions
#solenv-no-extension-license.diff
reportdesigner-no-license.diff
Modified: trunk/patches/dev300/redirect-extensions.diff
==============================================================================
--- trunk/patches/dev300/redirect-extensions.diff (original)
+++ trunk/patches/dev300/redirect-extensions.diff Mon Sep 1 19:20:01 2008
@@ -58,8 +58,8 @@
xSMGR->createInstance( DEFINE_CONST_UNICODE("com.sun.star.system.SystemShellExecute" ) ),
uno::UNO_QUERY_THROW );
if ( xSystemShell.is() )
-- xSystemShell->execute( DEFINE_CONST_UNICODE("http://extensions.services.openoffice.org/taxonomy/term/88"), ::rtl::OUString(), css::system::SystemShellExecuteFlags::DEFAULTS );
-+ xSystemShell->execute( DEFINE_CONST_UNICODE("http://extensions.go-oo.org/taxonomy/term/88"), ::rtl::OUString(), css::system::SystemShellExecuteFlags::DEFAULTS );
+- xSystemShell->execute( DEFINE_CONST_UNICODE("http://extensions.services.openoffice.org/dictionary?cid=926385"), ::rtl::OUString(), css::system::SystemShellExecuteFlags::DEFAULTS );
++ xSystemShell->execute( DEFINE_CONST_UNICODE("http://extensions.go-oo.org/dictionary?cid=926385"), ::rtl::OUString(), css::system::SystemShellExecuteFlags::DEFAULTS );
}
catch( const ::com::sun::star::uno::Exception& )
{
@@ -75,8 +75,8 @@
aLinguOptionsCLB.SetDoubleClickHdl(LINK(this, SvxLinguTabPage, BoxDoubleClickHdl_Impl));
aMoreDictsLink.SetURL( String(
-- RTL_CONSTASCII_STRINGPARAM( "http://extensions.services.openoffice.org/taxonomy/term/88" ) ) );
-+ RTL_CONSTASCII_STRINGPARAM( "http://extensions.go-oo.org/taxonomy/term/88" ) ) );
+- RTL_CONSTASCII_STRINGPARAM( "http://extensions.services.openoffice.org/dictionary?cid=926386" ) ) );
++ RTL_CONSTASCII_STRINGPARAM( "http://extensions.go-oo.org/dictionary?cid=926386" ) ) );
aMoreDictsLink.SetClickHdl( LINK( this, SvxLinguTabPage, OpenURLHdl_Impl ) );
xProp = uno::Reference< XPropertySet >( SvxGetLinguPropertySet(), UNO_QUERY );
@@ -84,8 +84,8 @@
aPrioDownPB.Enable( FALSE );
aMoreDictsLink.SetURL( String(
-- RTL_CONSTASCII_STRINGPARAM( "http://extensions.services.openoffice.org/taxonomy/term/88" ) ) );
-+ RTL_CONSTASCII_STRINGPARAM( "http://extensions.go-oo.org/taxonomy/term/88" ) ) );
+- RTL_CONSTASCII_STRINGPARAM( "http://extensions.services.openoffice.org/dictionary?cid=926386" ) ) );
++ RTL_CONSTASCII_STRINGPARAM( "http://extensions.go-oo.org/dictionary?cid=926386" ) ) );
aMoreDictsLink.SetClickHdl( LINK( this, SvxEditModulesDlg, OpenURLHdl_Impl ) );
//
@@ -100,8 +100,8 @@
pImpl->aTitle = GetText();
aMoreTemplatesLink.SetURL( String(
-- RTL_CONSTASCII_STRINGPARAM( "http://extensions.services.openoffice.org/taxonomy/term/36" ) ) );
-+ RTL_CONSTASCII_STRINGPARAM( "http://extensions.go-oo.org/taxonomy/term/36" ) ) );
+- RTL_CONSTASCII_STRINGPARAM( "http://extensions.services.openoffice.org/templates?cid=923508" ) ) );
++ RTL_CONSTASCII_STRINGPARAM( "http://extensions.go-oo.org/templates?cid=923508" ) ) );
aMoreTemplatesLink.SetClickHdl( LINK( this, SvtDocumentTemplateDialog, OpenLinkHdl_Impl ) );
aManageBtn.SetClickHdl( LINK( this, SvtDocumentTemplateDialog, OrganizerHdl_Impl ) );
@@ -113,20 +113,20 @@
diff -u -p -u -r1.88.8.3 openoffice.lst
--- instsetoo_native/util/openoffice.lst 31 Jul 2008 19:46:20 -0000 1.88.8.3
+++ instsetoo_native/util/openoffice.lst 13 Aug 2008 16:25:30 -0000
-@@ -78,9 +78,9 @@ OpenOffice
+@@ -81,9 +81,9 @@ OpenOffice
DOWNLOADBITMAP ooobitmap.bmp
DOWNLOADSETUPICO ooosetup.ico
RELATIVE_PATHES_IN_DDF 1
- STARTCENTER_ADDFEATURE_URL http://extensions.services.openoffice.org/getmore?cid=920794
- STARTCENTER_INFO_URL http://www.openoffice.org
-- STARTCENTER_TEMPLREP_URL http://extensions.services.openoffice.org/taxonomy/term/36
+- STARTCENTER_TEMPLREP_URL http://extensions.services.openoffice.org/templates?cid=926383
+ STARTCENTER_ADDFEATURE_URL http://extensions.go-oo.org/getmore?cid=920794
+ STARTCENTER_INFO_URL http://www.go-oo.org
-+ STARTCENTER_TEMPLREP_URL http://extensions.go-oo.org/taxonomy/term/36
++ STARTCENTER_TEMPLREP_URL http://extensions.go-oo.org/templates?cid=926383
REGISTRATION_PRODUCT OpenOffice.org
REGISTRATION_CID 926117
}
-@@ -141,9 +141,9 @@ OpenOffice_wJRE
+@@ -145,9 +145,9 @@ OpenOffice_wJRE
DOWNLOADBITMAP ooobitmap.bmp
DOWNLOADSETUPICO ooosetup.ico
RELATIVE_PATHES_IN_DDF 1
@@ -139,7 +139,7 @@
REGISTRATION_PRODUCT OpenOffice.org
REGISTRATION_CID 926117
}
-@@ -210,9 +210,9 @@ OpenOffice_Dev
+@@ -216,9 +216,9 @@ OpenOffice_Dev
DOWNLOADSETUPICO ooosetup.ico
LOCALUSERDIR $ORIGIN/..
RELATIVE_PATHES_IN_DDF 1
@@ -152,7 +152,7 @@
REGISTRATION_PRODUCT OpenOffice.org
REGISTRATION_CID 926117
}
-@@ -251,9 +251,9 @@ URE
+@@ -257,9 +257,9 @@ URE
DONTUSESTARTMENUFOLDER 1
SERVICESPROJEKT 1
RELATIVE_PATHES_IN_DDF 1
@@ -165,7 +165,7 @@
ADD_INCLUDE_FILES cliureversion.mk,clioootypesversion.mk
}
active 1
-@@ -294,9 +294,9 @@ OpenOffice_SDK
+@@ -300,9 +300,9 @@ OpenOffice_SDK
DOWNLOADSETUPICO ooosetup.ico
DONTUSESTARTMENUFOLDER 1
RELATIVE_PATHES_IN_DDF 1
@@ -178,7 +178,7 @@
}
active 1
compression 5
-@@ -356,9 +356,9 @@ BrOffice
+@@ -363,9 +363,9 @@ BrOffice
DOWNLOADBITMAP brobitmap.bmp
DOWNLOADSETUPICO ooosetup.ico
RELATIVE_PATHES_IN_DDF 1
@@ -191,7 +191,7 @@
REGISTRATION_PRODUCT OpenOffice.org
REGISTRATION_CID 926117
}
-@@ -423,9 +423,9 @@ BrOffice_wJRE
+@@ -431,9 +431,9 @@ BrOffice_wJRE
DOWNLOADBITMAP brobitmap.bmp
DOWNLOADSETUPICO ooosetup.ico
RELATIVE_PATHES_IN_DDF 1
@@ -204,7 +204,7 @@
REGISTRATION_PRODUCT OpenOffice.org
REGISTRATION_CID 926117
}
-@@ -495,9 +495,9 @@ BrOffice_Dev
+@@ -505,9 +505,9 @@ BrOffice_Dev
DOWNLOADSETUPICO ooosetup.ico
LOCALUSERDIR $ORIGIN/..
RELATIVE_PATHES_IN_DDF 1
Modified: trunk/scratch/packaging/ooo-abuild-all
==============================================================================
--- trunk/scratch/packaging/ooo-abuild-all (original)
+++ trunk/scratch/packaging/ooo-abuild-all Mon Sep 1 19:20:01 2008
@@ -23,36 +23,75 @@
exit 1;
fi
+if test -f OpenOffice_org-bootstrap.spec ; then
+ bootstrap_spec=OpenOffice_org-bootstrap.spec
+ bootstrap_devel_packages=OpenOffice_org-bootstrap
+else
+ bootstrap_spec=OpenOffice_org.spec
+ bootstrap_devel_packages=OpenOffice_org-devel
+fi
+
# typical common
-common_options="$@"
+common_options="$@
+ --get-packages=/prace/RPMS"
-devel_options="$common_options
- --keep-remote-tempdir
- --no-final-message"
+# bootstrap settings
+bootstrap_options="$common_options
+ --keep-remote-tempdir"
+
+if test -f OpenOffice_org-i18n.spec -o \
+ -f OpenOffice_org-i18n-group1.spec -o \
+ -f OpenOffice_org-l10n-group1.spec -o \
+ -f OpenOffice_org-bootstrap.spec ; then
+ bootstrap_options="$bootstrap_options
+ --no-final-message"
+fi
-devel_status_file=`ooo-build-package $devel_options --get-status-file OpenOffice_org.spec | tail -n 1`
+bootstrap_status_file=`ooo-build-package $bootstrap_options --get-status-file $bootstrap_spec | tail -n 1`
-if test -z "$devel_status_file" ; then
+if test -z "$bootstrap_status_file" ; then
echo "Error: Was not able to get status file for devel build"
exit 1;
fi
-other_options="$common_options
- --keep-remote-tempdir
- --prefer-rpms-from-build=$devel_status_file
- --re-use-remote-sources-from-build=$devel_status_file
- --do-not-update-remote-sources"
-
-ooo-build-package $devel_options OpenOffice_org.spec || exit 1;
-
-for other in icon-themes i18n i18n-group1 i18n-group2 ; do
- if test -f OpenOffice_org-$other.spec ; then
- ooo-build-package $other_options OpenOffice_org-$other.spec || exit 1;
- fi
-done
+other_options="--keep-remote-tempdir
+ --prefer-rpms-from-build=$bootstrap_status_file
+ --re-use-remote-prefer-rpms-from-build=$bootstrap_status_file
+ --re-use-remote-sources-from-build=$bootstrap_status_file
+ --do-not-update-remote-sources
+ --keep-remote-tempdir"
+
+default_options="$common_options $other_options"
+
+l10n_group1_options="$common_options $other_options
+ --devel-packages=OpenOffice_org-l10n-en-US"
+
+ooo-build-package $bootstrap_options --devel-packages="$bootstrap_devel_packages" $bootstrap_spec || exit 1;
+
+if test -f OpenOffice_org-ure.spec ; then ooo-build-package $default_options --no-final-message --devel-packages="OpenOffice_org-ure,OpenOffice_org-ure-devel" OpenOffice_org-ure.spec || exit 1; fi
+if test -f OpenOffice_org-artwork.spec ; then ooo-build-package $default_options --no-final-message --devel-packages="OpenOffice_org-artwork-devel" OpenOffice_org-artwork.spec || exit 1; fi
+if test -f OpenOffice_org-libs-extern.spec ; then ooo-build-package $default_options --no-final-message --devel-packages="OpenOffice_org-libs-extern,OpenOffice_org-libs-extern-devel" OpenOffice_org-libs-extern.spec || exit 1; fi
+if test -f OpenOffice_org-libs-gui.spec ; then ooo-build-package $default_options --no-final-message --devel-packages="OpenOffice_org-libs-gui,OpenOffice_org-libs-gui-devel" OpenOffice_org-libs-gui.spec || exit 1; fi
+if test -f OpenOffice_org-libs-core.spec ; then ooo-build-package $default_options --no-final-message --devel-packages="OpenOffice_org-libs-core,OpenOffice_org-libs-core-devel" OpenOffice_org-libs-core.spec || exit 1; fi
+if test -f OpenOffice_org-components.spec ; then ooo-build-package $default_options --no-final-message --devel-packages="OpenOffice_org-components,OpenOffice_org-components-devel" OpenOffice_org-components.spec || exit 1; fi
+if test -f OpenOffice_org-l10n.spec ; then ooo-build-package $default_options --no-final-message --devel-packages="OpenOffice_org-l10n,OpenOffice_org-l10n-devel" OpenOffice_org-l10n.spec || exit 1; fi
+if test -f OpenOffice_org-impress.spec ; then ooo-build-package $default_options --no-final-message --devel-packages="OpenOffice_org-impress,OpenOffice_org-impress-devel" OpenOffice_org-impress.spec || exit 1; fi
+if test -f OpenOffice_org-writer.spec ; then ooo-build-package $default_options --no-final-message --devel-packages="OpenOffice_org-writer,OpenOffice_org-writer-devel" OpenOffice_org-writer.spec || exit 1; fi
+if test -f OpenOffice_org-calc.spec ; then ooo-build-package $default_options --no-final-message --devel-packages="OpenOffice_org-calc,OpenOffice_org-calc-devel" OpenOffice_org-calc.spec || exit 1; fi
+if test -f OpenOffice_org-base.spec ; then ooo-build-package $default_options --no-final-message --devel-packages="OpenOffice_org-base,OpenOffice_org-base-devel" OpenOffice_org-base.spec || exit 1; fi
+if test -f OpenOffice_org-filters.spec ; then ooo-build-package $default_options --no-final-message --devel-packages="OpenOffice_org-filters,OpenOffice_org-filters-devel" OpenOffice_org-filters.spec || exit 1; fi
+
+if test -f OpenOffice_org-icon-themes.spec ; then ooo-build-package $default_options --devel-packages="OpenOffice_org-icon-themes" OpenOffice_org-icon-themes.spec || exit 1; fi
+if test -f OpenOffice_org-i18n.spec ; then ooo-build-package $default_options OpenOffice_org-i18n.spec || exit 1; fi
+if test -f OpenOffice_org-i18n-group1.spec ; then ooo-build-package $default_options OpenOffice_org-i18n-group1.spec || exit 1; fi
+if test -f OpenOffice_org-i18n-group2.spec ; then ooo-build-package $default_options OpenOffice_org-i18n-group2.spec || exit 1; fi
+if test -f OpenOffice_org-l10n-group1.spec ; then ooo-build-package $l10n_group1_options OpenOffice_org-l10n-group1.spec || exit 1; fi
+if test -f OpenOffice_org-l10n-group2.spec ; then ooo-build-package $default_options OpenOffice_org-l10n-group2.spec || exit 1; fi
+
+if test -f OpenOffice_org-bootstrap.spec ; then ooo-build-package $default_options --devel-packages="OpenOffice_org" OpenOffice_org.spec || exit 1; fi
remove_options="$common_options
- --remove-remote-tempdir=$devel_status_file"
+ --remove-remote-tempdir=$bootstrap_status_file"
ooo-build-package $remove_options || exit 1;
Modified: trunk/scratch/packaging/ooo-build-package
==============================================================================
--- trunk/scratch/packaging/ooo-build-package (original)
+++ trunk/scratch/packaging/ooo-build-package Mon Sep 1 19:20:01 2008
@@ -7,7 +7,7 @@
use File::Copy;
use File::Temp qw/ tempfile tempdir /;
-my $critical_free_space_limit = 50000000; # in Bytes, for /abuild
+my $critical_free_space_limit_abuild = 50000000; # in Bytes
sub show_error($)
{
@@ -122,12 +122,37 @@
{
my ($p_options) = @_;
- if (defined $p_options->{'local_prefer_rpms'} &&
- ! defined $p_options->{'do_not_update_remote_sources'}) {
+ if (defined $p_options->{'local_prefer_rpms'}) {
sync_sources ("$p_options->{'local_prefer_rpms'}/*",
"$p_options->{'host'}:$p_options->{'remote_prefer_rpms'}");
}
-
+
+ return;
+}
+
+sub get_packages($)
+{
+ my ($p_options) = @_;
+
+ if (defined $p_options->{'get_packages_path'}) {
+ if (defined $p_options->{'packages'}) {
+ system ("mkdir -p $p_options->{'get_packages_path'})") &&
+ show_error("Can't create direcotry $p_options->{'get_packages_path'} to get packages");
+ for my $pack (split (",", $p_options->{'packages'})) {
+ system ("scp $p_options->{'host'}:$p_options->{'remote_rpms_path'}/$pack-*.rpm $p_options->{'get_packages_path'}");
+ }
+ }
+ if (defined $p_options->{'devel_packages'}) {
+ system ("mkdir -p $p_options->{'get_packages_path'}/devel") &&
+ show_error("Can't create direcotry $p_options->{'get_packages_path'}/devel to get devel packages");
+ for my $pack (split (",", $p_options->{'devel_packages'})) {
+ system ("scp $p_options->{'host'}:$p_options->{'remote_rpms_path'}/$pack-*.rpm $p_options->{'get_packages_path'}/devel");
+ }
+ }
+ }
+ # successfully finished
+ $p_options->{'downloaded'}="yes";
+ save_status($p_options, 1);
return;
}
@@ -194,6 +219,10 @@
# system ("ssh -t $p_options->{'host'} sudo /bin/sh -c \\\". /work/src/bin/.profile\\\; echo \\\\\$PATH\\\"");
system ("ssh -t $p_options->{'host'} $linux32 sudo /bin/sh -c \\\". /work/src/bin/.profile\\\; export BUILD_ROOT=$buildroot\\\; export BUILD_DIST=$build_dist\\\; abuild $abuild_options\\\"") &&
show_error("Error: abuild failed at $p_options->{'host'}:$p_options->{'buildroot'}\n");
+ # build successfully finished
+ $p_options->{'built'}="yes";
+ $p_options->{'downloaded'}="no";
+ save_status($p_options, 1);
}
sub find_specfile_in_current_dir()
@@ -287,88 +316,94 @@
if ($p_options->{'local_prefer_rpms'}) {
(-d $p_options->{'local_prefer_rpms'}) || show_error("Error: The path $p_options->{'local_prefer_rpms'} defined by --prefer-rpms is not a directory\n");
- unless (defined $p_options->{'remote_prefer_rpms'}) {
- $p_options->{'remote_prefer_rpms'} = mktemp_remote("$p_options->{'host'}", "$p_options->{'remote_tempdir'}/prefer-rpms-XXXX", "-d");
- }
+ }
+ # FIXME: we will always create the remote_prefer_rpms directory because we want to share it for the split OOo build
+ unless (defined $p_options->{'remote_prefer_rpms'}) {
+ $p_options->{'remote_prefer_rpms'} = mktemp_remote("$p_options->{'host'}", "$p_options->{'remote_tempdir'}/prefer-rpms-XXXX", "-d");
}
return;
}
-sub check_free_space_in_abuild($)
+sub check_free_space($$$)
{
- my ($host) = @_;
-
- # FIXME: this is currently use only to check /abuild and
- # we expect that it is mounted as an extra partition
+ my ($host, $dir, $critical_limit) = @_;
+
my $free_space;
- my $pid = open (DF, "ssh $host df |");
+ my $pid = open (DF, "ssh $host df $dir |");
show_error("Can't start \"df\" on $host: $!\n") unless (defined $pid);
while (my $line = <DF>) {
chomp $line;
- if ($line =~ m/\S+\s+\S+\s+\S+\s+(\S+)\s+\S+\s+\/abuild/) {
+ if ($line =~ m/\S+\s+\S+\s+\S+\s+(\S+)\s+\S+\s+\/.*/) {
$free_space = $1;
}
}
close (DF);
if (defined $free_space) {
- if ($free_space < $critical_free_space_limit) {
+ if ($free_space < $critical_limit) {
my $free_space_mb = int($free_space/1000000);
- show_warning("Warning: There is only ${free_space_mb}MB free space left on $host:/abuild\n");
+ show_warning("Warning: There is only ${free_space_mb}MB free space left on $host:$dir\n");
}
} else {
- show_warning("Warning: Failed to check free space on $host:/abuild\n");
+ show_warning("Warning: Failed to check free space on $host:$dir\n");
}
return;
}
-sub set_buildroot_names($)
+sub set_packdir_names($)
{
my ($p_options) = @_;
-
- if (defined $p_options->{'buildroot'}) {
-
- $p_options->{'buildroot_name'} = $p_options->{'buildroot'};
- $p_options->{'buildroot_name'} =~ s/^.*\///g;
- } else {
+ # define some useful prefixes and suffixes
+ my $packdir_basename = $p_options->{'package_name'};
+ my $buildroot_suffix = "";
- my $buildroot_basename = $p_options->{'package_name'};
- my $buildroot_suffix = "";
-
- if ($buildroot_basename =~ /^OpenOffice_org(-.*)?/) {
- $buildroot_basename = "ooo";
- # FIXME: an ugly hack to differ the split and non-split builds
- if ($1) {
+ if ($packdir_basename =~ /^OpenOffice_org(-.*)?/) {
+ $packdir_basename = "ooo";
+ # FIXME: an ugly hack to differ the split and non-split builds
+ if ($1) {
$buildroot_suffix = "$1";
- } elsif (-e "$p_options->{'package_source_path'}/OpenOffice_org-i18n.spec") {
- $buildroot_suffix = "-devel";
- } elsif (-e "$p_options->{'package_source_path'}/OpenOffice_org-i18n-group1.spec") {
- $buildroot_suffix = "-devel";
- }
+ } elsif (-e "$p_options->{'package_source_path'}/OpenOffice_org-i18n.spec") {
+ $buildroot_suffix = "-devel";
+ } elsif (-e "$p_options->{'package_source_path'}/OpenOffice_org-i18n-group1.spec") {
+ $buildroot_suffix = "-devel";
+ } elsif (-e "$p_options->{'package_source_path'}/OpenOffice_org-l10n-group1.spec") {
+ $buildroot_suffix = "-devel";
}
+ }
- my $min_suffix="";
- $min_suffix=".min" if (defined $p_options->{'min'});
-
- my $buildid_suffix="";
- $buildid_suffix="-$p_options->{'buildid'}" if (defined $p_options->{'buildid'});
-
-
- if (defined $p_options->{'ptf'}) {
- $p_options->{'buildroot_name'} = "$buildroot_basename-ptf-$p_options->{'bugid'}$buildroot_suffix$buildid_suffix";
- } elsif (defined $p_options->{'security'}) {
- $p_options->{'buildroot_name'} = "$buildroot_basename-sec$min_suffix-$p_options->{'distro'}$buildroot_suffix$buildid_suffix";
- } else {
- $p_options->{'buildroot_name'} = "$buildroot_basename-$p_options->{'version'}$min_suffix-$p_options->{'distro'}$buildroot_suffix$buildid_suffix";
- }
+ my $min_suffix="";
+ $min_suffix=".min" if (defined $p_options->{'min'});
+ my $buildid_suffix="";
+ $buildid_suffix="-$p_options->{'buildid'}" if (defined $p_options->{'buildid'});
+
+ # packdir
+ my $packdir;
+ if (defined $p_options->{'ptf'}) {
+ $packdir = "$packdir_basename-ptf-$p_options->{'bugid'}$buildid_suffix";
+ } elsif (defined $p_options->{'security'}) {
+ $packdir = "$packdir_basename-sec$min_suffix$buildid_suffix-$p_options->{'distro'}";
+ } else {
+ $packdir = "$packdir_basename-$p_options->{'version'}$min_suffix$buildid_suffix-$p_options->{'distro'}";
+ }
+
+ # buildroot
+ if (defined $p_options->{'buildroot'}) {
+ $p_options->{'buildroot_name'} = "$p_options->{'buildroot'}";
+ $p_options->{'buildroot_name'} =~ s/^.*\///g;
+ } else {
+ $p_options->{'buildroot_name'} = "$packdir$buildroot_suffix";
$p_options->{'buildroot'} = "/abuild/$p_options->{'buildroot_name'}";
}
+ # define diretory where to get the final packages
+ if (defined $p_options->{'get_packages_path_prefix'}) {
+ $p_options->{'get_packages_path'} = "$p_options->{'get_packages_path_prefix'}/$packdir";
+ }
return;
}
@@ -401,7 +436,9 @@
my $version_reg;
if ($p_options->{'package_name'} =~ m/^OpenOffice_org$/ ||
- $p_options->{'package_name'} =~ m/^OpenOffice_org-i18n-icon-themes$/ ||
+ $p_options->{'package_name'} =~ m/^OpenOffice_org-icon-themes$/ ||
+ $p_options->{'package_name'} =~ m/^OpenOffice_org-l10n-group1$/ ||
+ $p_options->{'package_name'} =~ m/^OpenOffice_org-l10n-group2$/ ||
$p_options->{'package_name'} =~ m/^OpenOffice_org-i18n-group1$/ ||
$p_options->{'package_name'} =~ m/^OpenOffice_org-i18n-group2$/ ||
$p_options->{'package_name'} =~ m/^OpenOffice_org-i18n$/) {
@@ -441,6 +478,27 @@
}
}
+sub check_for_noarch($)
+{
+ my ($p_options) = @_;
+ my $result = 0;
+
+ open (SPEC, "$p_options->{'package_source_path'}/$p_options->{'specfile'}") ||
+ die "can't open \"$p_options->{'package_source_path'}/$p_options->{'specfile'}\" for reading: $!\n";
+
+ while (my $line = <SPEC>) {
+ chomp $line;
+
+ if ($line =~ m/BuildArch\s*:\s*noarch/) {
+ $result = 1;
+ last;
+ }
+ }
+ close (SPEC);
+
+ return $result
+}
+
sub set_archs($)
{
my ($p_options) = @_;
@@ -449,7 +507,11 @@
$p_options->{'distro_arch'} = $p_options->{'distro'};
$p_options->{'distro_arch'} =~ s/.*-//g;
- $p_options->{'rpm_arch'} = $p_options->{'distro_arch'};
+ if (check_for_noarch($p_options)) {
+ $p_options->{'rpm_arch'} = "noarch"
+ } else {
+ $p_options->{'rpm_arch'} = $p_options->{'distro_arch'};
+ }
$p_options->{'rpm_arch'} =~ s/i386/i586/;
}
@@ -507,23 +569,25 @@
# print ("Spec file: $p_options->{'specfile'}\n");
}
-sub save_status($)
+sub save_status($$)
{
- my ($p_options) = @_;
-
+ my ($p_options, $force) = @_;
+
return unless (defined $p_options->{'status_file'});
-
- # FIXME: there should be a force option or another logic at all
- if ((! defined $p_options->{'replace_status_file'}) && (-e $p_options->{'status_file'})) {
- show_error("Error: Status file \"$p_options->{'status_file'}\" already exists");
+
+ if (-e $p_options->{'status_file'}) {
+ unless ((defined $p_options->{'replace_status_file'}) || $force ) {
+ show_error("Error: Status file \"$p_options->{'status_file'}\" already exists");
+ }
}
-
+
open (STATE, '>', "$p_options->{'status_file'}") ||
show_error("Can't open \"$p_options->{'status_file'}\" for writing: $!");
print STATE "package_name = $p_options->{'package_name'}\n";
print STATE "version = $p_options->{'version'}\n";
print STATE "distro = $p_options->{'distro'}\n\n";
+ print STATE "host = $p_options->{'host'}\n\n";
print STATE "package_source_path = $p_options->{'package_source_path'}\n";
print STATE "package_source_name = $p_options->{'package_source_name'}\n";
@@ -538,6 +602,10 @@
print STATE "buildroot = $p_options->{'buildroot'}\n";
print STATE "remote_rpms_path = $p_options->{'remote_rpms_path'}\n";
+ print STATE "get_packages_path = $p_options->{'get_packages_path'}\n\n";
+
+ print STATE "built = $p_options->{'built'}\n";
+ print STATE "downloaded = $p_options->{'downloaded'}\n";
close (STATE);
}
@@ -546,11 +614,16 @@
sub read_item_from_stat($$$)
{
my ($item_name, $status_file, $optional) = @_;
-
- open (STATE, "$status_file") ||
- show_error("Can't open \"$status_file\" to read \"$item_name\": $!");
-
my $item_value;
+
+ unless (open (STATE, "$status_file")) {
+ if ($optional) {
+ return $item_value;
+ } else {
+ show_error("Can't open \"$status_file\" to read \"$item_name\": $!");
+ }
+ }
+
while (my $line = <STATE>) {
chomp $line;
if ( $line =~ m/$item_name\s*=\s*(.*)\s?/ ) {
@@ -582,6 +655,7 @@
"\t[--status-file=<stat_file>] [--replace-status-file=<stat_file>]\n" .
"\t[--get-status-file]\n" .
"\t[--prefer-rpms-from-build=<stat_file>]\n" .
+ "\t[--re-use-remote-prefer-rpms-from-build=<stat_file>]\n" .
"\t[--re-use-remote-sources-from-build=<stat_file>]\n" .
"\t[--do-not-update-remote-sources] [--keep-remote-tempdir]\n" .
"\t[--remove-remote-tempdir=<stat_file>][--no-final-message]\n" .
@@ -614,6 +688,8 @@
"\t\tdefault status file name is derived from other options, like\n" .
"\t\t--distro, --min\n" .
"\t--prefer-rpms-from-build: prefer_rpms produced by another build\n" .
+ "\t--re-use-remote-prefer-rpms-from-build: re-use the remote prefer\n" .
+ "\t\tRPMs directory\n" .
"\t--re-use-remote-sources-from-build: re-use an older remote source dir;\n" .
"\t\tit might speed up the source synchronization\n" .
"\t--do-not-update-remote-sources: skip the source synchronization at all\n" .
@@ -656,7 +732,10 @@
$options{'status_file'} = "$1";
$options{'replace_status_file'} = 1;
} elsif ($arg =~ m/--prefer-rpms-from-build=(.*)/) {
- $options{'prefer_rpms'} = read_item_from_stat("remote_rpms_path", "$1", 0);
+ $options{'local_prefer_rpms'} = read_item_from_stat("get_packages_path", "$1", 0);
+ $options{'local_prefer_rpms'} .= "/devel";
+ } elsif ($arg =~ m/--re-use-remote-prefer-rpms-from-build=(.*)/) {
+ $options{'remote_prefer_rpms'} = read_item_from_stat("remote_prefer_rpms", "$1", 0);
} elsif ($arg =~ m/--re-use-remote-sources-from-build=(.*)/) {
$options{'remote_tempdir'} = read_item_from_stat("remote_tempdir", "$1", 0);
$options{'re_using_remote_tempdir'} = 1;
@@ -667,6 +746,12 @@
} elsif ($arg =~ m/--remove-remote-tempdir=(.*)/) {
$options{'remote_tempdir'} = read_item_from_stat("remote_tempdir", "$1", 0);
$options{'remove_remote_tempdir'} = 1;
+ } elsif ($arg =~ m/--packages=(.*)/) {
+ $options{'packages'} = "$1";
+ } elsif ($arg =~ m/--devel-packages=(.*)/) {
+ $options{'devel_packages'} = "$1";
+ } elsif ($arg =~ m/--get-packages=(.*)/) {
+ $options{'get_packages_path_prefix'} = "$1";
} elsif ($arg =~ m/--buildid=(.*)/) {
$options{'buildid'} = "$1";
} elsif ($arg =~ m/--min/) {
@@ -713,7 +798,7 @@
check_distro(\%options);
set_archs(\%options);
set_package_version(\%options);
-set_buildroot_names(\%options);
+set_packdir_names(\%options);
set_status_file(\%options);
if (defined $options{'get_status_file'}) {
@@ -721,27 +806,37 @@
exit 0;
}
+unless (defined $options{'force'}) {
+ # will skip build and/or download when already done
+ $options{'built'} = read_item_from_stat("built", "$options{'status_file'}", 1);
+ $options{'downloaded'} = read_item_from_stat("downloaded", "$options{'status_file'}", 1);
+}
+
set_rebuild_options(\%options) if (defined $options{'rebuild'});
-check_free_space_in_abuild($options{'host'});
+check_free_space($options{'host'}, "/abuild", $critical_free_space_limit_abuild);
+
check_buildroot(\%options);
set_rpms_paths(\%options);
create_remote_tempdir(\%options);
set_package_remote_sources_path(\%options);
set_remote_prefer_rpms_path(\%options);
-save_status(\%options);
+save_status(\%options, 0);
show_status(\%options);
print ("Waiting 5 seconds...\n");
-sleep 5;
+# do not delay already finished build
+sleep 5 unless (defined $options{'built'} && "$options{'built'}" eq "yes");
+# always upload sources, they might be necessary to rebuild the other spec files
upload_sources(\%options);
-upload_prefer_rpms(\%options);
+# update prefer rpms only when we will build the package
+upload_prefer_rpms(\%options) unless (defined $options{'built'} && "$options{'built'}" eq "yes");
-print ("package_remote_sources_path = $options{'package_remote_sources_path'}\n");
+abuild_package(\%options) unless (defined $options{'built'} && "$options{'built'}" eq "yes");
-abuild_package(\%options);
+get_packages(\%options) unless (defined $options{'downloaded'} && $options{'downloaded'} eq "yes");
remove_remote_tempdir(\%options);
Modified: trunk/scratch/packaging/ooo-build-release
==============================================================================
--- trunk/scratch/packaging/ooo-build-release (original)
+++ trunk/scratch/packaging/ooo-build-release Mon Sep 1 19:20:01 2008
@@ -153,6 +153,16 @@
"cd -") && die "Error: releasing failed: $!\n";
}
+sub generate_md5($$)
+{
+ my ($ooo_build_dir, $release_tarball) = @_;
+
+ print "Generating MD5...\n";
+ system ("cd $ooo_build_dir && " .
+ "md5sum $release_tarball >$release_tarball.md5 && " .
+ "cd -") && die "Error: releasing failed: $!\n";
+}
+
sub default_releases_state_file($)
{
my ($ooo_build_dir) = @_;
@@ -177,14 +187,14 @@
my $rootdir = $ooo_build_dir;
$rootdir =~ s/^(.*?)\/?[^\/]+\/?$/$1/;
- my $releases_archive;
+ my $releases_archive_dir;
if ($rootdir) {
- $releases_archive = "$rootdir/archive";
+ $releases_archive_dir = "$rootdir/archive";
} else {
- $releases_archive = "archive";
+ $releases_archive_dir = "archive";
}
- return "$releases_archive";
+ return "$releases_archive_dir";
}
sub load_releases_state($)
@@ -234,21 +244,21 @@
sub copy_to_archive($$$)
{
- my ($ooo_build_dir, $releases_archive, $release_tarball) = @_;
+ my ($ooo_build_dir, $releases_archive_dir, $release_tarball) = @_;
- unless ( -d "$releases_archive" ) {
- mkdir ("$releases_archive") ||
- die "Can't create directory $releases_archive: $!\n";
+ unless ( -d "$releases_archive_dir" ) {
+ mkdir ("$releases_archive_dir") ||
+ die "Can't create directory $releases_archive_dir: $!\n";
}
- if ( -f "$releases_archive/$release_tarball" ) {
- print "Warning: $releases_archive/$release_tarball already exists and will be replaced\n";
- unlink ("$releases_archive/$release_tarball");
+ if ( -f "$releases_archive_dir/$release_tarball" ) {
+ print "Warning: $releases_archive_dir/$release_tarball already exists and will be replaced\n";
+ unlink ("$releases_archive_dir/$release_tarball");
}
- print "Copying into archive: $releases_archive/$release_tarball ...\n";
- copy ("$ooo_build_dir/$release_tarball", "$releases_archive/$release_tarball") ||
- die "Error: Can't copy $ooo_build_dir/$release_tarball to $releases_archive/$release_tarball: $!\n";
+ print "Copying into archive: $releases_archive_dir/$release_tarball ...\n";
+ copy ("$ooo_build_dir/$release_tarball", "$releases_archive_dir/$release_tarball") ||
+ die "Error: Can't copy $ooo_build_dir/$release_tarball to $releases_archive_dir/$release_tarball: $!\n";
}
sub copy_to_cwd($$)
@@ -281,10 +291,10 @@
sub check_if_already_released($$$)
{
- my ($release_tarball, $releases_archive, $force) = @_;
+ my ($release_tarball, $releases_archive_dir, $force) = @_;
check_if_file_exists($release_tarball, $force);
- check_if_file_exists("$releases_archive/$release_tarball", $force) if (defined $releases_archive);
+ check_if_file_exists("$releases_archive_dir/$release_tarball", $force) if (defined $releases_archive_dir);
}
sub usage()
@@ -309,6 +319,7 @@
"\t--inc-version: increment the latest version; there is a difference\n" .
"\t\tbetween test release (default) and final (not yet supported)\n" .
"\t--ptf: release ptf-specific tarball for given bugzilla number\n" .
+ "\t--md5: generate md5 sum for the final tarball\n" .
"\tdir: path of the local SVN repository copy\n";
# "\t--daily:\n" .
@@ -319,6 +330,7 @@
my $ptf;
+my $md5;
my $final;
my $daily;
my $svn_tree;
@@ -329,7 +341,7 @@
my $get_config_version;
my $release_version;
my $ooo_build_dir;
-my $releases_archive;
+my $releases_archive_dir;
my $releases_state_file;
my $state_config_version;
my $state_release_version;
@@ -347,9 +359,11 @@
usage;
exit 0;
} elsif ($arg eq '--force') {
- $force=1
+ $force=1;
+ } elsif ($arg eq '--md5') {
+ $md5=1;
} elsif ($arg eq '--final') {
- $final=1
+ $final=1;
} elsif ($arg eq '--version') {
$get_config_version=1;
$verbose = undef;
@@ -415,7 +429,7 @@
if (defined $ooo_build_dir) {
$releases_state_file = default_releases_state_file($ooo_build_dir) unless (defined $releases_state_file);
- $releases_archive = default_releases_archive($ooo_build_dir) unless (defined $releases_archive);
+ $releases_archive_dir = default_releases_archive($ooo_build_dir) unless (defined $releases_archive_dir);
}
# FIXME: this is not optimal in case of svn check but the svn check out to
@@ -459,7 +473,7 @@
print "$release_version\n";
} else {
$release_tarball = "ooo-build-$release_version.tar.gz";
- check_if_already_released($release_tarball, $releases_archive, $force);
+ check_if_already_released($release_tarball, $releases_archive_dir, $force);
# give a chance to stop the process
print ("\nWaiting 3 seconds...\n");
sleep 3;
@@ -471,9 +485,12 @@
}
set_config_version($ooo_build_tempdir, $release_version);
release_tarball($ooo_build_tempdir);
+ generate_md5($ooo_build_tempdir, $release_tarball) if (defined $md5);
copy_to_cwd($ooo_build_tempdir, $release_tarball);
- if ( defined $releases_archive ) {
- copy_to_archive($ooo_build_tempdir, $releases_archive, $release_tarball);
+ copy_to_cwd($ooo_build_tempdir, "$release_tarball.md5") if (defined $md5);
+ if ( defined $releases_archive_dir ) {
+ copy_to_archive($ooo_build_tempdir, $releases_archive_dir, $release_tarball);
+ copy_to_archive($ooo_build_tempdir, $releases_archive_dir, "$release_tarball.md5") if (defined $md5);
}
if ( defined $releases_state_file ) {
save_releases_state($releases_state_file, $config_version, $release_version);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]