From bccc28841facca8ece8b0ecac5b5f04cd6c545e0 Mon Sep 17 00:00:00 2001 From: Mark Hymers Date: Fri, 24 Aug 2001 20:45:42 +0000 Subject: [Bug 140] Sed consistencies git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@1020 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter05/fileutils-exp.xml | 4 ++++ chapter05/fileutils-inst.xml | 3 ++- chapter06/ed-inst.xml | 4 ++-- chapter06/glibc-exp.xml | 2 +- chapter06/glibc-inst.xml | 6 +++++- chapter06/man-inst.xml | 6 ++++-- chapter06/shadowpwd-exp.xml | 2 +- chapter06/shadowpwd-inst.xml | 10 +++++----- chapter06/sysvinit-inst.xml | 9 +++++---- chapter06/utillinux-inst.xml | 9 +++++---- 10 files changed, 34 insertions(+), 21 deletions(-) diff --git a/chapter05/fileutils-exp.xml b/chapter05/fileutils-exp.xml index fdaa829fd..4203a5579 100644 --- a/chapter05/fileutils-exp.xml +++ b/chapter05/fileutils-exp.xml @@ -1,6 +1,10 @@ Command explanations +cp lib/Makefile.in lib/Makefile.in.backup : We +run this command in order to keep a backup of the file we are about to +change. + sed 's/\(.*\)\(fopen-safer\.c \)\\/\1\2atexit.c \\/' \    lib/Makefile.in > tmp && sed 's/\(.*\)\(idcache\$U\.\$.*\)\\/\1\2atexit$U.$(OBJEXT) \\/' \ diff --git a/chapter05/fileutils-inst.xml b/chapter05/fileutils-inst.xml index 792ff1dc1..d1e09cad5 100644 --- a/chapter05/fileutils-inst.xml +++ b/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, run the following to sed commands before you compile this package. -sed 's/\(.*\)\(fopen-safer\.c \)\\/\1\2atexit.c \\/' \ +cp lib/Makefile.in lib/Makefile.in.backup && +sed 's/\(.*\)\(fopen-safer\.c \)\\/\1\2atexit.c \\/' \    lib/Makefile.in > tmp && sed 's/\(.*\)\(idcache\$U\.\$.*\)\\/\1\2atexit$U.$(OBJEXT) \\/' \    tmp > lib/Makefile.in diff --git a/chapter06/ed-inst.xml b/chapter06/ed-inst.xml index 698f0d299..052d8ab0f 100644 --- a/chapter06/ed-inst.xml +++ b/chapter06/ed-inst.xml @@ -3,8 +3,8 @@ Install Ed by running the following commands: -cp buf.c buf.c-temp && -sed 's/int u/int u, sfd/' buf.c-temp | \ +cp buf.c buf.c.backup && +sed 's/int u/int u, sfd/' buf.c.backup | \    sed '/.*\*mktemp.*/d' | \    sed 's/.*if (mktemp.*/ sfd = mkstemp(sfn);\    if ((sfd == -1) || (sfp = fopen (sfn, "w+")) == NULL)/' > buf.c diff --git a/chapter06/glibc-exp.xml b/chapter06/glibc-exp.xml index d49215c64..ab2c09f53 100644 --- a/chapter06/glibc-exp.xml +++ b/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 right now). -sed 's|$(PERL)|/usr/bin/perl|' +sed 's%\$(PERL)%/usr/bin/perl%' ../glibc-&glibc-version;/malloc/Makefile > tmp~: This sed command searches through ../glibc-&glibc-version;/malloc/Makefile and converts all occurances of $(PERL) to diff --git a/chapter06/glibc-inst.xml b/chapter06/glibc-inst.xml index 95ad570cb..ec3767dcb 100644 --- a/chapter06/glibc-inst.xml +++ b/chapter06/glibc-inst.xml @@ -12,9 +12,13 @@ would do. touch /etc/ld.so.conf && mkdir ../glibc-build && cd ../glibc-build && -sed 's|$(PERL)|/usr/bin/perl|' \ +cp -f ../glibc-&glibc-version;/malloc/Makefile \ +   ../glibc-&glibc-version;/malloc/Makefile.backup && +sed 's%\$(PERL)%/usr/bin/perl%' \    ../glibc-&glibc-version;/malloc/Makefile > tmp~ && mv -f tmp~ ../glibc-&glibc-version;/malloc/Makefile && +cp -f ../glibc-&glibc-version;/login/Makefile \ +   ../glibc-&glibc-version;/login/Makefile.backup && sed 's/root/0/' ../glibc-&glibc-version;/login/Makefile > tmp~ && mv -f tmp~ ../glibc-&glibc-version;/login/Makefile && ../glibc-&glibc-version;/configure \ diff --git a/chapter06/man-inst.xml b/chapter06/man-inst.xml index 1c457fc90..3b624f92f 100644 --- a/chapter06/man-inst.xml +++ b/chapter06/man-inst.xml @@ -4,8 +4,10 @@ Run the following commands to install man: for i in configure src/Makefile.in src/makewhatis.sh -do sed s/gawk/awk/g $i > $i.fixed -mv -f $i.fixed $i +do +   cp $i $i.backup && +   sed 's/gawk/awk/g' $i > tmp~ && +   mv -f tmp~ $i done chmod 700 configure && ./configure -default && diff --git a/chapter06/shadowpwd-exp.xml b/chapter06/shadowpwd-exp.xml index 5a2684570..97d4497d7 100644 --- a/chapter06/shadowpwd-exp.xml +++ b/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 details on the system. -sed "s|/var/spool/mail|/var/mail|" login.defs.linux > +sed "s%/var/spool/mail%/var/mail%" login.defs.linux > /etc/login.defs: /var/spool/mail is the old location of the user mailboxes. The location that is used nowadays is /var/mail. diff --git a/chapter06/shadowpwd-inst.xml b/chapter06/shadowpwd-inst.xml index aa95add10..50a7f3d13 100644 --- a/chapter06/shadowpwd-inst.xml +++ b/chapter06/shadowpwd-inst.xml @@ -4,16 +4,16 @@ Install the Shadow Password Suite by running the following commands: - -sed 's/\(.*\) (nflg || \(.*\))\(.*\)/\1\2\3/' \ -   src/useradd.c > useradd.c.temp && -mv -f useradd.c.temp src/useradd.c && +cp src/useradd.c src/useradd.c.backup && +sed 's/\(.*\) (nflg || \(.*\))\(.*\)/\1\2\3/' \ +   src/useradd.c > tmp~ && +mv -f tmp~ src/useradd.c && ./configure --prefix=/usr && make && make install && cd etc && cp -f limits login.access /etc && -sed "s|/var/spool/mail|/var/mail|" login.defs.linux > /etc/login.defs +sed 's%/var/spool/mail%/var/mail%' login.defs.linux > /etc/login.defs diff --git a/chapter06/sysvinit-inst.xml b/chapter06/sysvinit-inst.xml index 5174d4601..1ebc5bd5e 100644 --- a/chapter06/sysvinit-inst.xml +++ b/chapter06/sysvinit-inst.xml @@ -12,10 +12,11 @@ processes started by init the TERM signal". Install Sysvinit by running the following commands: -sed \ -   's/\(.*\)\(Sending processes\)\(.*\)/\1\2 started by init\3/' \ -   src/init.c > init.c.temp && -mv -f init.c.temp src/init.c && +cp src/init.c src/init.c.backup && +sed \ +   's/\(.*\)\(Sending processes\)\(.*\)/\1\2 started by init\3/' \ +   src/init.c > tmp~ && +mv -f tmp~ src/init.c && make -C src && make -C src install diff --git a/chapter06/utillinux-inst.xml b/chapter06/utillinux-inst.xml index 9bad2860e..b59dcf12d 100644 --- a/chapter06/utillinux-inst.xml +++ b/chapter06/utillinux-inst.xml @@ -5,10 +5,11 @@ adjtime file, instead of the usual /etc. To make hwclock, which is part of the util-linux package, FHS-compliant, run the following. -sed 's|etc/adjtime|var/lib/hwclock/adjtime|' \ -   hwclock/hwclock.c > hwclock~ && -mv -f hwclock~ hwclock/hwclock.c && -mkdir /var/lib/hwclock +cp hwclock/hwclock.c hwclock/hwclock.c.backup && +sed 's%etc/adjtime%var/lib/hwclock/adjtime%' \ +   hwclock/hwclock.c > tmp~ && +mv -f tmp~ hwclock/hwclock.c && +mkdir -p /var/lib/hwclock -- cgit v1.2.3-54-g00ecf