Simplify check_build_dirs and rename it to check_build_vars.
--HG-- extra : convert_revision : aa5bb29fb0c8aeb27495e07224be484dbddce971
This commit is contained in:
parent
ccb854252d
commit
6ff0c41308
66
pkgfs.sh
66
pkgfs.sh
|
@ -2,9 +2,6 @@
|
||||||
#
|
#
|
||||||
# pkgfs - Builds source distribution files.
|
# pkgfs - Builds source distribution files.
|
||||||
#
|
#
|
||||||
# A GNU's Stow alike approach, with some ideas from Gobolinux'
|
|
||||||
# Compile and maybe others.
|
|
||||||
#
|
|
||||||
#-
|
#-
|
||||||
# Copyright (c) 2008 Juan Romero Pardines.
|
# Copyright (c) 2008 Juan Romero Pardines.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
|
@ -111,60 +108,39 @@ info_tmpl()
|
||||||
echo "$long_desc"
|
echo "$long_desc"
|
||||||
}
|
}
|
||||||
|
|
||||||
check_build_dirs()
|
check_build_vars()
|
||||||
{
|
{
|
||||||
check_path "$PKGFS_CONFIG_FILE"
|
|
||||||
. $path_fixed
|
|
||||||
|
|
||||||
if [ ! -f "$PKGFS_CONFIG_FILE" ]; then
|
if [ ! -f "$PKGFS_CONFIG_FILE" ]; then
|
||||||
echo -n "*** ERROR: cannot find global config file: "
|
echo -n "*** ERROR: cannot find configuration file: "
|
||||||
echo "'$PKGFS_CONFIG_FILE' ***"
|
echo "'$PKGFS_CONFIG_FILE' ***"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$PKGFS_DESTDIR" ]; then
|
check_path "$PKGFS_CONFIG_FILE"
|
||||||
echo -n "*** ERROR: PKGFS_DESTDIR not set in configuration"
|
. $path_fixed
|
||||||
echo " file ***"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$PKGFS_BUILDDIR" ]; then
|
local PKGFS_VARS="PKGFS_MASTERDIR PKGFS_DESTDIR PKGFS_BUILDDIR \
|
||||||
echo -n "*** ERROR PKGFS_BUILDDIR not set in configuration"
|
PKGFS_SRC_DISTDIR"
|
||||||
echo " file ***"
|
|
||||||
exit 1;
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -d "$PKGFS_DESTDIR" ]; then
|
for f in ${PKGFS_VARS}; do
|
||||||
$mkdir_cmd "$PKGFS_DESTDIR"
|
eval val="\$$f"
|
||||||
if [ "$?" -ne 0 ]; then
|
if [ -z "$val" ]; then
|
||||||
echo -n "*** ERROR: couldn't create PKGFS_DESTDIR "
|
echo "**** ERROR: '$f' not set in configuration "
|
||||||
echo "directory, aborting ***"
|
echo "file, aborting ***"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
if [ ! -d "$f" ]; then
|
||||||
|
$mkdir_cmd "$val"
|
||||||
if [ ! -d "$PKGFS_BUILDDIR" ]; then
|
if [ "$?" -ne 0 ]; then
|
||||||
$mkdir_cmd "$PKGFS_BUILDDIR"
|
echo -n "*** ERROR: couldn't create '$f'"
|
||||||
if [ "$?" -ne 0 ]; then
|
echo "directory, aborting ***"
|
||||||
echo -n "*** ERROR: couldn't create PKFS_BUILDDIR "
|
exit 1
|
||||||
echo "directory, aborting ***"
|
fi
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
fi
|
done
|
||||||
|
|
||||||
if [ -z "$PKGFS_SRC_DISTDIR" ]; then
|
|
||||||
echo "*** ERROR: PKGFS_SRC_DISTDIR is not set, aborting ***"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
$mkdir_cmd "$PKGFS_SRC_DISTDIR"
|
|
||||||
if [ "$?" -ne 0 ]; then
|
|
||||||
echo "*** ERROR couldn't create PKGFS_SRC_DISTDIR, aborting ***"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
check_build_vars()
|
check_tmpl_vars()
|
||||||
{
|
{
|
||||||
local dfile=""
|
local dfile=""
|
||||||
|
|
||||||
|
@ -368,8 +344,8 @@ build_tmpl()
|
||||||
|
|
||||||
export PATH="/bin:/sbin:/usr/bin:/usr/sbin:$PKGFS_DESTDIR/bin:$PKGFS_DESTDIR/sbin"
|
export PATH="/bin:/sbin:/usr/bin:/usr/sbin:$PKGFS_DESTDIR/bin:$PKGFS_DESTDIR/sbin"
|
||||||
|
|
||||||
check_build_dirs
|
|
||||||
check_build_vars
|
check_build_vars
|
||||||
|
check_tmpl_vars
|
||||||
|
|
||||||
if [ "$only_build" ]; then
|
if [ "$only_build" ]; then
|
||||||
build_tmpl_sources
|
build_tmpl_sources
|
||||||
|
|
Loading…
Reference in New Issue
Block a user