Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NetBSDfr/sailor
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 30fe908d5e7e22a871dfc8b409d67a8029896514
Choose a base ref
..
head repository: NetBSDfr/sailor
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 395d5cd711071fe6034816ba34008909b785c51c
Choose a head ref
Showing with 16 additions and 24 deletions.
  1. +15 −20 include/install_deps.sh
  2. +1 −4 include/platform.sh
35 changes: 15 additions & 20 deletions include/install_deps.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#! /usr/bin/env sh

. ${include}/define.sh

case ${OS} in
[Dd]arwin)
# Try to find a real way to define if another packages manager is installed.
@@ -41,27 +39,29 @@ install_pkgin()
bootstrap_doc="/tmp/pkgin_install.txt"
${_curl} -o ${bootstrap_doc} ${bootstrap_install_url}
bootstrap_url=$(${_egrep} "${joyent_base_url}packages/${OS}/bootstrap/.*.${ARCH}.tar.gz" ${bootstrap_doc})
strip_bootstrap_url="${bootstrap_url#curl -Os }"

read bootstrap_hash bootstrap_tar <<EOF
$(${_egrep} "[0-9a-z]{32}.+${ARCH}.tar.gz" ${bootstrap_doc})
EOF
read bootstrap_hash bootstrap_tar <<-EOF
$(${_egrep} "[0-9a-z]{32}.+${ARCH}.tar.gz" ${bootstrap_doc})
EOF

fetch_localbase="$(${_curl} ${bootstrap_url#curl -Os} | ${tar} ztvf - | ${_egrep} '/.+/pkg_install.conf$')"
fetch_localbase="$(${_curl} ${strip_bootstrap_url} | ${tar} ztvf - | ${_egrep} '/.+/pkg_install.conf$')"
pkgin_localbase="${fetch_localbase%/*/*}"
pkgin_localbase_bin="${pkgin_localbase}/bin"
pkgin_localbase_sbin="${pkgin_localbase}/sbin"
pkgin_localbase_man="${pkgin_localbase}/man"

for p in bin sbin man; do
eval pkgin_localbase_\${p}="${pkgin_localbase}/${p}"
done
pkgin_bin="${pkgin_localbase_bin}/pkgin"

export PATH=${pkgin_localbase_sbin}:${pkgin_localbase_bin}:${PATH}

[ "${OS}" = "Linux" ] && export MANPATH=${pkgin_localbase_man}:${MANPATH}

# Generic variables and commands.
bootstrap_tmp="/tmp/${bootstrap_tar}"
bootstrap_tmp="${HOME}/${bootstrap_tar}"

# download bootstrap kit.
if ! ${_curl} -o "${bootstrap_tmp}" "${bootstrap_url#curl -Os }"; then
if ! ${_curl} -o "${bootstrap_tmp}" "${strip_bootstrap_url}"; then
printf "version of bootstrap for ${OS} not found.\nplease install it by yourself.\n"
exit 1
fi
@@ -77,11 +77,11 @@ EOF
${tar} xfp "${bootstrap_tmp}" -c / >/dev/null 2>&1

# If GPG available, verify GPG signature.
if [ ! -z ${gpg} ]; then
if [ ! -n "${gpg}" ]; then
# Verifiy PGP signature.
repo_gpgkey="$(${_egrep} -m1 'gpg --recv-keys.*' ${bootstrap_doc})"
${gpg} --keyserver hkp://keys.gnupg.net --recv-keys ${repo_gpgkey##* } >/dev/null 2>&1
${_curl} -o "${bootstrap_tmp}.asc" "${bootstrap_url#curl -Os }.asc"
${_curl} -o "${bootstrap_tmp}.asc" "${strip_bootstrap_url}.asc"
${gpg} --verify "${bootstrap_tmp}.asc" >/dev/null 2>&1
fi

@@ -94,11 +94,7 @@ EOF

test_if_pkgin_is_installed()
{

if [ -z ${pkgin} ]; then
install_pkgin
fi

[ -z ${pkgin} ] && install_pkgin
return 0
}

@@ -107,8 +103,7 @@ install_3rd_party_pkg()
pkg=${1}
test_if_pkgin_is_installed

${pkgin} search ${pkg}
if [ "$?" != 0 ]; then
if ! ${pkgin} search ${pkg}; then
printf "Package not found.\n"
exit 1
else
5 changes: 1 addition & 4 deletions include/platform.sh
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ do
printf "Would you like to install ${bin}? [y/N] "
read confirm
if [ "$confirm" = "y" ]; then
. ./install_deps.sh
. ${include}/install_deps.sh
install_3rd_party_pkg "${bin}"
else
echo "${bin} is required for sailor to work"
@@ -18,11 +18,8 @@ do
exit 1
fi
eval ${bin}=${binpath}

done

rsync="${rsync} -av"

case $OS in
Darwin)
. ${include}/mdns.sh