Issue 14653 - new options for deliver.pl: -link and -deloutput
Summary: new options for deliver.pl: -link and -deloutput
Status: CLOSED FIXED
Alias: None
Product: Build Tools
Classification: Code
Component: code (show other issues)
Version: OOo 1.1 Beta2
Hardware: All All
: P5 (lowest) Trivial (vote)
Target Milestone: OOo 1.1 RC
Assignee: chris
QA Contact: issues@tools
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-20 11:27 UTC by chris
Modified: 2003-11-20 12:59 UTC (History)
2 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Implementation of -link and -deloutput in solenv/bin/deliver.pl (5.98 KB, patch)
2003-05-20 11:35 UTC, chris
no flags Details | Diff
Patch v2 with added changes suggested by Timm (6.19 KB, patch)
2003-06-23 16:02 UTC, chris
no flags Details | Diff
Diff against 11rc with correction for windows (1.51 KB, patch)
2003-07-02 09:17 UTC, chris
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description chris 2003-05-20 11:27:22 UTC
This patch adds 2 new options to deliver.pl, for people who are building the
complete OOo but are short on disk space.  The patch adds two new options and
does not change the default functionality:

  -link         hard link files into the solver to save disk space
  -deloutput    remove the output tree

-link is useful for anyone who is building OOo on a single partition and is not
using a shared solver.  With this option, deliver tries to hard link files when
it would usually copy them, and falls back to copying if that fails.  This saves
over 800mb on a typical build on my machine, more if -g debugging information is
enabled.

-deloutput is for people who are really short on disk space and reduces the OOo
build footprint to the size of the solver + source + output directory for a
single tree, by deleting the output tree if the module was delivered
successfully.  This is useful for people who would otherwise have to resort to
using precompiled solvers, or for situations where the intermediate object files
never need to be reused such as a tinderbox that always rebuilds from scratch.

The patch is against 1.1beta2 but should apply to almost any branch.  rt:  I've
assigned to you because you performed the last few commits to deliver.pl but I'm
happy to commit if no-one really owns the code.
Comment 1 chris 2003-05-20 11:35:25 UTC
Created attachment 6294 [details]
Implementation of -link and -deloutput in solenv/bin/deliver.pl
Comment 2 rt 2003-05-20 17:25:02 UTC
Hi Chris,

I've no objections against these two options. As long as the default
behaviour is not changed new options won't hurt, and these ones really
sound usefull. 
What i did not check out yet is what a windows perl is doing when
confronted with "link", which is not implemented there. If it just
does nothing and returns 0, everything should be OK.
Concerning your delete_output: you perhaps should add some check
whether expand_macros("../%__SRC%") gave the correct result. Otherwise
if %_SRC% expands empty you'll delete your whole module.

Go ahead, commit. Best against cws_srx644_ooo11beta2, I think.

Rüdiger
Comment 3 chris 2003-06-23 16:02:31 UTC
Created attachment 7056 [details]
Patch v2 with added changes suggested by Timm
Comment 4 chris 2003-06-23 16:06:29 UTC
I talked to Volker, and we decided we can't be sure what link() on
Windows will do, and anyway it will never work for programs other than
Cygwin binaries so I disabled the option completely for Windows.

Secondly, in delete_output I now check that INPATH is not unset and
refuse to delete if it is blank.

I will check into 1.1rc if there are no objections.  The patch is
generated against the 11rc branch.
Comment 5 chris 2003-06-27 15:16:43 UTC
Comitted to branch

/cvs/tools/solenv/bin/deliver.pl,v  <--  deliver.pl
new revision: 1.48.2.1; previous revision: 1.48
Comment 6 chris 2003-07-02 09:16:11 UTC
09:51 <@haggai> vq: have you got a 1.1rc deliver.pl in front of you? 
Does deliver -help show the -deloutput option but not
                -link ?  I (hopefully) disabled -link for win as we
discussed
09:54 < vq> Options:
[...]
09:54 < vq>   -link hard link files into the solver to save disk space
09:54 <@haggai> eek
09:55 <@haggai>     if ( $^O ne 'MSWin32' ) {
09:55 <@haggai>         print STDERR "  -link\thard link files into
the solver to save disk space\n";
09:56 <@haggai> is your $^O not 'MSWin32'?
09:56 < vq> haggai: Ahh, well $^O is 'cygwin' for cygwin perl, your
line should work for activestate perl
09:58 <@haggai> so I need  if ( $^O ne 'MSWin32' && $^O ne 'cygwin' )
I guess
09:58 < vq> haggai: I think so too
10:02 < vq> haggai: How about: $ENV{GUI} ne 'WNT' ? Is better to read!

I'm attaching a new patch.
Comment 7 chris 2003-07-02 09:17:40 UTC
Created attachment 7326 [details]
Diff against 11rc with correction for windows
Comment 8 chris 2003-07-02 09:27:33 UTC
Done.

/cvs/tools/solenv/bin/deliver.pl,v  <--  deliver.pl
new revision: 1.48.2.2; previous revision: 1.48.2.1
Comment 9 chris 2003-11-20 12:59:53 UTC
Released in 1.1.0, closing