Changes in / [bd29f9c9:c15849c] in mainline


Ignore:
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • boot/generic/src/str.c

    rbd29f9c9 rc15849c  
    354354 *
    355355 * Do a char-by-char comparison of two NULL-terminated strings.
    356  * The strings are considered equal iff their length is equal
    357  * and both strings consist of the same sequence of characters.
    358  *
    359  * A string is smaller than another string iff it is shorter or
    360  * has a character with lower value at the first position where
    361  * the strings differ.
     356 * The strings are considered equal iff they consist of the same
     357 * characters on the minimum of their lengths.
    362358 *
    363359 * @param s1 First string to compare.
  • contrib/bazaar/bzreml/__init__.py

    rbd29f9c9 rc15849c  
    108108                if (revision_ac_id == revision_old_id):
    109109                        break
    110                
    111110                yield revision_ac_id
    112111
     
    118117                branch.repository.lock_read()
    119118                try:
    120                         revision_prev_id = revision_old_id
    121                        
    122                         for revision_ac_id in reversed(list(revision_sequence(branch, revision_old_id, revision_new_id))):
    123                                 body = StringIO()
    124                                
     119                        body = StringIO()
     120                       
     121                        for revision_ac_id in revision_sequence(branch, revision_old_id, revision_new_id):
    125122                                revision_ac = branch.repository.get_revision(revision_ac_id)
    126123                                revision_ac_no = branch.revision_id_to_revno(revision_ac_id)
     
    142139                                body.write("\n")
    143140                               
    144                                 commit_message = None
     141                                commit_message = ""
    145142                                body.write("Log:\n")
    146143                                if (not revision_ac.message):
     
    150147                                        for line in log.split("\n"):
    151148                                                body.write("%s\n" % line)
    152                                                 if (commit_message == None):
     149                                                if (commit_message == ""):
    153150                                                        commit_message = line
    154151                               
    155                                 if (commit_message == None):
     152                                if (commit_message == ""):
    156153                                        commit_message = "(empty)"
    157154                               
    158155                                body.write("\n")
    159                                
    160                                 tree_prev = branch.repository.revision_tree(revision_prev_id)
    161                                 tree_ac = branch.repository.revision_tree(revision_ac_id)
    162                                
    163                                 delta = tree_ac.changes_from(tree_prev)
    164                                
    165                                 if (len(delta.added) > 0):
    166                                         body.write("Added:\n")
    167                                         for item in delta.added:
    168                                                 body.write("    %s\n" % item[0])
    169                                
    170                                 if (len(delta.removed) > 0):
    171                                         body.write("Removed:\n")
    172                                         for item in delta.removed:
    173                                                 body.write("    %s\n" % item[0])
    174                                
    175                                 if (len(delta.renamed) > 0):
    176                                         body.write("Renamed:\n")
    177                                         for item in delta.renamed:
    178                                                 body.write("    %s -> %s\n" % (item[0], item[1]))
    179                                
    180                                 if (len(delta.kind_changed) > 0):
    181                                         body.write("Changed:\n")
    182                                         for item in delta.kind_changed:
    183                                                 body.write("    %s\n" % item[0])
    184                                
    185                                 if (len(delta.modified) > 0):
    186                                         body.write("Modified:\n")
    187                                         for item in delta.modified:
    188                                                 body.write("    %s\n" % item[0])
    189                                
    190                                 body.write("\n")
    191                                
    192                                 tree_prev.lock_read()
     156                       
     157                        tree_old = branch.repository.revision_tree(revision_old_id)
     158                        tree_new = branch.repository.revision_tree(revision_new_id)
     159                       
     160                        revision_new_no = branch.revision_id_to_revno(revision_new_id)
     161                        delta = tree_new.changes_from(tree_old)
     162                       
     163                        if (len(delta.added) > 0):
     164                                body.write("Added:\n")
     165                                for item in delta.added:
     166                                        body.write("    %s\n" % item[0])
     167                       
     168                        if (len(delta.removed) > 0):
     169                                body.write("Removed:\n")
     170                                for item in delta.removed:
     171                                        body.write("    %s\n" % item[0])
     172                       
     173                        if (len(delta.renamed) > 0):
     174                                body.write("Renamed:\n")
     175                                for item in delta.renamed:
     176                                        body.write("    %s -> %s\n" % (item[0], item[1]))
     177                       
     178                        if (len(delta.kind_changed) > 0):
     179                                body.write("Changed:\n")
     180                                for item in delta.kind_changed:
     181                                        body.write("    %s\n" % item[0])
     182                       
     183                        if (len(delta.modified) > 0):
     184                                body.write("Modified:\n")
     185                                for item in delta.modified:
     186                                        body.write("    %s\n" % item[0])
     187                       
     188                        body.write("\n")
     189                       
     190                        tree_old.lock_read()
     191                        try:
     192                                tree_new.lock_read()
    193193                                try:
    194                                         tree_ac.lock_read()
    195                                         try:
    196                                                 diff = DiffTree.from_trees_options(tree_prev, tree_ac, body, "utf8", None, "", "", None)
    197                                                 diff.show_diff(None, None)
    198                                         finally:
    199                                                 tree_ac.unlock()
     194                                        diff = DiffTree.from_trees_options(tree_old, tree_new, body, "utf8", None, "", "", None)
     195                                        diff.show_diff(None, None)
    200196                                finally:
    201                                         tree_prev.unlock()
    202                                
    203                                 subject = "r%d - %s" % (revision_ac_no, commit_message)
    204                                 send_smtp("localhost", config_sender(config), config_to(config), subject, body.getvalue())
    205                                
    206                                 revision_prev_id = revision_ac_id
    207                        
     197                                        tree_new.unlock()
     198                        finally:
     199                                tree_old.unlock()
     200                       
     201                        subject = "r%d - %s" % (revision_new_no, commit_message)
     202                       
     203                        send_smtp("localhost", config_sender(config), config_to(config), subject, body.getvalue())
    208204                finally:
    209205                        branch.repository.unlock()
  • contrib/bazaar/bzreml/setup.py

    rbd29f9c9 rc15849c  
    77        description = 'Commit email plugin for Bazaar',
    88        keywords = 'plugin bzr email',
    9         version = '1.3',
     9        version = '1.2',
    1010        url = 'http://www.decky.cz/',
    1111        license = 'BSD',
     
    1313        author_email = 'martin@decky.cz',
    1414        long_description = """Hooks into Bazaar and sends commit notification emails.""",
    15         package_dir = {'bzrlib.plugins.eml':'.'},
     15        package_dir = {'bzrlib.plugins.eml':'.'}, 
    1616        packages = ['bzrlib.plugins.eml']
    1717)
  • kernel/generic/src/lib/str.c

    rbd29f9c9 rc15849c  
    456456 *
    457457 * Do a char-by-char comparison of two NULL-terminated strings.
    458  * The strings are considered equal iff their length is equal
    459  * and both strings consist of the same sequence of characters.
    460  *
    461  * A string is smaller than another string iff it is shorter or
    462  * has a character with lower value at the first position where
    463  * the strings differ.
     458 * The strings are considered equal iff they consist of the same
     459 * characters on the minimum of their lengths.
    464460 *
    465461 * @param s1 First string to compare.
     
    498494 *
    499495 * Do a char-by-char comparison of two NULL-terminated strings.
    500  * The strings are considered equal iff
    501  * min(str_length(s1), max_len) == min(str_length(s2), max_len)
    502  * and both strings consist of the same sequence of characters,
    503  * up to max_len characters.
    504  *
    505  * A string is smaller than another string iff it is shorter or
    506  * has a character with lower value at the first position where
    507  * the strings differ, considering only first max_len characters.
     496 * The strings are considered equal iff they consist of the same
     497 * characters on the minimum of their lengths and the length limit.
    508498 *
    509499 * @param s1      First string to compare.
  • uspace/app/sportdmp/sportdmp.c

    rbd29f9c9 rc15849c  
    3737static void syntax_print(void)
    3838{
    39         fprintf(stderr, "Usage: sportdmp [--baud=<baud>] [device_service]\n");
     39        fprintf(stderr, "Usage: sportdmp <baud> <device_service>\n");
    4040}
    4141
    4242int main(int argc, char **argv)
    4343{
     44        const char* svc_path = "devices/\\hw\\pci0\\00:01.0\\com1\\a";
    4445        sysarg_t baud = 9600;
    45         service_id_t svc_id;
    4646       
    47         int arg = 1;
    48         int rc;
    49                
    50         if (argc > arg && str_test_prefix(argv[arg], "--baud=")) {
    51                 size_t arg_offset = str_lsize(argv[arg], 7);
    52                 char* arg_str = argv[arg] + arg_offset;
    53                 if (str_length(arg_str) == 0) {
    54                         fprintf(stderr, "--baud requires an argument\n");
    55                         syntax_print();
    56                         return 1;
    57                 }
     47        if (argc > 1) {
    5848                char *endptr;
    59                 baud = strtol(arg_str, &endptr, 10);
     49                baud = strtol(argv[1], &endptr, 10);
    6050                if (*endptr != '\0') {
    6151                        fprintf(stderr, "Invalid value for baud\n");
     
    6353                        return 1;
    6454                }
    65                 arg++;
    6655        }
    6756       
    68         if (argc > arg) {
    69                 rc = loc_service_get_id(argv[arg], &svc_id, 0);
    70                 if (rc != EOK) {
    71                         fprintf(stderr, "Cannot find device service %s\n",
    72                             argv[arg]);
    73                         return 1;
    74                 }
    75                 arg++;
    76         }
    77         else {
    78                 category_id_t serial_cat_id;
    79                
    80                 rc = loc_category_get_id("serial", &serial_cat_id, 0);
    81                 if (rc != EOK) {
    82                         fprintf(stderr, "Failed getting id of category "
    83                             "'serial'\n");
    84                         return 1;
    85                 }
    86                
    87                 service_id_t *svc_ids;
    88                 size_t svc_count;
    89                
    90                 rc = loc_category_get_svcs(serial_cat_id, &svc_ids, &svc_count);                if (rc != EOK) {
    91                         fprintf(stderr, "Failed getting list of services\n");
    92                         return 1;
    93                 }
    94                
    95                 if (svc_count == 0) {
    96                         fprintf(stderr, "No service in category 'serial'\n");
    97                         free(svc_ids);
    98                         return 1;
    99                 }
    100                
    101                 svc_id = svc_ids[0];
    102                 free(svc_ids);
     57        if (argc > 2) {
     58                svc_path = argv[2];
    10359        }
    10460       
    105         if (argc > arg) {
    106                 fprintf(stderr, "Too many arguments\n");
     61        if (argc > 3) {
    10762                syntax_print();
    10863                return 1;
    10964        }
    11065       
     66        service_id_t svc_id;
     67        int rc = loc_service_get_id(svc_path, &svc_id, 0);
     68        if (rc != EOK) {
     69                fprintf(stderr, "Cannot find device service %s\n", svc_path);
     70                return 1;
     71        }
    11172       
    11273        async_sess_t *sess = loc_service_connect(EXCHANGE_SERIALIZE, svc_id,
    11374            IPC_FLAG_BLOCKING);
    11475        if (!sess) {
    115                 fprintf(stderr, "Failed connecting to service\n");
     76                fprintf(stderr, "Failed connecting to service %s\n", svc_path);
    11677        }
    11778       
  • uspace/lib/c/arch/abs32le/_link.ld.in

    rbd29f9c9 rc15849c  
    1414SECTIONS {
    1515#ifdef LOADER
    16         . = 0x70001000 + SIZEOF_HEADERS;
    17        
    1816        .interp : {
    1917                *(.interp);
    20         } :interp :text
     18        } :interp
     19       
     20        . = 0x70001000 + SIZEOF_HEADERS;
    2121#else
    2222        . = 0x1000 + SIZEOF_HEADERS;
    2323#endif
    24        
    2524        .text : {
    2625                *(.text .text.*);
  • uspace/lib/c/arch/amd64/_link.ld.in

    rbd29f9c9 rc15849c  
    1515SECTIONS {
    1616#ifdef LOADER
    17         . = 0x70001000 + SIZEOF_HEADERS;
    18        
    1917        .interp : {
    2018                *(.interp);
    21         } :interp :text
     19        } :interp
     20       
     21        . = 0x70001000 + SIZEOF_HEADERS;
    2222#else
    2323        . = 0x1000 + SIZEOF_HEADERS;
    2424#endif
    25        
    2625        .init : {
    2726                *(.init);
  • uspace/lib/c/arch/arm32/_link.ld.in

    rbd29f9c9 rc15849c  
    1414SECTIONS {
    1515#ifdef LOADER
    16         . = 0x70001000 + SIZEOF_HEADERS;
    17        
    1816        .interp : {
    1917                *(.interp);
    20         } :interp :text
     18        } :interp
     19       
     20        . = 0x70001000 + SIZEOF_HEADERS;
    2121#else
    2222        . = 0x1000 + SIZEOF_HEADERS;
    2323#endif
    24        
    2524        .init : {
    2625                *(.init);
  • uspace/lib/c/arch/ia32/_link.ld.in

    rbd29f9c9 rc15849c  
    1919
    2020SECTIONS {
     21#if defined(LOADER) || defined(DLEXE)
     22        .interp : {
     23                *(.interp);
     24        } :interp
     25#endif
    2126#ifdef LOADER
    2227        . = 0x70001000 + SIZEOF_HEADERS;
     
    2429        . = 0x1000 + SIZEOF_HEADERS;
    2530#endif
    26        
    27 #if defined(LOADER) || defined(DLEXE)
    28         .interp : {
    29                 *(.interp);
    30         } :interp :text
    31 #endif
    32        
    3331        .init : {
    3432                *(.init);
  • uspace/lib/c/arch/ia64/_link.ld.in

    rbd29f9c9 rc15849c  
    1414SECTIONS {
    1515#ifdef LOADER
    16         . = 0x800000000 + SIZEOF_HEADERS;
    17        
    1816        .interp : {
    1917                *(.interp);
    20         } :interp :text
     18        } :interp
     19       
     20        . = 0x800000000 + SIZEOF_HEADERS;
    2121#else
    2222        . = 0x4000 + SIZEOF_HEADERS;
    2323#endif
    24        
    2524        /*
    2625         * XXX This is just a work around. Problem: .init section does not
     
    2827         */
    2928        . = ALIGN(., 16);
    30        
     29
    3130        .init : {
    3231                *(.init);
  • uspace/lib/c/arch/mips32/_link.ld.in

    rbd29f9c9 rc15849c  
    1414SECTIONS {
    1515#ifdef LOADER
    16         . = 0x70004000 + SIZEOF_HEADERS;
    17        
    1816        .interp : {
    1917                *(.interp);
    20         } :interp :text
     18        } :interp
     19       
     20        . = 0x70004000 + SIZEOF_HEADERS;
    2121#else
    2222        . = 0x4000 + SIZEOF_HEADERS;
    2323#endif
    24        
    2524        .init : {
    2625                *(.init);
  • uspace/lib/c/arch/mips64/_link.ld.in

    rbd29f9c9 rc15849c  
    1515SECTIONS {
    1616#ifdef LOADER
    17         . = 0x70004000 + SIZEOF_HEADERS;
    18        
    1917        .interp : {
    2018                *(.interp);
    21         } :interp :text
     19        } :interp
     20       
     21        . = 0x70004000 + SIZEOF_HEADERS;
    2222#else
    2323        . = 0x4000 + SIZEOF_HEADERS;
    2424#endif
    25        
    2625        .init : {
    2726                *(.init);
  • uspace/lib/c/arch/ppc32/_link.ld.in

    rbd29f9c9 rc15849c  
    1515SECTIONS {
    1616#ifdef LOADER
    17         . = 0x70001000 + SIZEOF_HEADERS;
    18        
    1917        .interp : {
    2018                *(.interp);
    21         } :interp :text
     19        } :interp
     20       
     21        . = 0x70001000 + SIZEOF_HEADERS;
    2222#else
    2323        . = 0x1000 + SIZEOF_HEADERS;
    2424#endif
    25        
    2625        .init : {
    2726                *(.init);
  • uspace/lib/c/arch/sparc64/_link.ld.in

    rbd29f9c9 rc15849c  
    1414SECTIONS {
    1515#ifdef LOADER
    16         . = 0x70004000 + SIZEOF_HEADERS;
    17        
    1816        .interp : {
    1917                *(.interp);
    20         } :interp :text
     18        } :interp
     19       
     20        . = 0x70004000 + SIZEOF_HEADERS;
    2121#else
    2222        . = 0x4000 + SIZEOF_HEADERS;
    2323#endif
    24        
    2524        .init : {
    2625                *(.init);
  • uspace/lib/c/generic/str.c

    rbd29f9c9 rc15849c  
    428428 *
    429429 * Do a char-by-char comparison of two NULL-terminated strings.
    430  * The strings are considered equal iff their length is equal
    431  * and both strings consist of the same sequence of characters.
    432  *
    433  * A string is smaller than another string iff it is shorter or
    434  * has a character with lower value at the first position where
    435  * the strings differ.
     430 * The strings are considered equal iff they consist of the same
     431 * characters on the minimum of their lengths.
    436432 *
    437433 * @param s1 First string to compare.
     
    470466 *
    471467 * Do a char-by-char comparison of two NULL-terminated strings.
    472  * The strings are considered equal iff
    473  * min(str_length(s1), max_len) == min(str_length(s2), max_len)
    474  * and both strings consist of the same sequence of characters,
    475  * up to max_len characters.
    476  *
    477  * A string is smaller than another string iff it is shorter or
    478  * has a character with lower value at the first position where
    479  * the strings differ, considering only first max_len characters.
     468 * The strings are considered equal iff they consist of the same
     469 * characters on the minimum of their lengths and the length limit.
    480470 *
    481471 * @param s1      First string to compare.
     
    518508        return 0;
    519509
    520 }
    521 
    522 /** Test whether p is a prefix of s.
    523  *
    524  * Do a char-by-char comparison of two NULL-terminated strings
    525  * and determine if p is a prefix of s.
    526  *
    527  * @param s The string in which to look
    528  * @param p The string to check if it is a prefix of s
    529  *
    530  * @return true iff p is prefix of s else false
    531  *
    532  */
    533 bool str_test_prefix(const char *s, const char *p)
    534 {
    535         wchar_t c1 = 0;
    536         wchar_t c2 = 0;
    537        
    538         size_t off1 = 0;
    539         size_t off2 = 0;
    540 
    541         while (true) {
    542                 c1 = str_decode(s, &off1, STR_NO_LIMIT);
    543                 c2 = str_decode(p, &off2, STR_NO_LIMIT);
    544                
    545                 if (c2 == 0)
    546                         return true;
    547 
    548                 if (c1 != c2)
    549                         return false;
    550                
    551                 if (c1 == 0)
    552                         break;
    553         }
    554 
    555         return false;
    556510}
    557511
  • uspace/lib/c/include/str.h

    rbd29f9c9 rc15849c  
    7979extern int str_lcmp(const char *s1, const char *s2, size_t max_len);
    8080
    81 extern bool str_test_prefix(const char *s, const char *p);
    82 
    8381extern void str_cpy(char *dest, size_t size, const char *src);
    8482extern void str_ncpy(char *dest, size_t size, const char *src, size_t n);
  • uspace/lib/clui/tinput.c

    rbd29f9c9 rc15849c  
    601601       
    602602        unsigned int cols = max(1, (ti->con_cols + 1) / (max_length + 1));
    603         unsigned int padding = 0;
    604         if ((cols * max_length) + (cols - 1) < ti->con_cols) {
    605                 padding = ti->con_cols - (cols * max_length) - (cols - 1);
    606         }
    607         unsigned int col_width = max_length + padding / cols;
     603        unsigned int col_width = ti->con_cols / cols;
    608604        unsigned int rows = cnum / cols + ((cnum % cols) != 0);
    609605       
  • uspace/srv/loader/interp.S

    rbd29f9c9 rc15849c  
    55#
    66
    7 #if ((defined(UARCH_abs32le)) && (defined(COMPILER_gcc_cross)) \
    8     && (defined(CROSS_TARGET_arm32)))
    9         #define ATSIGN(arg)  % ## arg
     7#ifdef UARCH_arm32
     8#define AT_NOTE %note
     9#else
     10#define AT_NOTE @note
    1011#endif
    1112
    12 #ifdef UARCH_arm32
    13         #define ATSIGN(arg)  % ## arg
    14 #endif
    15 
    16 #ifndef ATSIGN
    17         #define ATSIGN(arg)  @ ## arg
    18 #endif
    19 
    20 .section .interp, "a", ATSIGN(progbits)
     13.section .interp, "a", AT_NOTE
    2114        .string "kernel"
Note: See TracChangeset for help on using the changeset viewer.