help-smalltalk
[Top][All Lists]
Advanced

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

Re: [Help-smalltalk] BSD sed fix


From: Paolo Bonzini
Subject: Re: [Help-smalltalk] BSD sed fix
Date: Tue, 09 Sep 2003 17:01:39 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021226 Debian/1.2.1-9



Additionally, it appears the installed packages.xml file was omitted
so only the files specified on the command line where merged and
installed.  I assume the installed one is supposed to be implicit?

There is a bug in the code that tries to make it implicit *if it is not
specified on the command line*.  That's above the non-portable sed
invocation.  The correct snippet is:

  base="$DESTDIR$IMAGE_PATH/packages.xml"
  if test -f $base; then
    for i in $files; do
      if test $i -ef $base; then
        add=
        break
      fi
    done
    files="$base${base:+ }$files"
  fi

  echo "Merging $files..."
  $dry_run || {
    sed -e '$i\
</packages>' -e '/<.packages>/,/<packages>/d' \
      $files > packages.tmp

    mv packages.tmp $DESTDIR$IMAGE_PATH/packages.xml
  }

Paolo






reply via email to

[Prev in Thread] Current Thread [Next in Thread]