git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [GUILT] add FreeBSD support

From
Ggnehzuil.liu <gnehzuil.liu@gmail.com>
Date
Aug 9, 2013, 15:04 UTC
Message-ID
<68E9B1AC-A3A3-47DD-B0A7-07752428D16D@gmail.com>
In-Reply-To
<20130809144641.GK22686@poseidon.cudanet.local>
在 2013-8-9,下午10:46,Josef 'Jeff' Sipek <jeffpc@josefsipek.net> 写道:
Show 10 quoted lines
> 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
Show 107 quoted lines
> 
> 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.
Previous: Josef 'Jeff' SipekNext: Josef 'Jeff' Sipek
Message 3 of 7 in “[GUILT] add FreeBSD support”
  1. Zheng LiuAug 9, 2013
  2. Josef 'Jeff' SipekAug 9, 2013
  3. gnehzuil.liuAug 9, 2013
  4. Josef 'Jeff' SipekAug 9, 2013
  5. Zheng LiuAug 20, 2013
  6. Josef 'Jeff' SipekAug 20, 2013
  7. Zheng LiuAug 21, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.