Pārlūkot izejas kodu

[Bug 140] Sed consistencies

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@1020 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Mark Hymers 24 gadi atpakaļ
vecāks
revīzija
bccc28841f

+ 4 - 0
chapter05/fileutils-exp.xml

@@ -1,6 +1,10 @@
 <sect2>
 <sect2>
 <title>Command explanations</title>
 <title>Command explanations</title>
 
 
+<para><userinput>cp lib/Makefile.in lib/Makefile.in.backup :</userinput> We 
+run this command in order to keep a backup of the file we are about to
+change.</para>
+
 <para><screen><userinput>sed 's/\(.*\)\(fopen-safer\.c \)\\/\1\2atexit.c \\/' \</userinput>
 <para><screen><userinput>sed 's/\(.*\)\(fopen-safer\.c \)\\/\1\2atexit.c \\/' \</userinput>
 <userinput>&nbsp;&nbsp;&nbsp;lib/Makefile.in &gt; tmp &amp;&amp;</userinput>
 <userinput>&nbsp;&nbsp;&nbsp;lib/Makefile.in &gt; tmp &amp;&amp;</userinput>
 <userinput>sed 's/\(.*\)\(idcache\$U\.\$.*\)\\/\1\2atexit$U.$(OBJEXT) \\/' \</userinput>
 <userinput>sed 's/\(.*\)\(idcache\$U\.\$.*\)\\/\1\2atexit$U.$(OBJEXT) \\/' \</userinput>

+ 2 - 1
chapter05/fileutils-inst.xml

@@ -7,7 +7,8 @@ limited to, Linux systems that run Glibc-2.2.3 with an AMD CPU (Athlons
 and Durons are the most reported used CPU's). If you are in this category, 
 and Durons are the most reported used CPU's). If you are in this category, 
 run the following to sed commands before you compile this package.
 run the following to sed commands before you compile this package.
 
 
-<screen><userinput>sed 's/\(.*\)\(fopen-safer\.c \)\\/\1\2atexit.c \\/' \</userinput>
+<screen><userinput>cp lib/Makefile.in lib/Makefile.in.backup &amp;&amp;</userinput>
+<userinput>sed 's/\(.*\)\(fopen-safer\.c \)\\/\1\2atexit.c \\/' \</userinput>
 <userinput>&nbsp;&nbsp;&nbsp;lib/Makefile.in &gt; tmp &amp;&amp;</userinput>
 <userinput>&nbsp;&nbsp;&nbsp;lib/Makefile.in &gt; tmp &amp;&amp;</userinput>
 <userinput>sed 's/\(.*\)\(idcache\$U\.\$.*\)\\/\1\2atexit$U.$(OBJEXT) \\/' \</userinput>
 <userinput>sed 's/\(.*\)\(idcache\$U\.\$.*\)\\/\1\2atexit$U.$(OBJEXT) \\/' \</userinput>
 <userinput>&nbsp;&nbsp;&nbsp;tmp &gt; lib/Makefile.in</userinput></screen></para>
 <userinput>&nbsp;&nbsp;&nbsp;tmp &gt; lib/Makefile.in</userinput></screen></para>

+ 2 - 2
chapter06/ed-inst.xml

@@ -3,8 +3,8 @@
 
 
 <para>Install Ed by running the following commands:</para>
 <para>Install Ed by running the following commands:</para>
 
 
-<para><screen><userinput>cp buf.c buf.c-temp &amp;&amp;</userinput>
-<userinput>sed 's/int u/int u, sfd/' buf.c-temp | \</userinput>
+<para><screen><userinput>cp buf.c buf.c.backup &amp;&amp;</userinput>
+<userinput>sed 's/int u/int u, sfd/' buf.c.backup | \</userinput>
 <userinput>&nbsp;&nbsp;&nbsp;sed '/.*\*mktemp.*/d' | \</userinput>
 <userinput>&nbsp;&nbsp;&nbsp;sed '/.*\*mktemp.*/d' | \</userinput>
 <userinput>&nbsp;&nbsp;&nbsp;sed 's/.*if (mktemp.*/  sfd = mkstemp(sfn);\</userinput>
 <userinput>&nbsp;&nbsp;&nbsp;sed 's/.*if (mktemp.*/  sfd = mkstemp(sfn);\</userinput>
 <userinput>&nbsp;&nbsp;&nbsp;if ((sfd == -1) || (sfp = fopen (sfn, "w+")) == NULL)/' &gt; buf.c</userinput>
 <userinput>&nbsp;&nbsp;&nbsp;if ((sfd == -1) || (sfp = fopen (sfn, "w+")) == NULL)/' &gt; buf.c</userinput>

+ 1 - 1
chapter06/glibc-exp.xml

@@ -12,7 +12,7 @@ that it can't read the file, so we simply create an empty file (the empty file
 will have Glibc default to using /lib and /usr/lib which is fine 
 will have Glibc default to using /lib and /usr/lib which is fine 
 right now).</para>
 right now).</para>
 
 
-<para><userinput>sed 's|$(PERL)|/usr/bin/perl|' 
+<para><userinput>sed 's%\$(PERL)%/usr/bin/perl%' 
 ../glibc-&glibc-version;/malloc/Makefile &gt; tmp~:</userinput> This sed command
 ../glibc-&glibc-version;/malloc/Makefile &gt; tmp~:</userinput> This sed command
 searches through <filename>../glibc-&glibc-version;/malloc/Makefile</filename> and
 searches through <filename>../glibc-&glibc-version;/malloc/Makefile</filename> and
 converts all occurances of <filename>$(PERL)</filename> to
 converts all occurances of <filename>$(PERL)</filename> to

+ 5 - 1
chapter06/glibc-inst.xml

@@ -12,9 +12,13 @@ would do.</para>
 <userinput>touch /etc/ld.so.conf &amp;&amp;</userinput>
 <userinput>touch /etc/ld.so.conf &amp;&amp;</userinput>
 <userinput>mkdir ../glibc-build &amp;&amp;</userinput>
 <userinput>mkdir ../glibc-build &amp;&amp;</userinput>
 <userinput>cd ../glibc-build &amp;&amp;</userinput>
 <userinput>cd ../glibc-build &amp;&amp;</userinput>
-<userinput>sed 's|$(PERL)|/usr/bin/perl|' \</userinput>
+<userinput>cp -f ../glibc-&glibc-version;/malloc/Makefile \</userinput>
+<userinput>&nbsp;&nbsp;&nbsp;../glibc-&glibc-version;/malloc/Makefile.backup &amp;&amp;</userinput>
+<userinput>sed 's%\$(PERL)%/usr/bin/perl%' \</userinput>
 <userinput>&nbsp;&nbsp;&nbsp;../glibc-&glibc-version;/malloc/Makefile &gt; tmp~ &amp;&amp;</userinput>
 <userinput>&nbsp;&nbsp;&nbsp;../glibc-&glibc-version;/malloc/Makefile &gt; tmp~ &amp;&amp;</userinput>
 <userinput>mv -f tmp~ ../glibc-&glibc-version;/malloc/Makefile &amp;&amp;</userinput>
 <userinput>mv -f tmp~ ../glibc-&glibc-version;/malloc/Makefile &amp;&amp;</userinput>
+<userinput>cp -f ../glibc-&glibc-version;/login/Makefile \</userinput>
+<userinput>&nbsp;&nbsp;&nbsp;../glibc-&glibc-version;/login/Makefile.backup &amp;&amp;</userinput>
 <userinput>sed 's/root/0/' ../glibc-&glibc-version;/login/Makefile &gt; tmp~ &amp;&amp;</userinput>
 <userinput>sed 's/root/0/' ../glibc-&glibc-version;/login/Makefile &gt; tmp~ &amp;&amp;</userinput>
 <userinput>mv -f tmp~ ../glibc-&glibc-version;/login/Makefile &amp;&amp;</userinput>
 <userinput>mv -f tmp~ ../glibc-&glibc-version;/login/Makefile &amp;&amp;</userinput>
 <userinput>../glibc-&glibc-version;/configure \</userinput>
 <userinput>../glibc-&glibc-version;/configure \</userinput>

+ 4 - 2
chapter06/man-inst.xml

@@ -4,8 +4,10 @@
 <para>Run the following commands to install man:</para>
 <para>Run the following commands to install man:</para>
 
 
 <para><screen><userinput>for i in configure src/Makefile.in src/makewhatis.sh</userinput>
 <para><screen><userinput>for i in configure src/Makefile.in src/makewhatis.sh</userinput>
-<userinput>do sed s/gawk/awk/g $i &gt; $i.fixed</userinput>
-<userinput>mv -f $i.fixed $i</userinput>
+<userinput>do</userinput>
+<userinput>&nbsp;&nbsp;&nbsp;cp $i $i.backup &amp;&amp;</userinput>
+<userinput>&nbsp;&nbsp;&nbsp;sed 's/gawk/awk/g' $i &gt; tmp~ &amp;&amp;</userinput>
+<userinput>&nbsp;&nbsp;&nbsp;mv -f tmp~ $i</userinput>
 <userinput>done</userinput>
 <userinput>done</userinput>
 <userinput>chmod 700 configure &amp;&amp;</userinput>
 <userinput>chmod 700 configure &amp;&amp;</userinput>
 <userinput>./configure -default &amp;&amp;</userinput>
 <userinput>./configure -default &amp;&amp;</userinput>

+ 1 - 1
chapter06/shadowpwd-exp.xml

@@ -11,7 +11,7 @@ were not installed during the installation of the package so we copy
 them manually as those files are used to configure authentication
 them manually as those files are used to configure authentication
 details on the system.</para>
 details on the system.</para>
 
 
-<para><userinput>sed "s|/var/spool/mail|/var/mail|" login.defs.linux &gt;
+<para><userinput>sed "s%/var/spool/mail%/var/mail%" login.defs.linux &gt;
 /etc/login.defs</userinput>: /var/spool/mail is the old location of the
 /etc/login.defs</userinput>: /var/spool/mail is the old location of the
 user mailboxes. The location that is used nowadays is /var/mail.</para>
 user mailboxes. The location that is used nowadays is /var/mail.</para>
 
 

+ 5 - 5
chapter06/shadowpwd-inst.xml

@@ -4,16 +4,16 @@
 <para>Install the Shadow Password Suite by running the 
 <para>Install the Shadow Password Suite by running the 
 following commands:</para>
 following commands:</para>
 
 
-
-<para><screen><userinput>sed 's/\(.*\) (nflg || \(.*\))\(.*\)/\1\2\3/' \</userinput>
-<userinput>&nbsp;&nbsp;&nbsp;src/useradd.c &gt; useradd.c.temp &amp;&amp;</userinput>
-<userinput>mv -f useradd.c.temp src/useradd.c &amp;&amp;</userinput>
+<para><screen><userinput>cp src/useradd.c src/useradd.c.backup &amp;&amp;</userinput>
+<userinput>sed 's/\(.*\) (nflg || \(.*\))\(.*\)/\1\2\3/' \</userinput>
+<userinput>&nbsp;&nbsp;&nbsp;src/useradd.c &gt; tmp~ &amp;&amp;</userinput>
+<userinput>mv -f tmp~ src/useradd.c &amp;&amp;</userinput>
 <userinput>./configure --prefix=/usr &amp;&amp;</userinput>
 <userinput>./configure --prefix=/usr &amp;&amp;</userinput>
 <userinput>make &amp;&amp;</userinput>
 <userinput>make &amp;&amp;</userinput>
 <userinput>make install &amp;&amp;</userinput>
 <userinput>make install &amp;&amp;</userinput>
 <userinput>cd etc &amp;&amp;</userinput>
 <userinput>cd etc &amp;&amp;</userinput>
 <userinput>cp -f limits login.access /etc &amp;&amp;</userinput>
 <userinput>cp -f limits login.access /etc &amp;&amp;</userinput>
-<userinput>sed "s|/var/spool/mail|/var/mail|" login.defs.linux &gt; /etc/login.defs</userinput></screen></para>
+<userinput>sed 's%/var/spool/mail%/var/mail%' login.defs.linux &gt; /etc/login.defs</userinput></screen></para>
 
 
 </sect2>
 </sect2>
 
 

+ 5 - 4
chapter06/sysvinit-inst.xml

@@ -12,10 +12,11 @@ processes started by init the TERM signal".</para>
 
 
 <para>Install Sysvinit by running the following commands:</para>
 <para>Install Sysvinit by running the following commands:</para>
 
 
-<para><screen><userinput>sed \</userinput>
-<userinput>&nbsp;&nbsp;&nbsp;'s/\(.*\)\(Sending processes\)\(.*\)/\1\2 started by init\3/' \</userinput> 
-<userinput>&nbsp;&nbsp;&nbsp;src/init.c &gt; init.c.temp &amp;&amp;</userinput>
-<userinput>mv -f init.c.temp src/init.c &amp;&amp;</userinput>
+<para><screen><userinput>cp src/init.c src/init.c.backup &amp;&amp;</userinput>
+<userinput>sed \</userinput>
+<userinput>&nbsp;&nbsp;&nbsp;'s/\(.*\)\(Sending processes\)\(.*\)/\1\2 started by init\3/' \</userinput>
+<userinput>&nbsp;&nbsp;&nbsp;src/init.c &gt; tmp~ &amp;&amp;</userinput>
+<userinput>mv -f tmp~ src/init.c &amp;&amp;</userinput>
 <userinput>make -C src &amp;&amp;</userinput>
 <userinput>make -C src &amp;&amp;</userinput>
 <userinput>make -C src install</userinput></screen></para>
 <userinput>make -C src install</userinput></screen></para>
 
 

+ 5 - 4
chapter06/utillinux-inst.xml

@@ -5,10 +5,11 @@
 adjtime file, instead of the usual /etc. To make hwclock, which is part of the
 adjtime file, instead of the usual /etc. To make hwclock, which is part of the
 util-linux package, FHS-compliant, run the following.</para>
 util-linux package, FHS-compliant, run the following.</para>
 
 
-<para><screen><userinput>sed 's|etc/adjtime|var/lib/hwclock/adjtime|' \</userinput>
-<userinput>&nbsp;&nbsp;&nbsp;hwclock/hwclock.c &gt; hwclock~ &amp;&amp;</userinput>
-<userinput>mv -f hwclock~ hwclock/hwclock.c &amp;&amp;</userinput>
-<userinput>mkdir /var/lib/hwclock</userinput></screen></para>
+<para><screen><userinput>cp hwclock/hwclock.c hwclock/hwclock.c.backup &amp;&amp;</userinput>
+<userinput>sed 's%etc/adjtime%var/lib/hwclock/adjtime%' \</userinput>
+<userinput>&nbsp;&nbsp;&nbsp;hwclock/hwclock.c &gt; tmp~ &amp;&amp;</userinput>
+<userinput>mv -f tmp~ hwclock/hwclock.c &amp;&amp;</userinput>
+<userinput>mkdir -p /var/lib/hwclock</userinput></screen></para>
 
 
 </sect2>
 </sect2>