Bug 219256 - [PATCH] sysutils/beadm: Update to 1.2.7
Summary: [PATCH] sysutils/beadm: Update to 1.2.7
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Emanuel Haupt
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2017-05-13 12:24 UTC by Emanuel Haupt
Modified: 2017-07-08 16:47 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (bdrewery)


Attachments
Update sysutils/beadm to 1.2.7 (787 bytes, patch)
2017-05-13 12:24 UTC, Emanuel Haupt
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Emanuel Haupt freebsd_committer 2017-05-13 12:24:22 UTC
Created attachment 182564 [details]
Update sysutils/beadm to 1.2.7

Update sysutils/beadm to 1.2.7
Comment 1 commit-hook freebsd_committer 2017-07-04 07:24:08 UTC
A commit references this bug:

Author: ehaupt
Date: Tue Jul  4 07:23:10 UTC 2017
New revision: 444999
URL: https://svnweb.freebsd.org/changeset/ports/444999

Log:
  Update to 1.2.7

  PR:		219256
  Approved by:	bdrewery (maintainer timeout; 52 days)

Changes:
  head/sysutils/beadm/Makefile
  head/sysutils/beadm/distinfo
Comment 2 Bryan Drewery freebsd_committer 2017-07-05 19:49:41 UTC
I missed this, but I was purposely not updating beadm. The newer versions are just full of regressions.
Comment 3 Bryan Drewery freebsd_committer 2017-07-05 19:55:13 UTC
(In reply to Bryan Drewery from comment #2)
> I missed this, but I was purposely not updating beadm. The newer versions
> are just full of regressions.

Such as completely dropping the entropy file fixes.

commit b5ba885aacb7ae8666836a5aa6391e72f6390fc5
Author: vermaden <vermaden@w530.local>
Date:   Sat Jan 14 00:25:44 2017 +0100

    Fix *beadm list -a* awk bug.

diff --git beadm beadm
index f817e40..6a0e397 100755
--- beadm
+++ beadm
@@ -37,7 +37,7 @@ fi

 if [ "${1}" = "--version" -o "${1}" = "version" ]
 then
-  echo "beadm 1.2.6 2015/09/17"
+  echo "beadm 1.2.7 2017/01/14"
   exit 0
 fi

@@ -128,24 +128,6 @@ __be_new() { # 1=SOURCE 2=TARGET
   unset NAME_NEW
   unset NAME_SANITY
   local SOURCE=$( echo ${1} | cut -d '@' -f 1 )
-  local ENTROPY=0
-  # secure current /boot/entropy file
-  if [ -f /boot/entropy ]
-  then
-    if ! cp -p /boot/entropy /boot/entropy.OLD 1> /dev/null 2> /dev/null
-    then
-      echo "ERROR: Can not copy current '/boot/entropy' file"
-      exit 1
-    fi
-    ENTROPY=1
-  fi
-  # create new /boot/entropy file that would be used in new boot environment
-  if ! dd if=/dev/random of=/boot/entropy bs=4096 count=1 1> /dev/null 2> /dev/null
-  then
-    echo "ERROR: Can not generate new '/boot/entropy' file"
-    exit 1
-  fi
-  # create snapshot that will be used as a base for new boot environment
   if __be_snapshot ${1}
   then
     # create boot environment from snapshot
@@ -156,13 +138,6 @@ __be_new() { # 1=SOURCE 2=TARGET
           if ! zfs list -H -o name ${FS}@${SNAPSHOT} 1> /dev/null 2> /dev/null
           then
             echo "ERROR: Child snapshot '${FS}@${SNAPSHOT}' does not exist"
-            if [ ${ENTROPY} -ne 0 ]
-            then
-              if ! mv /boot/entropy.OLD /boot/entropy 1> /dev/null 2> /dev/null
-              then
-                echo "WARNING: Can not bring back original '/boot/entropy' file"
-              fi
-            fi
             exit 1
           fi
         done
@@ -171,13 +146,6 @@ __be_new() { # 1=SOURCE 2=TARGET
     if zfs list -H -o name ${1}@${2##*/} 1> /dev/null 2> /dev/null
     then
       echo "ERROR: Snapshot '${1}@${2##*/}' already exists"
-      if [ ${ENTROPY} -ne 0 ]
-      then
-        if ! mv /boot/entropy.OLD /boot/entropy 1> /dev/null 2> /dev/null
-        then
-          echo "WARNING: Can not bring back original '/boot/entropy' file"
-        fi
-      fi
       exit 1
     fi
     # snapshot format
@@ -185,25 +153,9 @@ __be_new() { # 1=SOURCE 2=TARGET
     if ! zfs snapshot -r ${1}@${FMT} 1> /dev/null 2> /dev/null
     then
       echo "ERROR: Cannot create snapshot '${1}@${FMT}'"
-      if [ ${ENTROPY} -ne 0 ]
-      then
-        if ! mv /boot/entropy.OLD /boot/entropy 1> /dev/null 2> /dev/null
-        then
-          echo "WARNING: Can not bring back original '/boot/entropy' file"
-        fi
-      fi
       exit 1
     fi
   fi
-  # bring back secured /boot/entropy.OLD file
-  if [ -f /boot/entropy.OLD ]
-  then
-    if ! mv /boot/entropy.OLD /boot/entropy 1> /dev/null 2> /dev/null
-    then
-      echo "WARNING: Can not bring back original '/boot/entropy' file"
-    fi
-  fi
-  unset ENTROPY
   # clone properties of source boot environment
   zfs list -H -o name -r ${SOURCE} \
     | grep -v '@' \
@@ -351,7 +303,7 @@ case ${1} in
         while(CMD_ZFS_LIST BENAME_BEGINS_WITH | getline) {
           if($1 != BENAME_BEGINS_WITH) {
             FSNAME = $1
-            FSNAMES[length(FSNAMES) + 1] = FSNAME
+            FSNAMES[length(FSNAME) + 1] = FSNAME
             USED              = __normalize($2)
             USEDBYDATASET     = __normalize($3)
             USEDBYSNAPSHOTS   = __normalize($4)
@@ -469,7 +421,7 @@ case ${1} in
               printf "%-" FSNAME_LENGTH "s %-6s %-" MOUNTPOINT_LENGTH "s %6s %s\n", BENAME, ACTIVE, MOUNTPOINT, __show_units(SPACE), CREATION
           }
         }
-      }'
+      }' 2> /dev/null
     ;;

   (create) # ------------------------------------------------------------------
Comment 4 commit-hook freebsd_committer 2017-07-05 20:02:58 UTC
A commit references this bug:

Author: bdrewery
Date: Wed Jul  5 20:02:44 UTC 2017
New revision: 445095
URL: https://svnweb.freebsd.org/changeset/ports/445095

Log:
  Restore /boot/entropy handling incorrectly lost in upstream 1.2.7 tag.

  PR:		219256

Changes:
  head/sysutils/beadm/Makefile
  head/sysutils/beadm/files/
  head/sysutils/beadm/files/patch-beadm
Comment 5 commit-hook freebsd_committer 2017-07-08 16:47:42 UTC
A commit references this bug:

Author: bdrewery
Date: Sat Jul  8 16:47:23 UTC 2017
New revision: 445340
URL: https://svnweb.freebsd.org/changeset/ports/445340

Log:
  Unbreak 'beadm list'.

  This basically reverts to 1.2.6 minus a 2>/dev/null change remaining.

  PR:		219256
  Reported by:	dim

Changes:
  head/sysutils/beadm/Makefile
  head/sysutils/beadm/files/patch-beadm