* [GUILT] add FreeBSD support @ 2013-08-09 12:32 Zheng Liu 2013-08-09 14:46 ` Josef 'Jeff' Sipek 0 siblings, 1 reply; 7+ messages in thread From: Zheng Liu @ 2013-08-09 12:32 UTC (permalink / raw) To: jeffpc; +Cc: git, Zheng Liu From: Zheng Liu <gnehzuil.liu@gmail.com> Currently guilt doesn't support FreeBSD platform. This commit tries to add this support. The file called 'os.FreeBSD' is copied from os.Darwin due to these two platforms have almost the same command tools. Signed-off-by: Zheng Liu <gnehzuil.liu@gmail.com> --- Hi all, After applied this patch, the regression test 010 and 060 will fail because of the output format. After fixing these issues, all the regression tests will pass. P.S. I don't subscribe git@ mailing list. So please put my email address in Cc list. Thanks! Regards, - Zheng os.FreeBSD | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 os.FreeBSD diff --git a/os.FreeBSD b/os.FreeBSD new file mode 100644 index 0000000..3f23121 --- /dev/null +++ b/os.FreeBSD @@ -0,0 +1,70 @@ +# usage: touch_date <unix ts> <file> +touch_date() +{ + touch -t `date -r $1 +%Y%m%d%H%M.%S` "$2" +} + +# usage: last_modified <file> +last_modified() +{ + stat -f "%m" "$1" +} + +# usage: format_last_modified <file> +format_last_modified() +{ + stat -f "%Sm" -t "%Y-%m-%d %H:%M:%S %z" "$1" +} + +# usage: head_n [count] +head_n() +{ + if [ "$1" -gt 0 ]; then + head -n "$1" + fi +} + +# usage: sha1 [file] +sha1() +{ + if [ $# = 1 ] + then + openssl dgst -sha1 "$1" | sed "s,SHA1.\(.*\).= \(.*\),\2 \1," + else + openssl dgst -sha1 | sed 's,\(.*= \)*\(.*\),\2 -,' + fi +} + +# usage: cp_a <src> <dst> +cp_a() +{ + cp -pR "$1" "$2" +} + +# usage: _tac +_tac() +{ + sed -e '1!G;h;$!d' +} + +_seq() +{ + ( + if [ $# -eq 1 ] + then + /usr/bin/jot $1 + elif [ $# -eq 2 ] + then + n1=$((${2} - ${1} + 1)) + n2=$1 + /usr/bin/jot $n1 $n2 + elif [ $# -eq 3 ] + then + num1=$1 + incr=$2 + num2=$3 + /usr/bin/awk -v n1=$num1 -v n2=$num2 -v add=$incr 'BEGIN{ for(i=n1; i<=n2; i+=add) print i;}' | /usr/bin/sed -E '/e/s/^.+e.+$/0/' + fi + ) + return 0 +} -- 1.8.3.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [GUILT] add FreeBSD support 2013-08-09 12:32 [GUILT] add FreeBSD support Zheng Liu @ 2013-08-09 14:46 ` Josef 'Jeff' Sipek 2013-08-09 15:04 ` gnehzuil.liu 0 siblings, 1 reply; 7+ messages in thread From: Josef 'Jeff' Sipek @ 2013-08-09 14:46 UTC (permalink / raw) To: Zheng Liu; +Cc: git On Fri, Aug 09, 2013 at 08:32:28PM +0800, Zheng Liu wrote: > From: Zheng Liu <gnehzuil.liu@gmail.com> > > Currently guilt doesn't support FreeBSD platform. This commit tries to > add this support. The file called 'os.FreeBSD' is copied from os.Darwin > due to these two platforms have almost the same command tools. Out of curiosity, is it identical? I eyeballed it, and they do look identical. There's probably a better way to do this whole os-specific thing, but this will work well enough for now. Jeff. > Signed-off-by: Zheng Liu <gnehzuil.liu@gmail.com> > --- > Hi all, > > After applied this patch, the regression test 010 and 060 will fail because > of the output format. After fixing these issues, all the regression tests > will pass. > > P.S. I don't subscribe git@ mailing list. So please put my email address > in Cc list. Thanks! > > Regards, > - Zheng > > os.FreeBSD | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 70 insertions(+) > create mode 100644 os.FreeBSD > > diff --git a/os.FreeBSD b/os.FreeBSD > new file mode 100644 > index 0000000..3f23121 > --- /dev/null > +++ b/os.FreeBSD > @@ -0,0 +1,70 @@ > +# usage: touch_date <unix ts> <file> > +touch_date() > +{ > + touch -t `date -r $1 +%Y%m%d%H%M.%S` "$2" > +} > + > +# usage: last_modified <file> > +last_modified() > +{ > + stat -f "%m" "$1" > +} > + > +# usage: format_last_modified <file> > +format_last_modified() > +{ > + stat -f "%Sm" -t "%Y-%m-%d %H:%M:%S %z" "$1" > +} > + > +# usage: head_n [count] > +head_n() > +{ > + if [ "$1" -gt 0 ]; then > + head -n "$1" > + fi > +} > + > +# usage: sha1 [file] > +sha1() > +{ > + if [ $# = 1 ] > + then > + openssl dgst -sha1 "$1" | sed "s,SHA1.\(.*\).= \(.*\),\2 \1," > + else > + openssl dgst -sha1 | sed 's,\(.*= \)*\(.*\),\2 -,' > + fi > +} > + > +# usage: cp_a <src> <dst> > +cp_a() > +{ > + cp -pR "$1" "$2" > +} > + > +# usage: _tac > +_tac() > +{ > + sed -e '1!G;h;$!d' > +} > + > +_seq() > +{ > + ( > + if [ $# -eq 1 ] > + then > + /usr/bin/jot $1 > + elif [ $# -eq 2 ] > + then > + n1=$((${2} - ${1} + 1)) > + n2=$1 > + /usr/bin/jot $n1 $n2 > + elif [ $# -eq 3 ] > + then > + num1=$1 > + incr=$2 > + num2=$3 > + /usr/bin/awk -v n1=$num1 -v n2=$num2 -v add=$incr 'BEGIN{ for(i=n1; i<=n2; i+=add) print i;}' | /usr/bin/sed -E '/e/s/^.+e.+$/0/' > + fi > + ) > + return 0 > +} > -- > 1.8.3.4 > -- Research, n.: Consider Columbus: He didn't know where he was going. When he got there he didn't know where he was. When he got back he didn't know where he had been. And he did it all on someone else's money. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [GUILT] add FreeBSD support 2013-08-09 14:46 ` Josef 'Jeff' Sipek @ 2013-08-09 15:04 ` gnehzuil.liu 2013-08-09 15:20 ` Josef 'Jeff' Sipek 0 siblings, 1 reply; 7+ messages in thread From: gnehzuil.liu @ 2013-08-09 15:04 UTC (permalink / raw) To: Josef 'Jeff' Sipek; +Cc: git@vger.kernel.org 在 2013-8-9,下午10:46,Josef 'Jeff' Sipek <jeffpc@josefsipek.net> 写道: > On Fri, Aug 09, 2013 at 08:32:28PM +0800, Zheng Liu wrote: >> From: Zheng Liu <gnehzuil.liu@gmail.com> >> >> Currently guilt doesn't support FreeBSD platform. This commit tries to >> add this support. The file called 'os.FreeBSD' is copied from os.Darwin >> due to these two platforms have almost the same command tools. > > Out of curiosity, is it identical? I eyeballed it, and they do look > identical. There's probably a better way to do this whole os-specific > thing, but this will work well enough for now. Yes, it is identical. Sorry, I am a newbie for guilt, but I am happy to improve this os-specific thing. Any idea? Regards, - Zheng > > Jeff. > >> Signed-off-by: Zheng Liu <gnehzuil.liu@gmail.com> >> --- >> Hi all, >> >> After applied this patch, the regression test 010 and 060 will fail because >> of the output format. After fixing these issues, all the regression tests >> will pass. >> >> P.S. I don't subscribe git@ mailing list. So please put my email address >> in Cc list. Thanks! >> >> Regards, >> - Zheng >> >> os.FreeBSD | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 70 insertions(+) >> create mode 100644 os.FreeBSD >> >> diff --git a/os.FreeBSD b/os.FreeBSD >> new file mode 100644 >> index 0000000..3f23121 >> --- /dev/null >> +++ b/os.FreeBSD >> @@ -0,0 +1,70 @@ >> +# usage: touch_date <unix ts> <file> >> +touch_date() >> +{ >> + touch -t `date -r $1 +%Y%m%d%H%M.%S` "$2" >> +} >> + >> +# usage: last_modified <file> >> +last_modified() >> +{ >> + stat -f "%m" "$1" >> +} >> + >> +# usage: format_last_modified <file> >> +format_last_modified() >> +{ >> + stat -f "%Sm" -t "%Y-%m-%d %H:%M:%S %z" "$1" >> +} >> + >> +# usage: head_n [count] >> +head_n() >> +{ >> + if [ "$1" -gt 0 ]; then >> + head -n "$1" >> + fi >> +} >> + >> +# usage: sha1 [file] >> +sha1() >> +{ >> + if [ $# = 1 ] >> + then >> + openssl dgst -sha1 "$1" | sed "s,SHA1.\(.*\).= \(.*\),\2 \1," >> + else >> + openssl dgst -sha1 | sed 's,\(.*= \)*\(.*\),\2 -,' >> + fi >> +} >> + >> +# usage: cp_a <src> <dst> >> +cp_a() >> +{ >> + cp -pR "$1" "$2" >> +} >> + >> +# usage: _tac >> +_tac() >> +{ >> + sed -e '1!G;h;$!d' >> +} >> + >> +_seq() >> +{ >> + ( >> + if [ $# -eq 1 ] >> + then >> + /usr/bin/jot $1 >> + elif [ $# -eq 2 ] >> + then >> + n1=$((${2} - ${1} + 1)) >> + n2=$1 >> + /usr/bin/jot $n1 $n2 >> + elif [ $# -eq 3 ] >> + then >> + num1=$1 >> + incr=$2 >> + num2=$3 >> + /usr/bin/awk -v n1=$num1 -v n2=$num2 -v add=$incr 'BEGIN{ for(i=n1; i<=n2; i+=add) print i;}' | /usr/bin/sed -E '/e/s/^.+e.+$/0/' >> + fi >> + ) >> + return 0 >> +} >> -- >> 1.8.3.4 > > -- > Research, n.: > Consider Columbus: > He didn't know where he was going. > When he got there he didn't know where he was. > When he got back he didn't know where he had been. > And he did it all on someone else's money. ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [GUILT] add FreeBSD support 2013-08-09 15:04 ` gnehzuil.liu @ 2013-08-09 15:20 ` Josef 'Jeff' Sipek 2013-08-20 7:44 ` Zheng Liu 0 siblings, 1 reply; 7+ messages in thread From: Josef 'Jeff' Sipek @ 2013-08-09 15:20 UTC (permalink / raw) To: gnehzuil.liu; +Cc: git@vger.kernel.org [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain; charset=utf-8, Size: 1419 bytes --] On Fri, Aug 09, 2013 at 11:04:45PM +0800, gnehzuil.liu wrote: > ÔÚ 2013-8-9£¬ÏÂÎç10:46£¬Josef 'Jeff' Sipek <jeffpc@josefsipek.net> дµÀ£º > > > On Fri, Aug 09, 2013 at 08:32:28PM +0800, Zheng Liu wrote: > >> From: Zheng Liu <gnehzuil.liu@gmail.com> > >> > >> Currently guilt doesn't support FreeBSD platform. This commit tries to > >> add this support. The file called 'os.FreeBSD' is copied from os.Darwin > >> due to these two platforms have almost the same command tools. > > > > Out of curiosity, is it identical? I eyeballed it, and they do look > > identical. There's probably a better way to do this whole os-specific > > thing, but this will work well enough for now. > > Yes, it is identical. Sorry, I am a newbie for guilt, but I am happy to > improve this os-specific thing. Any idea? So, I'm a bit torn between some "build-time" checking that generates something like an "os" file based on what it detects and something that happens at runtime. I like that currently there's nothing to do - you just clone the repo and you're set. At the same time, the more code can be avoided executing the faster (in theory) guilt gets. Feel free to experiment. Jeff. -- The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. - George Bernard Shaw ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [GUILT] add FreeBSD support 2013-08-09 15:20 ` Josef 'Jeff' Sipek @ 2013-08-20 7:44 ` Zheng Liu 2013-08-20 15:25 ` Josef 'Jeff' Sipek 0 siblings, 1 reply; 7+ messages in thread From: Zheng Liu @ 2013-08-20 7:44 UTC (permalink / raw) To: Josef 'Jeff' Sipek; +Cc: git@vger.kernel.org Hi Josef, On Fri, Aug 09, 2013 at 11:20:46AM -0400, Josef 'Jeff' Sipek wrote: > On Fri, Aug 09, 2013 at 11:04:45PM +0800, gnehzuil.liu wrote: > > ?? 2013-8-9??????10:46??Josef 'Jeff' Sipek <jeffpc@josefsipek.net> д???? > > > > > On Fri, Aug 09, 2013 at 08:32:28PM +0800, Zheng Liu wrote: > > >> From: Zheng Liu <gnehzuil.liu@gmail.com> > > >> > > >> Currently guilt doesn't support FreeBSD platform. This commit tries to > > >> add this support. The file called 'os.FreeBSD' is copied from os.Darwin > > >> due to these two platforms have almost the same command tools. > > > > > > Out of curiosity, is it identical? I eyeballed it, and they do look > > > identical. There's probably a better way to do this whole os-specific > > > thing, but this will work well enough for now. > > > > Yes, it is identical. Sorry, I am a newbie for guilt, but I am happy to > > improve this os-specific thing. Any idea? > > So, I'm a bit torn between some "build-time" checking that generates > something like an "os" file based on what it detects and something that > happens at runtime. I like that currently there's nothing to do - you just > clone the repo and you're set. At the same time, the more code can be > avoided executing the faster (in theory) guilt gets. Sorry for the late reply. I did a simple experiment that tries to fold all os.* files into one file and uses a if statement to export functions according to different platforms. But frankly I don't like this because it is not very clearly. So IMHO we'd better add a 'os.FreeBSD' file to support FreeBSD platform. I attach the patch in this mail. It is not very mature. If you think it is worthwhile improving this patch. Please review it. All feedbacks are always welcome. Regards, - Zheng --- Makefile | 2 +- guilt | 8 ++-- os | 134 ++++++++++++++++++++++++++++++++++++++++++++++++++++ os.Darwin | 70 --------------------------- os.Linux | 57 ---------------------- os.SunOS | 57 ---------------------- regression/scaffold | 4 +- 7 files changed, 141 insertions(+), 191 deletions(-) create mode 100644 os delete mode 100644 os.Darwin delete mode 100644 os.Linux delete mode 100644 os.SunOS diff --git a/Makefile b/Makefile index b38c1e4..395abc1 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ PREFIX?=/usr/local DESTDIR?= INSTALL?=install -OSFILES = $(filter-out $(wildcard *~),$(wildcard os.*)) +OSFILES = os SCRIPTS = $(filter-out $(wildcard *~),$(wildcard guilt-*)) .PHONY: all diff --git a/guilt b/guilt index e9b2aab..718bed0 100755 --- a/guilt +++ b/guilt @@ -906,10 +906,10 @@ pager="more" UNAME_S=`uname -s` -if [ -r "$GUILT_PATH/os.$UNAME_S" ]; then - . "$GUILT_PATH/os.$UNAME_S" -elif [ -r "$GUILT_PATH/../lib/guilt/os.$UNAME_S" ]; then - . "$GUILT_PATH/../lib/guilt/os.$UNAME_S" +if [ -r "$GUILT_PATH/os" ]; then + . "$GUILT_PATH/os" +elif [ -r "$GUILT_PATH/../lib/guilt/os" ]; then + . "$GUILT_PATH/../lib/guilt/os" else die "Unsupported operating system: $UNAME_S" fi diff --git a/os b/os new file mode 100644 index 0000000..6d1bc01 --- /dev/null +++ b/os @@ -0,0 +1,134 @@ +UNAME_S=`uname -s` + +if [ $UNAME_S == 'FreeBSD' ] || [ $UNAME_S == 'Darwin' ]; then + # usage: touch_date <unix ts> <file> + touch_date() + { + touch -t `date -r $1 +%Y%m%d%H%M.%S` "$2" + } + + # usage: last_modified <file> + last_modified() + { + stat -f "%m" "$1" + } + + # usage: format_last_modified <file> + format_last_modified() + { + stat -f "%Sm" -t "%Y-%m-%d %H:%M:%S %z" "$1" + } + + # usage: head_n [count] + head_n() + { + if [ "$1" -gt 0 ]; then + head -n "$1" + fi + } + + # usage: sha1 [file] + sha1() + { + if [ $# = 1 ] + then + openssl dgst -sha1 "$1" | sed "s,SHA1.\(.*\).= \(.*\),\2 \1," + else + openssl dgst -sha1 | sed 's,\(.*= \)*\(.*\),\2 -,' + fi + } + + # usage: cp_a <src> <dst> + cp_a() + { + cp -pR "$1" "$2" + } + + # usage: _tac + _tac() + { + sed -e '1!G;h;$!d' + } + + _seq() + { + ( + if [ $# -eq 1 ] + then + /usr/bin/jot $1 + elif [ $# -eq 2 ] + then + n1=$((${2} - ${1} + 1)) + n2=$1 + /usr/bin/jot $n1 $n2 + elif [ $# -eq 3 ] + then + num1=$1 + incr=$2 + num2=$3 + /usr/bin/awk -v n1=$num1 -v n2=$num2 -v add=$incr 'BEGIN{ for(i=n1; i<=n2; i+=add) print i;}' | /usr/bin/sed -E '/e/s/^.+e.+$/0/' + fi + ) + return 0 + } +elif [ $UNAME_S == 'Linux' ] || [ $UNAME_S == 'SunOS' ]; then + # usage: touch_date <unix ts> <file> + touch_date() + { + touch -d @$1 "$2" + } + + # usage: last_modified <file> + last_modified() + { + stat -c "%Y" "$1" + } + + # usage: format_last_modified <file> + format_last_modified() + { + # must strip nano-second part otherwise git gets very + # confused, and makes up strange timestamps from the past + # (chances are it decides to interpret it as a unix + # timestamp). + stat -c "%y" "$1" | sed -e ' + s/^\([0-9]\{4\}\)-\([0-9]\{2\}\)-\([0-9]\{2\}\) \([0-9]\{2\}\):\([0-9]\{2\}\):\([0-9]\{2\}\)\.[0-9]* \(.*\)$/\1-\2-\3 \4:\5:\6 \7/' + } + + # usage: head_n [count] + head_n() + { + head -n "$1" + } + + # usage: sha1 [file] + sha1() + { + if [ $# = 1 ] + then + sha1sum "$1" + else + sha1sum + fi + } + + # usage: cp_a <src> <dst> + cp_a() + { + cp -a "$1" "$2" + } + + # usage: _tac + _tac() + { + tac + } + + _seq() + { + seq "$@" + return $? + } +else + die "Unsupported operating system: $UNAME_S" +fi diff --git a/os.Darwin b/os.Darwin deleted file mode 100644 index 3f23121..0000000 --- a/os.Darwin +++ /dev/null @@ -1,70 +0,0 @@ -# usage: touch_date <unix ts> <file> -touch_date() -{ - touch -t `date -r $1 +%Y%m%d%H%M.%S` "$2" -} - -# usage: last_modified <file> -last_modified() -{ - stat -f "%m" "$1" -} - -# usage: format_last_modified <file> -format_last_modified() -{ - stat -f "%Sm" -t "%Y-%m-%d %H:%M:%S %z" "$1" -} - -# usage: head_n [count] -head_n() -{ - if [ "$1" -gt 0 ]; then - head -n "$1" - fi -} - -# usage: sha1 [file] -sha1() -{ - if [ $# = 1 ] - then - openssl dgst -sha1 "$1" | sed "s,SHA1.\(.*\).= \(.*\),\2 \1," - else - openssl dgst -sha1 | sed 's,\(.*= \)*\(.*\),\2 -,' - fi -} - -# usage: cp_a <src> <dst> -cp_a() -{ - cp -pR "$1" "$2" -} - -# usage: _tac -_tac() -{ - sed -e '1!G;h;$!d' -} - -_seq() -{ - ( - if [ $# -eq 1 ] - then - /usr/bin/jot $1 - elif [ $# -eq 2 ] - then - n1=$((${2} - ${1} + 1)) - n2=$1 - /usr/bin/jot $n1 $n2 - elif [ $# -eq 3 ] - then - num1=$1 - incr=$2 - num2=$3 - /usr/bin/awk -v n1=$num1 -v n2=$num2 -v add=$incr 'BEGIN{ for(i=n1; i<=n2; i+=add) print i;}' | /usr/bin/sed -E '/e/s/^.+e.+$/0/' - fi - ) - return 0 -} diff --git a/os.Linux b/os.Linux deleted file mode 100644 index aaebf88..0000000 --- a/os.Linux +++ /dev/null @@ -1,57 +0,0 @@ -# usage: touch_date <unix ts> <file> -touch_date() -{ - touch -d @$1 "$2" -} - -# usage: last_modified <file> -last_modified() -{ - stat -c "%Y" "$1" -} - -# usage: format_last_modified <file> -format_last_modified() -{ - # must strip nano-second part otherwise git gets very - # confused, and makes up strange timestamps from the past - # (chances are it decides to interpret it as a unix - # timestamp). - stat -c "%y" "$1" | sed -e ' -s/^\([0-9]\{4\}\)-\([0-9]\{2\}\)-\([0-9]\{2\}\) \([0-9]\{2\}\):\([0-9]\{2\}\):\([0-9]\{2\}\)\.[0-9]* \(.*\)$/\1-\2-\3 \4:\5:\6 \7/' -} - -# usage: head_n [count] -head_n() -{ - head -n "$1" -} - -# usage: sha1 [file] -sha1() -{ - if [ $# = 1 ] - then - sha1sum "$1" - else - sha1sum - fi -} - -# usage: cp_a <src> <dst> -cp_a() -{ - cp -a "$1" "$2" -} - -# usage: _tac -_tac() -{ - tac -} - -_seq() -{ - seq "$@" - return $? -} diff --git a/os.SunOS b/os.SunOS deleted file mode 100644 index aaebf88..0000000 --- a/os.SunOS +++ /dev/null @@ -1,57 +0,0 @@ -# usage: touch_date <unix ts> <file> -touch_date() -{ - touch -d @$1 "$2" -} - -# usage: last_modified <file> -last_modified() -{ - stat -c "%Y" "$1" -} - -# usage: format_last_modified <file> -format_last_modified() -{ - # must strip nano-second part otherwise git gets very - # confused, and makes up strange timestamps from the past - # (chances are it decides to interpret it as a unix - # timestamp). - stat -c "%y" "$1" | sed -e ' -s/^\([0-9]\{4\}\)-\([0-9]\{2\}\)-\([0-9]\{2\}\) \([0-9]\{2\}\):\([0-9]\{2\}\):\([0-9]\{2\}\)\.[0-9]* \(.*\)$/\1-\2-\3 \4:\5:\6 \7/' -} - -# usage: head_n [count] -head_n() -{ - head -n "$1" -} - -# usage: sha1 [file] -sha1() -{ - if [ $# = 1 ] - then - sha1sum "$1" - else - sha1sum - fi -} - -# usage: cp_a <src> <dst> -cp_a() -{ - cp -a "$1" "$2" -} - -# usage: _tac -_tac() -{ - tac -} - -_seq() -{ - seq "$@" - return $? -} diff --git a/regression/scaffold b/regression/scaffold index 546d8c6..4d4613b 100644 --- a/regression/scaffold +++ b/regression/scaffold @@ -25,8 +25,8 @@ function die UNAME_S=`uname -s` -if [ -r "$REG_DIR/../os.$UNAME_S" ]; then - . "$REG_DIR/../os.$UNAME_S" +if [ -r "$REG_DIR/../os" ]; then + . "$REG_DIR/../os" else die "Unsupported operating system: $UNAME_S" fi -- 1.8.3.4 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [GUILT] add FreeBSD support 2013-08-20 7:44 ` Zheng Liu @ 2013-08-20 15:25 ` Josef 'Jeff' Sipek 2013-08-21 2:04 ` Zheng Liu 0 siblings, 1 reply; 7+ messages in thread From: Josef 'Jeff' Sipek @ 2013-08-20 15:25 UTC (permalink / raw) To: Zheng Liu; +Cc: git@vger.kernel.org On Tue, Aug 20, 2013 at 03:44:16PM +0800, Zheng Liu wrote: > Hi Josef, > > On Fri, Aug 09, 2013 at 11:20:46AM -0400, Josef 'Jeff' Sipek wrote: > > On Fri, Aug 09, 2013 at 11:04:45PM +0800, gnehzuil.liu wrote: > > > ?? 2013-8-9??????10:46??Josef 'Jeff' Sipek <jeffpc@josefsipek.net> д???? > > > > > > > On Fri, Aug 09, 2013 at 08:32:28PM +0800, Zheng Liu wrote: > > > >> From: Zheng Liu <gnehzuil.liu@gmail.com> > > > >> > > > >> Currently guilt doesn't support FreeBSD platform. This commit tries to > > > >> add this support. The file called 'os.FreeBSD' is copied from os.Darwin > > > >> due to these two platforms have almost the same command tools. > > > > > > > > Out of curiosity, is it identical? I eyeballed it, and they do look > > > > identical. There's probably a better way to do this whole os-specific > > > > thing, but this will work well enough for now. > > > > > > Yes, it is identical. Sorry, I am a newbie for guilt, but I am happy to > > > improve this os-specific thing. Any idea? > > > > So, I'm a bit torn between some "build-time" checking that generates > > something like an "os" file based on what it detects and something that > > happens at runtime. I like that currently there's nothing to do - you just > > clone the repo and you're set. At the same time, the more code can be > > avoided executing the faster (in theory) guilt gets. > > Sorry for the late reply. I did a simple experiment that tries to fold > all os.* files into one file and uses a if statement to export functions > according to different platforms. But frankly I don't like this because > it is not very clearly. So IMHO we'd better add a 'os.FreeBSD' file to > support FreeBSD platform. Yeah, sounds like the simplest (at least for the moment). I'll commit it. Thanks. FWIW, the idea I was thinking about was to make "make all" figure out various parts of the system and construct an os file. Jeff. -- UNIX is user-friendly ... it's just selective about who its friends are ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [GUILT] add FreeBSD support 2013-08-20 15:25 ` Josef 'Jeff' Sipek @ 2013-08-21 2:04 ` Zheng Liu 0 siblings, 0 replies; 7+ messages in thread From: Zheng Liu @ 2013-08-21 2:04 UTC (permalink / raw) To: Josef 'Jeff' Sipek; +Cc: git@vger.kernel.org On Tue, Aug 20, 2013 at 11:25:48AM -0400, Josef 'Jeff' Sipek wrote: > On Tue, Aug 20, 2013 at 03:44:16PM +0800, Zheng Liu wrote: > > Hi Josef, > > > > On Fri, Aug 09, 2013 at 11:20:46AM -0400, Josef 'Jeff' Sipek wrote: > > > On Fri, Aug 09, 2013 at 11:04:45PM +0800, gnehzuil.liu wrote: > > > > ?? 2013-8-9??????10:46??Josef 'Jeff' Sipek <jeffpc@josefsipek.net> д???? > > > > > > > > > On Fri, Aug 09, 2013 at 08:32:28PM +0800, Zheng Liu wrote: > > > > >> From: Zheng Liu <gnehzuil.liu@gmail.com> > > > > >> > > > > >> Currently guilt doesn't support FreeBSD platform. This commit tries to > > > > >> add this support. The file called 'os.FreeBSD' is copied from os.Darwin > > > > >> due to these two platforms have almost the same command tools. > > > > > > > > > > Out of curiosity, is it identical? I eyeballed it, and they do look > > > > > identical. There's probably a better way to do this whole os-specific > > > > > thing, but this will work well enough for now. > > > > > > > > Yes, it is identical. Sorry, I am a newbie for guilt, but I am happy to > > > > improve this os-specific thing. Any idea? > > > > > > So, I'm a bit torn between some "build-time" checking that generates > > > something like an "os" file based on what it detects and something that > > > happens at runtime. I like that currently there's nothing to do - you just > > > clone the repo and you're set. At the same time, the more code can be > > > avoided executing the faster (in theory) guilt gets. > > > > Sorry for the late reply. I did a simple experiment that tries to fold > > all os.* files into one file and uses a if statement to export functions > > according to different platforms. But frankly I don't like this because > > it is not very clearly. So IMHO we'd better add a 'os.FreeBSD' file to > > support FreeBSD platform. > > Yeah, sounds like the simplest (at least for the moment). I'll commit it. > Thanks. > > FWIW, the idea I was thinking about was to make "make all" figure out > various parts of the system and construct an os file. Yes, I thought this. We can create a os.in file and generate a os file after running "make" command. But currently os.* looks like the simplest solution. Regards, - Zheng ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-08-21 2:04 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-08-09 12:32 [GUILT] add FreeBSD support Zheng Liu 2013-08-09 14:46 ` Josef 'Jeff' Sipek 2013-08-09 15:04 ` gnehzuil.liu 2013-08-09 15:20 ` Josef 'Jeff' Sipek 2013-08-20 7:44 ` Zheng Liu 2013-08-20 15:25 ` Josef 'Jeff' Sipek 2013-08-21 2:04 ` Zheng Liu
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 NNTP newsgroup(s).