diff --git a/examples/httpd/src/httpd.c b/examples/httpd/src/httpd.c index 6a7964b..3f7e8b5 100644 --- a/examples/httpd/src/httpd.c +++ b/examples/httpd/src/httpd.c @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2012,2013,2014 Adap.tv, Inc. + Copyright (C) 2012,2013,2014,2015 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/examples/httpget/src/httpget.c b/examples/httpget/src/httpget.c index 2759658..52a4ceb 100644 --- a/examples/httpget/src/httpget.c +++ b/examples/httpget/src/httpget.c @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2014 Adap.tv, Inc. + Copyright (C) 2014,2015 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/include/ds_field.h b/include/ds_field.h index 543f153..ff205c3 100644 --- a/include/ds_field.h +++ b/include/ds_field.h @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2012,2013,2014 Adap.tv, Inc. + Copyright (C) 2012,2014 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/include/epoll_worker.h b/include/epoll_worker.h index 30c6add..8317d84 100644 --- a/include/epoll_worker.h +++ b/include/epoll_worker.h @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2012,2013,2014 Adap.tv, Inc. + Copyright (C) 2012,2013,2014,2015 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/include/file_mapper.h b/include/file_mapper.h index b16038e..887e3c9 100644 --- a/include/file_mapper.h +++ b/include/file_mapper.h @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2012,2013 Adap.tv, Inc. + Copyright (C) 2012,2013,2014 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/include/hash_funcs.h b/include/hash_funcs.h index c852781..b44e394 100644 --- a/include/hash_funcs.h +++ b/include/hash_funcs.h @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2012,2014 Adap.tv, Inc. + Copyright (C) 2012,2014,2015 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/include/http_client_pool.h b/include/http_client_pool.h index d8e1f48..463bab5 100644 --- a/include/http_client_pool.h +++ b/include/http_client_pool.h @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2012,2013,2014 Adap.tv, Inc. + Copyright (C) 2012,2013,2014,2015 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/include/http_defs.h b/include/http_defs.h index a1b941e..51eb224 100644 --- a/include/http_defs.h +++ b/include/http_defs.h @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2012,2013 Adap.tv, Inc. + Copyright (C) 2012,2013,2014 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/include/http_headers.h b/include/http_headers.h index bf585e8..f8d492d 100644 --- a/include/http_headers.h +++ b/include/http_headers.h @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2012,2013 Adap.tv, Inc. + Copyright (C) 2012,2013,2015 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/include/list.h b/include/list.h index 39e8c54..4ecd214 100644 --- a/include/list.h +++ b/include/list.h @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2012,2013 Adap.tv, Inc. + Copyright (C) 2012,2014 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/include/lshashtable.h b/include/lshashtable.h index 7ac97ef..1abbc12 100644 --- a/include/lshashtable.h +++ b/include/lshashtable.h @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) Adap.tv, Inc. + Copyright (C) 2017 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/include/mempool.h b/include/mempool.h index b016c15..de060da 100644 --- a/include/mempool.h +++ b/include/mempool.h @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2013 Adap.tv, Inc. + Copyright (C) 2013,2014 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/include/ribs_zlib.h b/include/ribs_zlib.h index aa3c605..8e43f39 100644 --- a/include/ribs_zlib.h +++ b/include/ribs_zlib.h @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2013 Adap.tv, Inc. + Copyright (C) 2013,2014,2015 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/include/ringbuf.h b/include/ringbuf.h index fbdf591..ac06b85 100644 --- a/include/ringbuf.h +++ b/include/ringbuf.h @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2013,2014 Adap.tv, Inc. + Copyright (C) 2013,2014,2017 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/include/ringfile.h b/include/ringfile.h index 4aa3a51..5630ae8 100644 --- a/include/ringfile.h +++ b/include/ringfile.h @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2013,2014 Adap.tv, Inc. + Copyright (C) 2013,2014,2015 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/include/sendemail.h b/include/sendemail.h index c2cd092..e199dcf 100644 --- a/include/sendemail.h +++ b/include/sendemail.h @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2013 Adap.tv, Inc. + Copyright (C) 2013,2015 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/include/timer_worker.h b/include/timer_worker.h index 13a07e4..76dc81c 100644 --- a/include/timer_worker.h +++ b/include/timer_worker.h @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) Adap.tv, Inc. + Copyright (C) 2014 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/include/uri_encode.h b/include/uri_encode.h index ae4db88..2ec2608 100644 --- a/include/uri_encode.h +++ b/include/uri_encode.h @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2013 Adap.tv, Inc. + Copyright (C) 2014 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/runaudit b/runaudit index db0a2a9..17a28fd 100755 --- a/runaudit +++ b/runaudit @@ -4,7 +4,7 @@ # RIBS is an infrastructure for building great SaaS applications (but not # limited to). # -# Copyright (C) 2013,2014 Adap.tv, Inc. +# Copyright (C) 2013,2014,2017 Adap.tv, Inc. # # RIBS is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by @@ -42,19 +42,6 @@ COPYRIGHT_FOOT="\\ BLACKLIST=( "./include/search.h" "./src/search.c" ) -array2str() -{ - local ref=$1[@] - local array=(${!ref}) - local n=${#array[@]} - local i=0 - - while [ $i -lt $n ]; do - echo -n "${array[$i]}" - [ $((++i)) -ne $n ] && echo -n "," - done -} - usage() { echo "$0 -fv" @@ -75,39 +62,55 @@ is_blacklist() return 1 } -CMD="grep -q Copyright" +get_date() +{ + local FILE=$1 + local WORK + + WORK=$(git log --format="%ai" "$FILE" | cut -d "-" -f 1 | sort -un) + echo $WORK | sed -e "s/ /,/g" +} + +get_file() +{ + local FILE=$1 + local DATE + + DATE=$(grep "Copyright (C)" "$FILE" | awk '{ print $3; }') + echo $DATE +} while getopts ':fv' OPTION; do case $OPTION in - f) CMD="false";; + f) force=1;; v) verbose=1;; *) usage;; esac done -for FILE in $(find . -type f -name "*.c" -o -name "*.h"); do +while IFS= read -r -d '' FILE; do [ -n "$verbose" ] && echo -n "Processing $FILE: " - if is_blacklist $FILE; then + if is_blacklist "$FILE"; then [ -n "$verbose" ] && echo "skipped" else - if ! $CMD $FILE; then - [ -n "$verbose" ] || echo -n "Processing $FILE: " - if grep -q Copyright $FILE; then - sed -i -e "1,19 d" $FILE + DATE=$(get_date "$FILE") + CURRENT_DATE=$(get_file "$FILE") + + if [ -n "$force" -o "$DATE" != "$CURRENT_DATE" ]; then + [ ! -n "$verbose" ] && echo -n "Processing $FILE: " + if [ ! -z "$CURRENT_DATE" ]; then + sed -i -e "1,19 d" "$FILE" MSG="rebuilt" else MSG="corrected" fi - WORK=($(git log --format="%ai" $FILE | cut -d "-" -f 1 | sort -un)) - DATE=$(array2str WORK) - - sed -i -e "1i $COPYRIGHT_FOOT" $FILE - sed -i -e "1i \ \ \ \ Copyright (C) $DATE Adap.tv, Inc." $FILE - sed -i -e "1i $COPYRIGHT_HEAD" $FILE + sed -i -e "1i $COPYRIGHT_HEAD" \ + -e "1i \ \ \ \ Copyright (C) $DATE Adap.tv, Inc." \ + -e "1i $COPYRIGHT_FOOT" "$FILE" echo "$MSG" else [ -n "$verbose" ] && echo "unchanged" fi fi -done +done < <(find . -type f \( -name "*.c" -o -name "*.h" \) -print0) diff --git a/src/_epoll_worker.c b/src/_epoll_worker.c index 47d8bd2..95a57ce 100644 --- a/src/_epoll_worker.c +++ b/src/_epoll_worker.c @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2012,2013,2014 Adap.tv, Inc. + Copyright (C) 2012,2013,2014,2015 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/src/_hashtable.c b/src/_hashtable.c index 90be64a..14bf66d 100644 --- a/src/_hashtable.c +++ b/src/_hashtable.c @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2012,2013 Adap.tv, Inc. + Copyright (C) 2012,2013,2014 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/src/_http_client_pool.c b/src/_http_client_pool.c index 2eff363..5c74058 100644 --- a/src/_http_client_pool.c +++ b/src/_http_client_pool.c @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2012,2013,2014 Adap.tv, Inc. + Copyright (C) 2012,2013,2014,2015 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/src/_lhashtable.c b/src/_lhashtable.c index 03706c8..938d6d0 100644 --- a/src/_lhashtable.c +++ b/src/_lhashtable.c @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2012,2013,2014 Adap.tv, Inc. + Copyright (C) 2012,2014 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/src/_ringbuf.c b/src/_ringbuf.c index 5a64ac7..acd6356 100644 --- a/src/_ringbuf.c +++ b/src/_ringbuf.c @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2013,2014 Adap.tv, Inc. + Copyright (C) 2013,2014,2017 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/src/_ringfile.c b/src/_ringfile.c index 7891a48..4a4ce55 100644 --- a/src/_ringfile.c +++ b/src/_ringfile.c @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2013,2014 Adap.tv, Inc. + Copyright (C) 2013,2014,2015 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/src/_uri_encode.c b/src/_uri_encode.c index 9fd9a36..96c89a5 100644 --- a/src/_uri_encode.c +++ b/src/_uri_encode.c @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2013 Adap.tv, Inc. + Copyright (C) 2014 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/src/_vmallocator.c b/src/_vmallocator.c index ce3c64e..c6e1ea2 100644 --- a/src/_vmallocator.c +++ b/src/_vmallocator.c @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2013 Adap.tv, Inc. + Copyright (C) 2013,2014 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/src/context.c b/src/context.c index 71b6c05..a6f931c 100644 --- a/src/context.c +++ b/src/context.c @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2012,2013 Adap.tv, Inc. + Copyright (C) 2012,2013,2014 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/src/epoll_worker.c b/src/epoll_worker.c index c66dd40..315c3bf 100644 --- a/src/epoll_worker.c +++ b/src/epoll_worker.c @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2012,2013,2014 Adap.tv, Inc. + Copyright (C) 2012,2013,2014,2015 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/src/heap.c b/src/heap.c index 1cd2be2..73e860c 100644 --- a/src/heap.c +++ b/src/heap.c @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2013 Adap.tv, Inc. + Copyright (C) 2013,2014 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/src/http_client_pool.c b/src/http_client_pool.c index 07c68de..9fb1941 100644 --- a/src/http_client_pool.c +++ b/src/http_client_pool.c @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2012,2013,2014 Adap.tv, Inc. + Copyright (C) 2012,2013,2014,2015 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/src/http_headers.c b/src/http_headers.c index 845fecc..7faab03 100644 --- a/src/http_headers.c +++ b/src/http_headers.c @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2012,2013 Adap.tv, Inc. + Copyright (C) 2012,2013,2015 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/src/http_server.c b/src/http_server.c index 9ae1053..2acf165 100644 --- a/src/http_server.c +++ b/src/http_server.c @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2012,2013,2014 Adap.tv, Inc. + Copyright (C) 2012,2013,2014,2015 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/src/lshashtable.c b/src/lshashtable.c index f6534df..ca4160e 100644 --- a/src/lshashtable.c +++ b/src/lshashtable.c @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) Adap.tv, Inc. + Copyright (C) 2017 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/src/ribify.c b/src/ribify.c index e8f975f..8936981 100644 --- a/src/ribify.c +++ b/src/ribify.c @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2012,2013 Adap.tv, Inc. + Copyright (C) 2012,2013,2014 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/src/ribs_zlib.c b/src/ribs_zlib.c index 2cda955..1c0fe6c 100644 --- a/src/ribs_zlib.c +++ b/src/ribs_zlib.c @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2013,2014 Adap.tv, Inc. + Copyright (C) 2013,2014,2015 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/src/ringfile.c b/src/ringfile.c index d980b5f..fef99de 100644 --- a/src/ringfile.c +++ b/src/ringfile.c @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2013,2014 Adap.tv, Inc. + Copyright (C) 2013,2014,2015 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/src/sendemail.c b/src/sendemail.c index 63ded3d..4d00271 100644 --- a/src/sendemail.c +++ b/src/sendemail.c @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2013 Adap.tv, Inc. + Copyright (C) 2013,2015 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/src/timeout_handler.c b/src/timeout_handler.c index d029462..d05f397 100644 --- a/src/timeout_handler.c +++ b/src/timeout_handler.c @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2012,2013 Adap.tv, Inc. + Copyright (C) 2012,2013,2015 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/src/timer.c b/src/timer.c index 9138733..dae9747 100644 --- a/src/timer.c +++ b/src/timer.c @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2013 Adap.tv, Inc. + Copyright (C) 2013,2014 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/src/timer_worker.c b/src/timer_worker.c index 8658d08..04baf8d 100644 --- a/src/timer_worker.c +++ b/src/timer_worker.c @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) Adap.tv, Inc. + Copyright (C) 2014 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by diff --git a/src/vmbuf.c b/src/vmbuf.c index 449ef7f..b4be855 100644 --- a/src/vmbuf.c +++ b/src/vmbuf.c @@ -3,7 +3,7 @@ RIBS is an infrastructure for building great SaaS applications (but not limited to). - Copyright (C) 2012,2014 Adap.tv, Inc. + Copyright (C) 2012,2014,2015 Adap.tv, Inc. RIBS is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by