Replace sed -i ... with sponge calls
authorMichael Prokop <mika@grml.org>
Sun, 22 Feb 2009 23:12:30 +0000 (00:12 +0100)
committerMichael Prokop <mika@grml.org>
Mon, 23 Feb 2009 00:04:28 +0000 (01:04 +0100)
debian/changelog
debian/control
grml-live

index a7fd733..7f34c24 100644 (file)
@@ -40,8 +40,15 @@ grml-live (0.9.9) unstable; urgency=low
   * Install all files from /etc/grml/fai/files/etc/apt. This supports
     usage of directories like /etc/apt/apt.conf.d. Thanks for the
     hint to Thomas Lehmann. [Closes: issue632]
   * Install all files from /etc/grml/fai/files/etc/apt. This supports
     usage of directories like /etc/apt/apt.conf.d. Thanks for the
     hint to Thomas Lehmann. [Closes: issue632]
-
- -- Michael Prokop <mika@grml.org>  Sat, 21 Feb 2009 15:20:44 +0100
+  * Replace all "sed -i 's/././' foo" calls with
+    'sed -i 's/././' foo | sponge foo' instead inside main grml-live script
+    so we don't destroy any existing symlinks. Depend on moreutils therefor.
+    [Closes: issue631]
+  * Integrate bsd4grml [hash: 987ce9a6f9ce205ba64794ed3fcac603]. This
+    provides MirBSD as bootoption 'bsd' at grml's bootprompt. Thanks to
+    Thorsten "mirabilos" Glaser for his work!
+
+ -- Michael Prokop <mika@grml.org>  Mon, 23 Feb 2009 00:10:53 +0100
 
 grml-live (0.9.8) unstable; urgency=low
 
 
 grml-live (0.9.8) unstable; urgency=low
 
index 5818e88..e64ce67 100644 (file)
@@ -11,7 +11,7 @@ Vcs-Browser: http://git.grml.org/?p=grml-live.git
 
 Package: grml-live
 Architecture: all
 
 Package: grml-live
 Architecture: all
-Depends: fai-client (>= 3.2.4), fai-server (>= 3.2.4), memtest86+ [i386 amd64], mkisofs | genisoimage, squashfs-lzma-tools | squashfs-tools, wget
+Depends: fai-client (>= 3.2.4), fai-server (>= 3.2.4), memtest86+ [i386 amd64], mkisofs | genisoimage, squashfs-lzma-tools | squashfs-tools, wget, moreutils
 Suggests: fai-doc
 Description: build system for creating a grml (based) live-cd
  This package provides the build system for creating
 Suggests: fai-doc
 Description: build system for creating a grml (based) live-cd
  This package provides the build system for creating
index cfbc0b3..477bded 100755 (executable)
--- a/grml-live
+++ b/grml-live
@@ -347,21 +347,21 @@ elif [ -n "$GRML_LIVE_SOURCES" ] ; then
 fi
 
 if [ -n "$FAI_DEBOOTSTRAP" ] ; then
 fi
 
 if [ -n "$FAI_DEBOOTSTRAP" ] ; then
-   sed -i "s#^FAI_DEBOOTSTRAP=.*#FAI_DEBOOTSTRAP=\"$FAI_DEBOOTSTRAP\"#" $NFSROOT_CONF
+   sed "s#^FAI_DEBOOTSTRAP=.*#FAI_DEBOOTSTRAP=\"$FAI_DEBOOTSTRAP\"#" "$NFSROOT_CONF" | sponge "$NFSROOT_CONF"
 fi
 
 # does this suck? YES!
 if [ -n "$SUITE" ] ; then
 
 fi
 
 # does this suck? YES!
 if [ -n "$SUITE" ] ; then
 
+   DIST=" etch\| stable\| lenny\| squeeze\| testing\| sid\| unstable"
+   sed "s/\(deb .\+\)\([ \t]*\) $DIST\([ \t]*\)\(main \)/\1\2 $SUITE \3\4/" /etc/grml/fai/apt/sources.list | sponge /etc/grml/fai/apt/sources.list
    for file in "$LIVE_CONF" "$CONFIG" "$LOCAL_CONFIG" ; do
        if [ -n "$file" ] ; then
    for file in "$LIVE_CONF" "$CONFIG" "$LOCAL_CONFIG" ; do
        if [ -n "$file" ] ; then
-          sed -i "s/SUITE=.*/SUITE=\"$SUITE\"/" $LIVE_CONF
-          DIST="\|\ etch\ \|\ stable\ \|\ lenny\ \|\ squeeze \|\ testing\ \|\ sid\ \|\ unstable\ "
-          sed -i "s/\(deb .\+\)\([ \t]+\)$DIST\([ \t]+\)\(main \)/\1\2 $SUITE \3\4/" $file
+          sed "s/SUITE=.*/SUITE=\"$SUITE\"/" $LIVE_CONF | sponge $LIVE_CONF
+          sed "s/\(deb .\+\)\([ \t]*\) $DIST\([ \t]*\)\(main \)/\1\2 $SUITE \3\4/" "$file" | sponge "$file"
        fi
    done
 
        fi
    done
 
-   sed -i "s/\(deb .\+\)\([ \t]+\)$DIST\([ \t]+\)\(main \)/\1\2 $SUITE \3\4/" /etc/grml/fai/apt/sources.list
    # notice: activate grml-live pool only if we are building against unstable:
    if grep -qe unstable -qe sid /etc/grml/fai/apt/sources.list ; then
       grep -q 'grml-live.*main' /etc/grml/fai/apt/sources.list || \
    # notice: activate grml-live pool only if we are building against unstable:
    if grep -qe unstable -qe sid /etc/grml/fai/apt/sources.list ; then
       grep -q 'grml-live.*main' /etc/grml/fai/apt/sources.list || \
@@ -369,23 +369,24 @@ if [ -n "$SUITE" ] ; then
            sed 's/grml-stable/grml-live/' >> /etc/grml/fai/apt/sources.list
    else
       grep -q 'grml-live.*main' /etc/grml/fai/apt/sources.list && \
            sed 's/grml-stable/grml-live/' >> /etc/grml/fai/apt/sources.list
    else
       grep -q 'grml-live.*main' /etc/grml/fai/apt/sources.list && \
-      sed -i 's/.*grml-live.*/# removed grml-live repository/' /etc/grml/fai/apt/sources.list
+      sed 's/.*grml-live.*/# removed grml-live repository/' /etc/grml/fai/apt/sources.list | sponge /etc/grml/fai/apt/sources.list
    fi
 
    for file in "$LIVE_CONF" "$CONFIG" "$LOCAL_CONFIG" ; do
        if [ -n "$file" ] ; then
    fi
 
    for file in "$LIVE_CONF" "$CONFIG" "$LOCAL_CONFIG" ; do
        if [ -n "$file" ] ; then
-          sed -i "s|FAI_DEBOOTSTRAP=\"[a-z]* |FAI_DEBOOTSTRAP=\"$SUITE |" "$file"
+          sed "s|FAI_DEBOOTSTRAP=\"[a-z]* |FAI_DEBOOTSTRAP=\"$SUITE |" "$file" | sponge "$file"
        fi
    done
        fi
    done
-   sed -i "s|FAI_DEBOOTSTRAP=\"[a-z]* |FAI_DEBOOTSTRAP=\"$SUITE |" $NFSROOT_CONF
+
+   sed "s|FAI_DEBOOTSTRAP=\"[a-z]* |FAI_DEBOOTSTRAP=\"$SUITE |" "$NFSROOT_CONF" | sponge "$NFSROOT_CONF"
 fi
 
 # set $ARCH
 [ -n "$ARCH" ] || ARCH="$(dpkg --print-architecture)"
 fi
 
 # set $ARCH
 [ -n "$ARCH" ] || ARCH="$(dpkg --print-architecture)"
-if grep -q -- 'FAI_DEBOOTSTRAP_OPTS.*--arch' $NFSROOT_CONF ; then
-   sed -i "s/--arch [a-z0-9]* /--arch $ARCH /" $NFSROOT_CONF
+if grep -q -- 'FAI_DEBOOTSTRAP_OPTS.*--arch' "$NFSROOT_CONF" ; then
+   sed "s/--arch [a-z0-9]* /--arch $ARCH /" "$NFSROOT_CONF" | sponge "$NFSROOT_CONF"
 else
 else
-   sed -i "s|FAI_DEBOOTSTRAP_OPTS=\"\(.*\)|FAI_DEBOOTSTRAP_OPTS=\"--arch $ARCH \1|" $NFSROOT_CONF
+   sed "s|FAI_DEBOOTSTRAP_OPTS=\"\(.*\)|FAI_DEBOOTSTRAP_OPTS=\"--arch $ARCH \1|" "$NFSROOT_CONF" | sponge "$NFSROOT_CONF"
 fi
 # }}}
 
 fi
 # }}}