Gonzalo Tornaria wrote: > Would it make more sense to include something like busybox > (www.busybox.net) into sage?
I do not believe so. > Busybox includes a shell (ash, I think), > and most shellutils and textutils one would probably want to use (this > includes awk, sed, etc). Instead of trying to fix the sage shell > scripts to work in any combination of shell/utils/etc, just target the > busybox shell with its corresponding utils. > I don't know how feasible it is to compile busybox on OSX, solaris, or > other unices, though. > > Gonzalo > > """ > BusyBox combines tiny versions of many common UNIX utilities into a > single small executable. It provides replacements for most of the > utilities you usually find in GNU fileutils, shellutils, etc. The > utilities in BusyBox generally have fewer options than their > full-featured GNU cousins; however, the options that are included > provide the expected functionality and behave very much like their GNU > counterparts. BusyBox provides a fairly complete environment for any > small or embedded system. Sage is designed to run on workstations and servers, not small embedded systems. As such, would it not be better to support the Unix standard? BusyBox appears to support a subset of the options of the more common GNU tools. That subset may not be sufficient and I feel would likely be too limiting. There is a standard for Unix. This is not the latest (I specifically avoided that), but is the 2004 IEEE/POSIX standard which defines what commands a Unix system must support. http://www.opengroup.org/onlinepubs/009695399/ The 'date' command (the subject of this bug), is clearly defined. http://www.opengroup.org/onlinepubs/009695399/utilities/date.html At the end of this post, I have listed all the conversion specifiers 'date' is supposed to support. There are lots of them. I doubt BusyBox would support them all. Likewise for commands like 'cp' http://www.opengroup.org/onlinepubs/009695399/utilities/cp.html which was the subject of a recent bug http://sagetrac.org/sage_trac/ticket/6451 as Flint's spkg-install had made use of a '-a' option, which the GNU 'cp' uses, but is not supported by any Unix standard. I do not claim to know all the answers to improve Sage's portability, I'm sure other would disagree with some of those below. But some ideas would be. 1) Under no circumstance use anything not in the 2004 POSIX standard http://www.opengroup.org/onlinepubs/009695399/ 2) Under no circumstances use anything known to be an issue on any supported operating system. (That means it must be tested on Solaris x86, Solaris SPARC, Linux and OS X). 3) Never hard-code names of GNU commands, like gcc. 4) Try not make use of things in the latest C99 'standard' which many compilers will not support. 5) Try not to use anything that is an issue on AIX or HP-UX, which are both unsupported Unix systems, but are both in common use. A free AIX account can be had at http://www.metamodul.com/ 6) Try to not use anything that does not work. There is clearly a lot of work being put into FreeBSD, so lets not make the porting effort any harder. 10) Try to ensure new code builds with native compilers on supported operating systems. One of the BIG benefits of testing on multiple platforms is it shows up bugs that other platforms miss. I had never noticed that the subject of http://sagetrac.org/sage_trac/ticket/7188 was not working on Solaris. I don't know why, but perhaps Sun's error message is not as obvious as HP's. But when I tried to build Sage on HP-UX, that bug was very pronounced. When I checked the code, I realised it was not working on Solaris either. So clearly it had never been checked on one of the supported operating systems. Anyway, hopefully http://sagetrac.org/sage_trac/ticket/7188 should be very easy for someone to review. I've tested it on all supported operating systems, and two unsupported operating systems. Dave ------------------------------ Conversion Specifications %a Locale's abbreviated weekday name. %A Locale's full weekday name. %b Locale's abbreviated month name. %B Locale's full month name. %c Locale's appropriate date and time representation. %C Century (a year divided by 100 and truncated to an integer) as a decimal number [00,99]. %d Day of the month as a decimal number [01,31]. %D Date in the format mm/dd/yy. %e Day of the month as a decimal number [1,31] in a two-digit field with leading space character fill. %h A synonym for %b. %H Hour (24-hour clock) as a decimal number [00,23]. %I Hour (12-hour clock) as a decimal number [01,12]. %j Day of the year as a decimal number [001,366]. %m Month as a decimal number [01,12]. %M Minute as a decimal number [00,59]. %n A <newline>. %p Locale's equivalent of either AM or PM. %r 12-hour clock time [01,12] using the AM/PM notation; in the POSIX locale, this shall be equivalent to %I : %M : %S %p. %S Seconds as a decimal number [00,60]. %t A <tab>. %T 24-hour clock time [00,23] in the format HH:MM:SS. %u Weekday as a decimal number [1,7] (1=Monday). %U Week of the year (Sunday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Sunday shall be considered to be in week 0. %V Week of the year (Monday as the first day of the week) as a decimal number [01,53]. If the week containing January 1 has four or more days in the new year, then it shall be considered week 1; otherwise, it shall be the last week of the previous year, and the next week shall be week 1. %w Weekday as a decimal number [0,6] (0=Sunday). %W Week of the year (Monday as the first day of the week) as a decimal number [00,53]. All days in a new year preceding the first Monday shall be considered to be in week 0. %x Locale's appropriate date representation. %X Locale's appropriate time representation. %y Year within century [00,99]. %Y Year with century as a decimal number. %Z Timezone name, or no characters if no timezone is determinable. %% A percent sign character. --~--~---------~--~----~------------~-------~--~----~ To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---