Merge commit 'erg2/master'
commit
bc215757bf
|
@ -173,3 +173,12 @@ PRIVATE>
|
||||||
|
|
||||||
: file-contents ( path -- str )
|
: file-contents ( path -- str )
|
||||||
dup <file-reader> swap file-length <sbuf> [ stream-copy ] keep >string ;
|
dup <file-reader> swap file-length <sbuf> [ stream-copy ] keep >string ;
|
||||||
|
|
||||||
|
: with-file-in ( path quot -- )
|
||||||
|
>r <file-reader> r> with-stream ; inline
|
||||||
|
|
||||||
|
: with-file-out ( path quot -- )
|
||||||
|
>r <file-writer> r> with-stream ; inline
|
||||||
|
|
||||||
|
: with-file-appender ( path quot -- )
|
||||||
|
>r <file-appender> r> with-stream ; inline
|
||||||
|
|
|
@ -349,17 +349,23 @@ M: timestamp year. ( timestamp -- )
|
||||||
: timestamp>string ( timestamp -- str )
|
: timestamp>string ( timestamp -- str )
|
||||||
[ (timestamp>string) ] string-out ;
|
[ (timestamp>string) ] string-out ;
|
||||||
|
|
||||||
|
: (write-gmt-offset) ( ratio -- )
|
||||||
|
1 /mod swap write-00 60 * write-00 ;
|
||||||
|
|
||||||
|
: write-gmt-offset ( gmt-offset -- )
|
||||||
|
{
|
||||||
|
{ [ dup zero? ] [ drop "GMT" write ] }
|
||||||
|
{ [ dup 0 < ] [ "-" write neg (write-gmt-offset) ] }
|
||||||
|
{ [ dup 0 > ] [ "+" write (write-gmt-offset) ] }
|
||||||
|
} cond ;
|
||||||
|
|
||||||
: timestamp>rfc822-string ( timestamp -- str )
|
: timestamp>rfc822-string ( timestamp -- str )
|
||||||
#! RFC822 timestamp format
|
#! RFC822 timestamp format
|
||||||
#! Example: Tue, 15 Nov 1994 08:12:31 +0200
|
#! Example: Tue, 15 Nov 1994 08:12:31 +0200
|
||||||
[
|
[
|
||||||
dup (timestamp>string)
|
dup (timestamp>string)
|
||||||
" " write
|
" " write
|
||||||
timestamp-gmt-offset {
|
timestamp-gmt-offset write-gmt-offset
|
||||||
{ [ dup zero? ] [ drop "GMT" write ] }
|
|
||||||
{ [ dup 0 < ] [ "-" write neg write-00 "00" write ] }
|
|
||||||
{ [ dup 0 > ] [ "+" write write-00 "00" write ] }
|
|
||||||
} cond
|
|
||||||
] string-out ;
|
] string-out ;
|
||||||
|
|
||||||
: timestamp>http-string ( timestamp -- str )
|
: timestamp>http-string ( timestamp -- str )
|
||||||
|
|
|
@ -6,8 +6,10 @@ TUPLE: windows-calendar ;
|
||||||
|
|
||||||
T{ windows-calendar } calendar-backend set-global
|
T{ windows-calendar } calendar-backend set-global
|
||||||
|
|
||||||
|
: TIME_ZONE_ID_INVALID HEX: ffffffff ; inline
|
||||||
|
|
||||||
M: windows-calendar gmt-offset ( -- float )
|
M: windows-calendar gmt-offset ( -- float )
|
||||||
"TIME_ZONE_INFORMATION" <c-object>
|
"TIME_ZONE_INFORMATION" <c-object>
|
||||||
[ GetTimeZoneInformation win32-error=0/f ] keep
|
dup GetTimeZoneInformation
|
||||||
[ TIME_ZONE_INFORMATION-Bias ] keep
|
TIME_ZONE_ID_INVALID = [ win32-error ] when
|
||||||
TIME_ZONE_INFORMATION-DaylightBias + 60 /f neg ;
|
TIME_ZONE_INFORMATION-Bias 60 / neg ;
|
||||||
|
|
|
@ -200,6 +200,12 @@ git_pull_factorcode() {
|
||||||
check_ret git
|
check_ret git
|
||||||
}
|
}
|
||||||
|
|
||||||
|
http_git_pull_factorcode() {
|
||||||
|
echo "Updating the git repository from factorcode.org..."
|
||||||
|
git pull http://factorcode.org/git/factor.git master
|
||||||
|
check_ret git
|
||||||
|
}
|
||||||
|
|
||||||
cd_factor() {
|
cd_factor() {
|
||||||
cd factor
|
cd factor
|
||||||
check_ret cd
|
check_ret cd
|
||||||
|
@ -271,6 +277,7 @@ install() {
|
||||||
bootstrap
|
bootstrap
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
update() {
|
update() {
|
||||||
get_config_info
|
get_config_info
|
||||||
git_pull_factorcode
|
git_pull_factorcode
|
||||||
|
@ -278,6 +285,13 @@ update() {
|
||||||
make_factor
|
make_factor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
http_update() {
|
||||||
|
get_config_info
|
||||||
|
http_git_pull_factorcode
|
||||||
|
make_clean
|
||||||
|
make_factor
|
||||||
|
}
|
||||||
|
|
||||||
update_bootstrap() {
|
update_bootstrap() {
|
||||||
delete_boot_images
|
delete_boot_images
|
||||||
get_boot_image
|
get_boot_image
|
||||||
|
@ -310,6 +324,7 @@ case "$1" in
|
||||||
self-update) update; make_boot_image; bootstrap;;
|
self-update) update; make_boot_image; bootstrap;;
|
||||||
quick-update) update; refresh_image ;;
|
quick-update) update; refresh_image ;;
|
||||||
update) update; update_bootstrap ;;
|
update) update; update_bootstrap ;;
|
||||||
|
http-update) http_update; update_bootstrap ;;
|
||||||
bootstrap) get_config_info; bootstrap ;;
|
bootstrap) get_config_info; bootstrap ;;
|
||||||
wget-bootstrap) get_config_info; delete_boot_images; get_boot_image; bootstrap ;;
|
wget-bootstrap) get_config_info; delete_boot_images; get_boot_image; bootstrap ;;
|
||||||
*) usage ;;
|
*) usage ;;
|
||||||
|
|
Loading…
Reference in New Issue