ports/129504: sysutils/freebsd-snapshot [maintainer patch]
Graham Todd
gtodd at bellanet.org
Mon Dec 8 16:40:02 UTC 2008
>Number: 129504
>Category: ports
>Synopsis: sysutils/freebsd-snapshot [maintainer patch]
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Mon Dec 08 16:40:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator: Graham Todd
>Release: FreeBSD 7.1-BETA2 i386
>Organization:
>Environment:
System: FreeBSD 7.1-BETA2 #0: Mon Oct 13 04:23:28 UTC 2008
root at logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC
>Description:
Report and patch from Wes Morgan.
The new version of ZFS in head defaults to not listing snapshots with "zfs list", which causes a problem with the "freebsd-snapshot" utility.
>How-To-Repeat:
Use snapshot tools with new zfs version in current.
>Fix:
The new "zfs list" command requires "-t snapshot"
The fix adds the correct zfs list command syntax to the existing /usr/local/sbin/snapshot and is backwards compatible.
Fix port by removing existing patch
/usr/ports/sysutils/freebsd-snapshot/files/patch-snapshot
and creating two separate patch files (patch-snapshot and patch-periodic-snapshot) which are attached:
--- patch-periodic-snapshot begins here ---
--- periodic-snapshot.orig Thu Sep 15 17:44:57 2005
+++ periodic-snapshot Thu Sep 15 17:46:31 2005
@@ -29,7 +29,7 @@
##
# make sure system tools are used first
-PATH="/bin:/usr/bin:/sbin:/usr/sbin:$PATH"
+PATH="/bin:/usr/bin:/sbin:/usr/sbin:%%PREFIX%%/sbin:$PATH"
# configuration defaults
snapshot_enable="NO"
--- patch-periodic-snapshot ends here ---
--- patch-snapshot begins here ---
--- snapshot~ 2008-12-06 19:37:53.598862157 -0600
+++ snapshot 2008-12-06 19:37:53.599877379 -0600
@@ -29,7 +29,7 @@
##
# make sure system tools are used first
-PATH="/bin:/usr/bin:/sbin:/usr/sbin:$PATH"
+PATH="/bin:/usr/bin:/sbin:/usr/sbin:%%PREFIX%%/sbin:$PATH"
# option defaults
fs_subdir=".snap"
@@ -271,7 +271,7 @@
i=19
k=`expr $maxgen - 1`
while [ $i -gt $k ]; do
- if zfs list "$fs_name@$fs_tag.$i" >/dev/null 2>&1; then
+ if zfs list -t snapshot "$fs_name@$fs_tag.$i" >/dev/null 2>&1; then
system zfs destroy "$fs_name@$fs_tag.$i"
fi
i=`expr $i - 1`
@@ -280,12 +280,12 @@
if [ $maxgen -gt 0 ]; then
# rotate remaining snapshots
i=$k
- if zfs list "$fs_name@$fs_tag.$i" >/dev/null 2>&1; then
+ if zfs list -t snapshot "$fs_name@$fs_tag.$i" >/dev/null 2>&1; then
system zfs destroy "$fs_name@$fs_tag.$i"
fi
i=`expr $i - 1`
while [ $i -ge $fs_gen ]; do
- if zfs list "$fs_name@$fs_tag.$i" >/dev/null 2>&1; then
+ if zfs list -t snapshot "$fs_name@$fs_tag.$i" >/dev/null 2>&1; then
j=`expr $i + 1`
system zfs rename "$fs_name@$fs_tag.$i" "$fs_name@$fs_tag.$j"
fi
--- patch-snapshot ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list