public inbox for lvm2-cvs@sourceware.org help / color / mirror / Atom feed
From: zkabelac@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2/scripts fsadm.sh Date: Thu, 11 Nov 2010 12:17:00 -0000 [thread overview] Message-ID: <20101111121716.12701.qmail@sourceware.org> (raw) CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2010-11-11 12:17:15 Modified files: scripts : fsadm.sh Log message: Add date configurable variable DATE Follow the rule to run every command through variable dereference. Add a runtime check of translated date to seconds. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/scripts/fsadm.sh.diff?cvsroot=lvm2&r1=1.23&r2=1.24 --- LVM2/scripts/fsadm.sh 2010/11/10 16:14:03 1.23 +++ LVM2/scripts/fsadm.sh 2010/11/11 12:17:15 1.24 @@ -47,6 +47,7 @@ RMDIR=rmdir BLOCKDEV=blockdev BLKID=blkid +DATE=date GREP=grep READLINK=readlink READLINK_E="-e" @@ -386,7 +387,7 @@ # only one supported #################################### diff_dates() { - echo $(( $(date -u -d"$1" +%s 2>/dev/null) - $(date -u -d"$2" +%s 2>/dev/null) )) + echo $(( $($DATE -u -d"$1" +%s 2>/dev/null) - $($DATE -u -d"$2" +%s 2>/dev/null) )) } ################### @@ -445,7 +446,7 @@ test -n "$TUNE_EXT" -a -n "$RESIZE_EXT" -a -n "$TUNE_REISER" -a -n "$RESIZE_REISER" \ -a -n "$TUNE_XFS" -a -n "$RESIZE_XFS" -a -n "$MOUNT" -a -n "$UMOUNT" -a -n "$MKDIR" \ -a -n "$RMDIR" -a -n "$BLOCKDEV" -a -n "$BLKID" -a -n "$GREP" -a -n "$READLINK" \ - -a -n "$FSCK" -a -n "$XFS_CHECK" -a -n "LVM" \ + -a -n "$DATE" -a -n "$FSCK" -a -n "$XFS_CHECK" -a -n "LVM" \ || error "Required command definitions in the script are missing!" $LVM version >/dev/null 2>&1 || error "Could not run lvm binary '$LVM'" @@ -453,6 +454,7 @@ TEST64BIT=$(( 1000 * 1000000000000 )) test $TEST64BIT -eq 1000000000000000 || error "Shell does not handle 64bit arithmetic" $(echo Y | $GREP Y >/dev/null) || error "Grep does not work properly" +test $($DATE -u -d"Jan 01 00:00:01 1970" +%s) -eq 1 || error "Date translation does not work" if [ "$#" -eq 0 ] ; then
next reply other threads:[~2010-11-11 12:17 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2010-11-11 12:17 zkabelac [this message] -- strict thread matches above, loose matches on Subject: below -- 2010-11-10 10:03 zkabelac 2010-10-08 11:18 zkabelac 2008-01-08 16:45 zkabelac 2007-12-17 14:47 agk
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20101111121716.12701.qmail@sourceware.org \ --to=zkabelac@sourceware.org \ --cc=lvm-devel@redhat.com \ --cc=lvm2-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).