pkgfs.sh: misc changes to collapse various conditionals into one line.
Also some misc cosmetics in messages. --HG-- extra : convert_revision : d61042aac5bac8be07638beb9b7cd85bae1da577
This commit is contained in:
parent
2ed298ac70
commit
11103a49a8
1 changed files with 10 additions and 11 deletions
21
pkgfs.sh
21
pkgfs.sh
|
@ -146,9 +146,8 @@ merge_infodir_tmpl()
|
||||||
local pkgname="$1"
|
local pkgname="$1"
|
||||||
local merge_info_cmd="$PKGFS_MASTERDIR/bin/merge-info"
|
local merge_info_cmd="$PKGFS_MASTERDIR/bin/merge-info"
|
||||||
|
|
||||||
[ -z "$pkgname" ] && return 1
|
[ -z "$pkgname" -o ! -r "$PKGFS_MASTERDIR/share/info/dir" \
|
||||||
[ ! -r "$PKGFS_MASTERDIR/share/info/dir" ] && return 1
|
-o ! -r "$PKGFS_DESTDIR/$pkgname/share/info/dir" ] && return 1
|
||||||
[ ! -r "$PKGFS_DESTDIR/$pkgname/share/info/dir" ] && return 1
|
|
||||||
|
|
||||||
$merge_info_cmd -d $PKGFS_MASTERDIR/share/info/dir \
|
$merge_info_cmd -d $PKGFS_MASTERDIR/share/info/dir \
|
||||||
$PKGFS_DESTDIR/$pkgname/share/info/dir -o \
|
$PKGFS_DESTDIR/$pkgname/share/info/dir -o \
|
||||||
|
@ -555,7 +554,7 @@ build_tmpl_sources()
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -d "$wrksrc" ]; then
|
if [ ! -d "$wrksrc" ]; then
|
||||||
echo "*** ERROR: unexistent build directory, aborting ***"
|
echo "*** ERROR: unexistent build directory: \`$wrksrc' ***"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -628,7 +627,7 @@ build_tmpl_sources()
|
||||||
# Unknown build_style type won't work :-)
|
# Unknown build_style type won't work :-)
|
||||||
#
|
#
|
||||||
else
|
else
|
||||||
echo "*** ERROR unknown build_style $build_style, aborting ***"
|
echo "*** ERROR unknown build_style \`$build_style' ***"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -736,7 +735,7 @@ build_tmpl_sources()
|
||||||
# Unset build vars.
|
# Unset build vars.
|
||||||
unset_build_vars
|
unset_build_vars
|
||||||
|
|
||||||
echo "==> Installed \`$pkg' into $PKGFS_DESTDIR/$pkg."
|
echo "==> Installed \`$pkg' into $PKGFS_DESTDIR."
|
||||||
|
|
||||||
#
|
#
|
||||||
# Remove $wrksrc if -C not specified.
|
# Remove $wrksrc if -C not specified.
|
||||||
|
@ -980,7 +979,7 @@ install_dependency_tmpl()
|
||||||
for i in ${deps_list}; do
|
for i in ${deps_list}; do
|
||||||
# skip dup deps
|
# skip dup deps
|
||||||
echo "=> Installing dependency: $i"
|
echo "=> Installing dependency: $i"
|
||||||
install_tmpl ${i%-[0-9].*}
|
install_tmpl ${i%-[0-9]*.*}
|
||||||
done
|
done
|
||||||
|
|
||||||
unset installed_deps_list
|
unset installed_deps_list
|
||||||
|
@ -1018,6 +1017,7 @@ installed_tmpl_handler()
|
||||||
local version="$3"
|
local version="$3"
|
||||||
|
|
||||||
[ -z "$action" -o -z "$pkg" -o -z "$version" ] && return 1
|
[ -z "$action" -o -z "$pkg" -o -z "$version" ] && return 1
|
||||||
|
|
||||||
if [ "$action" = "register" ]; then
|
if [ "$action" = "register" ]; then
|
||||||
$db_cmd -w btree $PKGFS_REGPKG_DB $pkg $version 2>&1 >/dev/null
|
$db_cmd -w btree $PKGFS_REGPKG_DB $pkg $version 2>&1 >/dev/null
|
||||||
if [ "$?" -ne 0 ]; then
|
if [ "$?" -ne 0 ]; then
|
||||||
|
@ -1039,7 +1039,7 @@ installed_tmpl_handler()
|
||||||
|
|
||||||
#
|
#
|
||||||
# Checks the registered pkgs db file and returns 0 if a pkg that satisfies
|
# Checks the registered pkgs db file and returns 0 if a pkg that satisfies
|
||||||
# the minimal required version if there, or 1 otherwise.
|
# the minimal required version is there, or 1 otherwise.
|
||||||
#
|
#
|
||||||
check_installed_tmpl()
|
check_installed_tmpl()
|
||||||
{
|
{
|
||||||
|
@ -1085,8 +1085,7 @@ check_build_depends_tmpl()
|
||||||
{
|
{
|
||||||
local pkg="$1"
|
local pkg="$1"
|
||||||
|
|
||||||
[ -z $pkg ] && return 1
|
[ -z $pkg -o ! -r $PKGFS_BUILD_DEPS_DB ] && return 1
|
||||||
[ ! -r $PKGFS_BUILD_DEPS_DB ] && return 1
|
|
||||||
|
|
||||||
$db_cmd -V btree $PKGFS_BUILD_DEPS_DB ${pkg%-[0-9]*.*} 2>&1 >/dev/null
|
$db_cmd -V btree $PKGFS_BUILD_DEPS_DB ${pkg%-[0-9]*.*} 2>&1 >/dev/null
|
||||||
return $?
|
return $?
|
||||||
|
@ -1300,7 +1299,7 @@ unstow)
|
||||||
unstow_tmpl "$2"
|
unstow_tmpl "$2"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "*** ERROR invalid target '$target' ***"
|
echo "*** ERROR invalid target \`$target' ***"
|
||||||
usage
|
usage
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue