VirtualBox

Changeset 39397 in vbox for trunk/tools


Ignore:
Timestamp:
Nov 23, 2011 9:39:56 AM (13 years ago)
Author:
vboxsync
Message:

duplicate elimination.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/bin/gen-slickedit-workspace.sh

    r39396 r39397  
    562562
    563563    MY_HDR_FILES=`  echo ${MY_ROOT_DIR}/include/VBox/*.h ${MY_ROOT_DIR}/include/VBox/vmm/*.h \
    564                   | ${MY_SED} -e '/VBox\/err.h/d' `
     564                  | ${MY_SED} -e 's,${MY_ROOT_DIR}/include/VBox/err.h,,' `
    565565    MY_HDR_FILES="${MY_HDR_FILES} ${MY_ROOT_DIR}/include/iprt/cdefs.h"
    566566    ${MY_SED} \
     
    574574        -e 's/#  */#/g' \
    575575        -e 's/   */ /g' \
    576         -e '/(type) DECLEXPORT/d' \
    577         -e '/(a_Type) DECLEXPORT/d' \
    578576        -e '/ DECLEXPORT_CLASS/d' \
    579577        -e 's/ *VBOXCALL//' \
    580578        -e 's/ *RTCALL//' \
    581         -e 's/(type) DECLIMPORT(type)/(type) type/' \
    582         -e 's/(a_Type) DECLIMPORT(a_Type)/(type) type/' \
    583579        -e '/ DECLASM(type) type/d' \
    584580        -e '/define  *DECL..CALLBACKMEMBER(type[^)]*) *RT/d' \
     
    586582        -e '/define  *DECL_FORCE_INLINE(type)/d' \
    587583        -e '/  *DECL_INVALID(/d' \
    588         -e '/define RT[DATGRC03]*DECL(type) *DECLHIDDEN(type)/d' \
    589         -e '/define RT[DATGRC03]*DECL(a_Type) *DECLHIDDEN(a_Type)/d' \
     584        \
    590585        -e 's/(type) DECLHIDDEN(type)/(type) type/' \
    591         -e 's/(a_Type) DECLHIDDEN(a_Type)/(type) type/' \
     586        -e 's/(type) DECLEXPORT(type)/(type) type/' \
     587        -e 's/(type) DECLIMPORT(type)/(type) type/' \
     588        -e 's/(a_Type) DECLHIDDEN(a_Type)/(a_Type) a_Type/' \
     589        -e 's/(a_Type) DECLEXPORT(a_Type)/(a_Type) a_Type/' \
     590        -e 's/(a_Type) DECLIMPORT(a_Type)/(a_Type) a_Type/' \
    592591        \
    593592        --append "${MY_FILE}" \
     
    597596        | ${MY_SED} -e 's/_/\x1F/g' -e 's/(/\x1E/g' -e 's/[[:space:]][[:space:]]*/\x1C/g' \
    598597        | ${MY_SED} -e 's/\x1F/_/g' -e 's/\x1E/(/g' -e 's/\x1C/ /g' \
     598        | ${MY_SORT} \
    599599        | ${MY_SED} -e '/#define/s/$/ \/\/ vbox/' --output "${MY_FILE}.2"
     600
     601    # Eliminate duplicates.
     602    > "${MY_FILE}.3"
     603    exec < "${MY_FILE}.2"
     604    MY_PREV_DEFINE=""
     605    while read MY_LINE;
     606    do
     607        MY_DEFINE=`echo "${MY_LINE}" | ${MY_SED} -e 's/^#define \([^ ()]*\).*$/\1/' `
     608        if test "${MY_DEFINE}" != "${MY_PREV_DEFINE}"; then
     609            MY_PREV_DEFINE=${MY_DEFINE}
     610            echo "${MY_LINE}" >> "${MY_FILE}.3"
     611        fi
     612    done
    600613
    601614    # Append non-vbox bits from the current user config.
    602615    if test -n "${MY_USERCPP_H_FULL}"  -a  -f "${MY_USERCPP_H_FULL}"; then
    603         ${MY_SED} -e '/ \/\/ vbox$/d' -e '/^[[:space:]]*$/d' --append "${MY_FILE}" "${MY_USERCPP_H_FULL}"
     616        ${MY_SED} -e '/ \/\/ vbox$/d' -e '/^[[:space:]]*$/d' --append "${MY_FILE}.3" "${MY_USERCPP_H_FULL}"
    604617    fi
    605618
    606619    # Finalize the file (sort + blank lines).
    607     ${MY_CAT} "${MY_FILE}.2" \
    608         | ${MY_SORT} \
     620    ${MY_CAT} "${MY_FILE}.3" \
    609621        | ${MY_SED} -e 's/$/\n/' --output "${MY_FILE}"
    610     ${MY_RM} -f "${MY_FILE}.2"
     622    ${MY_RM} -f "${MY_FILE}.2" "${MY_FILE}.3"
    611623
    612624    # Install it.
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette