[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

patch: ezjail-admin install -S/-M bug fix



Hello,

unless I am doing something wrong it looks like the -S and -M options in "ezjail-admin install" fail to work properly. See attached patch.

Regards,
Panagiotis

--
Panagiotis J. Christias    Network Management Center
p.christias AT noc.ntua DOT gr    National Technical Univ. of Athens, GREECE
--- ezjail-admin.orig	2010-03-17 12:16:20.000000000 +0200
+++ ezjail-admin	2010-03-31 15:08:34.000000000 +0300
@@ -301,6 +301,24 @@
   [ "${ezjail_uglyperlhack}" -a ! -L "${ezjail_jailbase}/usr/bin/perl" ] && ln -s /usr/local/bin/perl "${ezjail_jailbase}/usr/bin/perl"
 }
 
+# install sources only - this function is used by install and update
+ezjail_installsources() {
+  cd "${ezjail_jailfull}" || exerr "Error: Cant access temporary Jail directory."
+  find usr/src | cpio -d -p -v "${ezjail_jailbase}" || exerr "Error: Installation of sources failed."
+  cd ${ezjail_jaildir}
+  chflags -R noschg "${ezjail_jailfull}"
+  rm -r "${ezjail_jailfull}"
+}
+
+# install manpages only - this function is used by install and update
+ezjail_installmanpages() {
+  cd "${ezjail_jailfull}" || exerr "Error: Cant access temporary Jail directory."
+  find usr/share/man | cpio -d -p -v "${ezjail_jailbase}" || exerr "Error: Installation of manpages failed."
+  cd ${ezjail_jaildir}
+  chflags -R noschg "${ezjail_jailfull}"
+  rm -r "${ezjail_jailfull}"
+}
+
 # The user may want to have a ports tree in basejail
 ezjail_updateports () {
   local _portsnap_fetch="fetch"
@@ -962,6 +980,7 @@
       # of sources to install, base asks the user if he is sure, hence the
       # yes and the set -- all
       [ "${pkg}" = "base" ] && echo "Ignore the next question, ezjail answers it for you."
+      [ "${pkg}" = "src" ] && mkdir -p "${ezjail_jailfull}/usr/src"
       set -- all
       [ -f install.sh ] && yes | . install.sh
       [ $? -eq 0 ] || exerr "Error: Package install script for ${pkg} failed."
@@ -978,6 +997,12 @@
   # Split basejail and newjail
   [ "${ezjail_basesystem}" ] && ezjail_splitworld
 
+  # Fill just sources, if requested
+  [ "${ezjail_installsources}" -a ! "${ezjail_basesystem}" ] && ezjail_installsources
+
+  # Fill just manpages, if requested
+  [ "${ezjail_installmanpages}" -a ! "${ezjail_basesystem}" ] && ezjail_installmanpages
+
   # Fill ports, if requested
   [ "${ezjail_installports}" ] && ezjail_updateports