[67129] | 1 | #!/bin/sh
|
---|
[69490] | 2 | # $Id$
|
---|
| 3 | ## @file
|
---|
[67129] | 4 | # Use this script in conjunction with snapshot-ose.sh
|
---|
[69490] | 5 | #
|
---|
[67129] | 6 |
|
---|
[69490] | 7 | #
|
---|
[98103] | 8 | # Copyright (C) 2006-2023 Oracle and/or its affiliates.
|
---|
[69490] | 9 | #
|
---|
[96407] | 10 | # This file is part of VirtualBox base platform packages, as
|
---|
| 11 | # available from https://www.virtualbox.org.
|
---|
[69490] | 12 | #
|
---|
[96407] | 13 | # This program is free software; you can redistribute it and/or
|
---|
| 14 | # modify it under the terms of the GNU General Public License
|
---|
| 15 | # as published by the Free Software Foundation, in version 3 of the
|
---|
| 16 | # License.
|
---|
| 17 | #
|
---|
| 18 | # This program is distributed in the hope that it will be useful, but
|
---|
| 19 | # WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
| 21 | # General Public License for more details.
|
---|
| 22 | #
|
---|
| 23 | # You should have received a copy of the GNU General Public License
|
---|
| 24 | # along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
| 25 | #
|
---|
| 26 | # SPDX-License-Identifier: GPL-3.0-only
|
---|
| 27 | #
|
---|
[69490] | 28 |
|
---|
[67129] | 29 | vboxdir=`pwd`
|
---|
| 30 | if [ ! -r "$vboxdir/Config.kmk" -o ! -r "$vboxdir/Doxyfile.Core" ]; then
|
---|
| 31 | echo "Is $vboxdir really a VBox tree?"
|
---|
| 32 | exit 1
|
---|
| 33 | fi
|
---|
| 34 | if [ -r "$vboxdir/src/VBox/RDP/server/server.cpp" ]; then
|
---|
| 35 | echo "Found RDP stuff, refused to build OSE tarball!"
|
---|
| 36 | exit 1
|
---|
| 37 | fi
|
---|
[69365] | 38 | vermajor=`grep "^VBOX_VERSION_MAJOR *=" "$vboxdir/Version.kmk"|sed -e "s|.*= *\(.*\)|\1|g"`
|
---|
| 39 | verminor=`grep "^VBOX_VERSION_MINOR *=" "$vboxdir/Version.kmk"|sed -e "s|.*= *\(.*\)|\1|g"`
|
---|
| 40 | verbuild=`grep "^VBOX_VERSION_BUILD *=" "$vboxdir/Version.kmk"|sed -e "s|.*= *\(.*\)|\1|g"`
|
---|
[75097] | 41 | verpre=`grep "^VBOX_VERSION_PRERELEASE *=" "$vboxdir/Version.kmk"|sed -e "s|.*= *\(.*\)|\1|g"`
|
---|
| 42 | verpub=`grep "^VBOX_BUILD_PUBLISHER *=" "$vboxdir/Version.kmk"|sed -e "s|.*= *\(.*\)|\1|g"`
|
---|
| 43 | verstr="$vermajor.$verminor.$verbuild"
|
---|
| 44 | [ -n "$verpre" ] && verstr="$verstr"_"$verpre"
|
---|
| 45 | [ -n "$verpub" ] && verstr="$verstr$verpub"
|
---|
[67129] | 46 | rootpath=`cd ..;pwd`
|
---|
| 47 | rootname="VirtualBox-$verstr"
|
---|
[75112] | 48 | if [ $# -eq 1 ]; then
|
---|
[75097] | 49 | tarballname="$1"
|
---|
| 50 | else
|
---|
| 51 | tarballname="$rootpath/$rootname.tar.bz2"
|
---|
| 52 | fi
|
---|
[67129] | 53 | rm -f "$rootpath/$rootname"
|
---|
| 54 | ln -s `basename "$vboxdir"` "$rootpath/$rootname"
|
---|
| 55 | if [ $? -ne 0 ]; then
|
---|
| 56 | echo "Cannot create root directory link!"
|
---|
| 57 | exit 1
|
---|
| 58 | fi
|
---|
| 59 | tar \
|
---|
| 60 | --create \
|
---|
| 61 | --bzip2 \
|
---|
| 62 | --dereference \
|
---|
| 63 | --owner 0 \
|
---|
| 64 | --group 0 \
|
---|
| 65 | --totals \
|
---|
| 66 | --exclude=.svn \
|
---|
| 67 | --exclude="$rootname/out" \
|
---|
| 68 | --exclude="$rootname/env.sh" \
|
---|
| 69 | --exclude="$rootname/configure.log" \
|
---|
| 70 | --exclude="$rootname/build.log" \
|
---|
| 71 | --exclude="$rootname/AutoConfig.kmk" \
|
---|
| 72 | --exclude="$rootname/LocalConfig.kmk" \
|
---|
| 73 | --exclude="$rootname/prebuild" \
|
---|
| 74 | --directory "$rootpath" \
|
---|
[75097] | 75 | --file "$tarballname" \
|
---|
[67129] | 76 | "$rootname"
|
---|
[75097] | 77 | echo "Successfully created $tarballname"
|
---|
[67129] | 78 | rm -f "$rootpath/$rootname"
|
---|