Ticket #2647: BOOK-9258-no_head-0.1.patch

File BOOK-9258-no_head-0.1.patch, 3.4 KB (added by tito_puentes, 15 years ago)

use sed instead of head

  • bootscripts/contrib/lsb/lib/init-functions

    diff -Naur BOOK.orig/bootscripts/contrib/lsb/lib/init-functions BOOK/bootscripts/contrib/lsb/lib/init-functions
    old new  
    226226                        return 3 # Program is not running
    227227                fi
    228228
    229                 lpids=`head -n 1 ${pidfile}`
     229                lpids=`sed 1q ${pidfile}`
    230230                for pid in ${lpids}
    231231                do
    232232                        if [ "${pid}" -ne "$$" -a "${pid}" -ne "${PPID}" ]; then
  • bootscripts/contrib/lsb-v3/lsb/init-functions

    diff -Naur BOOK.orig/bootscripts/contrib/lsb-v3/lsb/init-functions BOOK/bootscripts/contrib/lsb-v3/lsb/init-functions
    old new  
    401401    if [ -n "${pidfile}" -a -e "${pidfile}" ]
    402402    then
    403403        # use the value in the first line of the pidfile
    404         pidlist=`/bin/head -n1 "${pidfile}"`
    405         # This can optionally be written as 'sed 1q' to repalce 'head -n1'
    406         # should LFS move /bin/head to /usr/bin/head
     404        pidlist=`/bin/sed 1q "${pidfile}"`
    407405    else
    408406        # use pidof
    409407        pidlist=`pidof "${program}"`
  • bootscripts/contrib/lsb-v3/lsb/manage-functions

    diff -Naur BOOK.orig/bootscripts/contrib/lsb-v3/lsb/manage-functions BOOK/bootscripts/contrib/lsb-v3/lsb/manage-functions
    old new  
    5757        diff=$(( ${end} - ${begin} ))
    5858        # assign the entire LSB header information as a single string to the
    5959        # fullheaders[] array
    60         fullheaders["${count}"]=$(head -n "${end}" "${file}" \
     60        fullheaders["${count}"]=$(sed "${end}q" "${file}" \
    6161                                    | tail -n "${diff}")
    6262        count=$(( ${count} + 1 ))
    6363        unset begin
  • bootscripts/lfs/init.d/functions

    diff -Naur BOOK.orig/bootscripts/lfs/init.d/functions BOOK/bootscripts/lfs/init.d/functions
    old new  
    444444                        return 3 # Program is not running
    445445                fi
    446446
    447                 lpids=`head -n 1 ${pidfile}`
     447                lpids=`sed 1q ${pidfile}`
    448448                for pid in ${lpids}
    449449                do
    450450                        if [ "${pid}" -ne "$$" -a "${pid}" -ne "${PPID}" ]; then
  • chapter06/coreutils.xml

    diff -Naur BOOK.orig/chapter06/coreutils.xml BOOK/chapter06/coreutils.xml
    old new  
    125125mv -v /usr/bin/chroot /usr/sbin</userinput></screen>
    126126
    127127    <para>Some of the scripts in the LFS-Bootscripts package depend on
    128     <command>head</command>, <command>sleep</command>, and
    129     <command>nice</command>.  As <filename class="directory">/usr</filename>
    130     may not be available during the early stages of booting, those binaries
    131     need to be on the root partition:</para>
     128    <command>sleep</command> and <command>nice</command>.  As
     129    <filename class="directory">/usr</filename> may not be available
     130    during the early stages of booting, those binaries need to be on
     131    the root partition:</para>
    132132
    133 <screen><userinput remap="install">mv -v /usr/bin/{head,sleep,nice} /bin</userinput></screen>
     133<screen><userinput remap="install">mv -v /usr/bin/{sleep,nice} /bin</userinput></screen>
    134134
    135135  </sect2>
    136136