Changeset 1060


Ignore:
Timestamp:
Sep 7, 2011, 11:51:20 PM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

packaging: CreateZIPs: Single directory in format qt-X.Y.Z-N in all ZIPs.

I.e. the prefix (develop, debuginfo) is removed from the directory name.
This allows to easily unpack everything to a single directory (as ti should
be).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • packaging/CreateZIPs.sh

    r1041 r1060  
    7777    local out_base_sym="$2"
    7878
     79    [ -z "$out_base" -o -z "$out_base_sym" ] && \
     80        die "create_zips: invalid arguments."
     81
    7982    run mkdir -p "$out_base_sym/"
    8083
     
    8992}
    9093
     94create_zips()
     95{
     96    [ -z "$start_dir" -o -z "$out_dir" -o \
     97      -z "$pkg_name" -o -z "$full_pkg_name" -o -z "$out_base" ] && \
     98        die "create_zips: invalid arguments."
     99
     100    local out_base_sym="$out_dir/$full_pkg_name-debuginfo/$pkg_name-$ver_dots"
     101
     102    # .SYM files
     103    split_out_sym "$out_base" "$out_base_sym"
     104
     105    local cwd=$(pwd)
     106
     107    run cd "$out_base/.."
     108    run zip -SrX9 "$full_pkg_name-$ver_dots.zip" "$pkg_name-$ver_dots"
     109    run mv "$full_pkg_name-$ver_dots.zip" "$start_dir/"
     110
     111    run cd "$out_base_sym/.."
     112    run zip -SrX9 "$full_pkg_name-debuginfo-$ver_dots.zip" "$pkg_name-$ver_dots"
     113    run mv "$full_pkg_name-debuginfo-$ver_dots.zip" "$start_dir/"
     114
     115    run cd "$cwd"
     116}
     117
    91118cmd_create()
    92119{
    93120    local inst_base="$1"
    94 
    95     [ -d $inst_base ] || die "'$inst_base' is not a directory."
     121    local build_num="$2"
     122
     123    [ -d "$inst_base" ] || die "'$inst_base' is not a directory."
    96124
    97125    local qconfig_pri="$inst_base/mkspecs/qconfig.pri"
     
    112140    local ver_dots="$ver_major.$ver_minor.$ver_patch"
    113141
    114     echo "Found Qt version $ver_dots."
     142    echo "Found Qt version: $ver_dots"
     143
     144    [ -n "$build_num" ] && ver_dots="$ver_dots-$build_num"
     145
     146    echo "Full version ID:  $ver_dots"
    115147
    116148    cmd_cleanup
     
    119151    # commons
    120152    #--------------------------------------------------------------------------
     153
     154    local pkg_name="qt"
    121155
    122156    local designer_dlls="bin/QtDsg*.dll"
     
    127161    #--------------------------------------------------------------------------
    128162
    129     local out_base="$out_dir/qt-$ver_dots"
    130     local out_base_sym="$out_dir/qt-debuginfo-$ver_dots"
     163    local full_pkg_name="qt"
     164    local out_base="$out_dir/$full_pkg_name/$pkg_name-$ver_dots"
    131165
    132166    # Readmes
     
    166200    > "$out_base/bin/qt.conf"
    167201
    168     # .SYM files
    169     split_out_sym "$out_base" "$out_base_sym"
    170 
    171     # ZIPs
    172     run cd "$out_base"
    173     run zip -SrX9 "${out_base##*/}.zip" "."
    174     run mv "${out_base##*/}.zip" "$start_dir/"
    175     #
    176     run cd "$out_base_sym"
    177     run zip -SrX9 "${out_base_sym##*/}.zip" "."
    178     run mv "${out_base_sym##*/}.zip" "$start_dir/"
    179     #
    180     run cd "$start_dir"
     202    create_zips
    181203
    182204    #--------------------------------------------------------------------------
     
    184206    #--------------------------------------------------------------------------
    185207
    186     local out_base="$out_dir/qt-develop-$ver_dots"
    187     local out_base_sym="$out_dir/qt-develop-debuginfo-$ver_dots"
     208    local full_pkg_name="qt-develop"
     209    local out_base="$out_dir/$full_pkg_name/$pkg_name-$ver_dots"
    188210
    189211    # Readmes
     
    235257    cp_files_inst_out "translations/linguist_*"
    236258
    237     # .SYM files
    238     split_out_sym "$out_base" "$out_base_sym"
    239 
    240     # ZIPs
    241     run cd "$out_base"
    242     run zip -SrX9 "${out_base##*/}.zip" "."
    243     run mv "${out_base##*/}.zip" "$start_dir/"
    244     #
    245     run cd "$out_base_sym"
    246     run zip -SrX9 "${out_base_sym##*/}.zip" "."
    247     run mv "${out_base_sym##*/}.zip" "$start_dir/"
    248     #
    249     run cd "$start_dir"
     259    create_zips
    250260
    251261    cmd_cleanup
     
    274284"
    275285Usage:
    276   $script_name -i <dir>   Create all ZIPs.
    277   $script_name cleanup    Remove what this script creates (except ZIPs).
     286  $script_name all [options]    Create ZIPs.
     287  $script_name cleanup          Remove what this script creates (except ZIPs).
    278288
    279289Options:
    280   -i <dir>  Qt installation tree location
     290  <instdir>     (*) Qt installation tree location
     291  <bldnum>          Build number [none]
    281292"
    282293}
    283 
    284 while getopts h?i: OPT; do
    285     case $OPT in
    286         i) OPT_install_dir=$OPTARG;;
    287         h | ?) OPT_help=1
    288     esac
    289 done
    290 shift `expr $OPTIND - 1`
    291294
    292295case "$1" in
    293296    cleanup) cmd_cleanup;;
    294     "")
    295         if [ -n "$OPT_install_dir" ]; then
    296             cmd_create $(echo "$OPT_install_dir" | tr '\\' '/')
     297    all)
     298        if [ -n "$2" ]; then
     299            cmd_create $(echo "$2" | tr '\\' '/') "$3"
    297300        else
    298301            cmd_help
    299302        fi;;
    300     *)
    301         if [ -n "$OPT_help" ]; then cmd_help
    302         else die "Invalid command '$1'"
    303         fi;;
     303    -h|-?|--help|*) cmd_help;;
    304304esac
    305305
Note: See TracChangeset for help on using the changeset viewer.