[BACK]Return to fw_install.sh CVS log [TXT][DIR] Up to [local] / openbsd / fw_update

Diff for /openbsd/fw_update/fw_install.sh between version 1.127 and 1.129

version 1.127, 2021/12/25 02:38:33 version 1.129, 2021/12/25 04:04:41
Line 41 
Line 41 
 LOCALSRC=  LOCALSRC=
   
 unset FTPPID  unset FTPPID
   unset FWPKGTMP
 REMOVE_LOCALSRC=false  REMOVE_LOCALSRC=false
 cleanup() {  cleanup() {
         set +o errexit # ignore errors from killing ftp          set +o errexit # ignore errors from killing ftp
         [ "${FTPPID:-}" ] && kill -TERM -"$FTPPID" #2>/dev/null          [ "${FTPPID:-}" ] && kill -TERM -"$FTPPID" 2>/dev/null
           [ "${FWPKGTMP:-}" ] && rm -rf "$FWPKGTMP"
         "$REMOVE_LOCALSRC" && rm -rf "$LOCALSRC"          "$REMOVE_LOCALSRC" && rm -rf "$LOCALSRC"
 }  }
 trap cleanup EXIT  trap cleanup EXIT
Line 195 
Line 197 
   
 add_firmware () {  add_firmware () {
         local _f="${1##*/}" _pkgname          local _f="${1##*/}" _pkgname
         local _tmpdir="$( tmpdir "${DESTDIR}/var/db/pkg/.firmware" )"          FWPKGTMP="$( tmpdir "${DESTDIR}/var/db/pkg/.firmware" )"
         local flags=-VM          local flags=-VM
         "$VERBOSE" && flags=-vm          "$VERBOSE" && flags=-vm
         ftp -N "${0##/}" -D "Install" "$flags" -o- "file:${1}" |          ftp -N "${0##/}" -D "Install" "$flags" -o- "file:${1}" |
                 tar -s ",^\+,${_tmpdir}/+," \                  tar -s ",^\+,${FWPKGTMP}/+," \
                     -s ",^firmware,${DESTDIR}/etc/firmware," \                      -s ",^firmware,${DESTDIR}/etc/firmware," \
                     -C / -zxphf - "+*" "firmware/*"                      -C / -zxphf - "+*" "firmware/*"
   
         _pkgname="$( sed -n '/^@name /{s///p;q;}' "${_tmpdir}/+CONTENTS" )"          _pkgname="$( sed -n '/^@name /{s///p;q;}' "${FWPKGTMP}/+CONTENTS" )"
         if [ ! "$_pkgname" ]; then          if [ ! "$_pkgname" ]; then
                 echo "Failed to extract name from $1, partial install" 2>&1                  echo "Failed to extract name from $1, partial install" 2>&1
                 rm -rf "$_tmpdir"                  rm -rf "$FWPKGTMP"
                   unset FWPKGTMP
                 return 1                  return 1
         fi          fi
   
         # TODO: Should we mark these so real fw_update can -Drepair?          # TODO: Should we mark these so real fw_update can -Drepair?
         ed -s "${_tmpdir}/+CONTENTS" <<EOL          ed -s "${FWPKGTMP}/+CONTENTS" <<EOL
 /^@comment pkgpath/ -1a  /^@comment pkgpath/ -1a
 @option manual-installation  @option manual-installation
 @option firmware  @option firmware
Line 220 
Line 223 
 w  w
 EOL  EOL
   
         chmod 755 "$_tmpdir"          chmod 755 "$FWPKGTMP"
         mv "$_tmpdir" "${DESTDIR}/var/db/pkg/${_pkgname}"          mv "$FWPKGTMP" "${DESTDIR}/var/db/pkg/${_pkgname}"
           unset FWPKGTMP
 }  }
   
 delete_firmware() {  delete_firmware() {

Legend:
Removed from v.1.127  
changed lines
  Added in v.1.129

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>