3 # Version: MPL 1.1 / GPLv3+ / LGPLv3+
5 # The contents of this file are subject to the Mozilla Public License Version
6 # 1.1 (the "License"); you may not use this file except in compliance with
7 # the License or as specified alternatively below. You may obtain a copy of
8 # the License at http://www.mozilla.org/MPL/
10 # Software distributed under the License is distributed on an "AS IS" basis,
11 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 # for the specific language governing rights and limitations under the
15 # The Initial Developer of the Original Code is
16 # Petr Mladek <pmladek@suse.cz>
17 # Portions created by the Initial Developer are Copyright (C) 2011 the
18 # Initial Developer. All Rights Reserved.
20 # Major Contributor(s):
22 # Portions created by the Ted are Copyright (C) 2010 Ted. All Rights Reserved.
24 # For minor contributions see the git repository.
26 # Alternatively, the contents of this file may be used under the terms of
27 # either the GNU General Public License Version 3 or later (the "GPLv3+"), or
28 # the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
29 # in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
30 # instead of those above.
34 echo "Helper script to unpack the LO source tarbals"
36 echo "Usage: ${0##*/} [--help] start-dir tarball..."
40 echo " --help this help"
41 echo " start-dir path where the sources are unpacked (bootstrap directory)"
42 echo " tarball list of LO source tarball that need to be unpacked"
48 while test -n "$1" ; do
58 echo "Error: unknown option: $1"
62 if test -z "$start_dir" ; then
65 tarballs
="$tarballs $1"
72 if test -z "$start_dir" ; then
73 echo "Error: Please, define where to unpack sources, try --help"
76 if ! test -d $start_dir/src
-a -f $start_dir/solenv
/inc
/target.mk
; then
77 echo "Error: $start_dir is not a valid bootstrap directory"
81 if test ! -f $start_dir/bootstrap.ver
-o -d $start_dir/.git
; then
82 echo "Warning: bootstrap sources are from git and not from tarball"
87 source $start_dir/bootstrap.ver
88 lo_src_dir
="$start_dir/src"
89 mkdir
-p "$lo_src_dir"
91 for tarball
in $tarballs ; do
92 tarname
=`basename $tarball | sed -e "s/.tar.bz2//"`
93 if test -d $lo_src_dir/$tarname ; then
94 echo "Warning: $lo_src_dir/$tarname already exists => skipping"
98 echo "Unpacking $tarname..."
99 tar -xjf "$tarball" -C "$lo_src_dir"
102 for dir
in `find "$lo_src_dir/$tarname" -mindepth 1 -maxdepth 1 -type d -printf "$tarname/%f\n"` ; do
103 ln -sf "src/$dir" "$start_dir"