Date: Thu, 23 Feb 2012 08:58:49 +0300 From: Fedor Dikarev <fedor.dikarev@gmail.com> To: crees@freebsd.org Cc: freebsd-ports-bugs@freebsd.org, gtodd@bellanet.org Subject: Re: ports/139203: sysutils/freebsd-snapshot more careful patch not depending of LANG/LC_ALL Message-ID: <CAA9ksCaUvvAiaEaYFoMgBHr=a_GF95CJyJipbUFX4O__g%2BV_Xg@mail.gmail.com> In-Reply-To: <201202091950.q19JoO2h022648@freefall.freebsd.org> References: <201202091950.q19JoO2h022648@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] Thanks to glebius@ -- he explained me what exactly I should do. Patch for the port attached. 2012/2/9 <crees@freebsd.org>: > Synopsis: sysutils/freebsd-snapshot more careful patch not depending of LANG/LC_ALL > > State-Changed-From-To: analyzed->feedback > State-Changed-By: crees > State-Changed-When: Thu Feb 9 19:48:56 UTC 2012 > State-Changed-Why: > Hi Graham, > > As you suggested earlier, these problems should have been resolved in a recent release. šIs that the case? > > > Responsible-Changed-From-To: freebsd-ports-bugs->crees > Responsible-Changed-By: crees > Responsible-Changed-When: Thu Feb 9 19:48:56 UTC 2012 > Responsible-Changed-Why: > I'll take it. > > http://www.freebsd.org/cgi/query-pr.cgi?pr=139203 -- æÅÄÏÒ äÉËÁÒÅ× [-- Attachment #2 --] diff -Nur /usr/ports/sysutils/freebsd-snapshot/Makefile ./Makefile --- /usr/ports/sysutils/freebsd-snapshot/Makefile 2010-09-03 19:11:01.000000000 +0400 +++ ./Makefile 2012-02-23 09:52:23.000000000 +0400 @@ -7,7 +7,7 @@ PORTNAME= freebsd-snapshot DISTVERSION= 20091208.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils MASTER_SITES= http://people.freebsd.org/~rse/dist/ diff -Nur /usr/ports/sysutils/freebsd-snapshot/files/patch-snapshot ./files/patch-snapshot --- /usr/ports/sysutils/freebsd-snapshot/files/patch-snapshot 2010-09-03 19:11:01.000000000 +0400 +++ ./files/patch-snapshot 2012-02-23 09:50:05.000000000 +0400 @@ -1,17 +1,15 @@ ---- snapshot.orig 2009-12-08 20:14:13.000000000 +0000 -+++ snapshot 2010-08-31 13:50:34.000000000 +0000 -@@ -29,7 +29,9 @@ +--- snapshot.orig 2009-12-08 23:14:13.000000000 +0300 ++++ snapshot 2012-02-23 09:49:28.000000000 +0400 +@@ -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" -+LC_ALL=C -+LANG=C # option defaults verbose=no -@@ -79,6 +81,7 @@ +@@ -79,6 +79,7 @@ source_rc_confs; \ fi; \ . /etc/rc.subr; \ @@ -19,7 +17,30 @@ if checkyesno zfs_enable; then \ echo 'yes'; \ else \ -@@ -491,7 +494,7 @@ +@@ -165,19 +166,12 @@ + # determine sizes + fs_size=`df -k $fs_dir | tail -n1 | awk '{ print $2; }'` + used_size=`df -k $fs_dir | tail -n1 | awk '{ print $3; }'` +- snap_size=`zfs get -H -o value used $snap | sed -e 's;\.[0-9][0-9]*;;'` +- case "$snap_size" in +- *B ) snap_size=`echo "$snap_size" | sed -e 's;B$;;'`; snap_size=$(($snap_size / 1024)) ;; +- *K ) snap_size=`echo "$snap_size" | sed -e 's;K$;;'` ;; +- *M ) snap_size=`echo "$snap_size" | sed -e 's;M$;;'`; snap_size=$(($snap_size * 1024)) ;; +- *G ) snap_size=`echo "$snap_size" | sed -e 's;G$;;'`; snap_size=$(($snap_size * 1024 * 1024)) ;; +- *T ) snap_size=`echo "$snap_size" | sed -e 's;T$;;'`; snap_size=$(($snap_size * 1024 * 1024 * 1024)) ;; +- esac ++ snap_size=`zfs get -H -p -o value used $snap | sed -e 's;\.[0-9][0-9]*;;'` + + # determine snapshot creation time + if [ ".$verbose" = .yes ]; then +- snap_time=`zfs get -H -o value creation $snap` +- snap_time=`date -j -f "%a %b %d %H:%M %Y" "$snap_time" "+%Y-%m-%dT%H:%M"` ++ snap_time=`zfs get -H -p -o value creation $snap` ++ snap_time=`date -r "$snap_time" "+%Y-%m-%dT%H:%M"` + fi + + # calculate percentages +@@ -491,7 +485,7 @@ echo "snapshot:ERROR: unable to create directory \"$mnt\"" 1>&2 exit 1 fi
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAA9ksCaUvvAiaEaYFoMgBHr=a_GF95CJyJipbUFX4O__g%2BV_Xg>
