Changeset 48 for trunk


Ignore:
Timestamp:
Jun 24, 2009, 11:04:06 PM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

configure.cmd: Undo temporary file rename operations we perform when building qmake if we fail and exit the script in the middle.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.cmd

    r47 r48  
    732732     * however they are real functions in the library */
    733733
    734     old_qconfig_h = ""
     734    /* use an "at exit" slot to undo temporary file rename operations since we
     735     * can fail in the middle */
     736    exs = AddAtExitSlot()
     737
    735738    qconfig_h = G.OutPath"\src\corelib\global\qconfig.h"
    736739    qmake_qconfig_h = qconfig_h".qmake"
    737740    if (FileExists(qconfig_h)) then do
    738          old_qconfig_h = qconfig_h
    739          call MoveFile old_qconfig_h, old_qconfig_h".old"
     741        call MoveFile qconfig_h, qconfig_h".old"
     742        /* record undo Move operation */
     743        call PutToAtExitSlot exs, 'call MoveFile "'qconfig_h'.old", "'qconfig_h'"'
    740744    end
    741745
     
    746750
    747751    call MoveFile qmake_qconfig_h, qconfig_h
     752
     753
     754
    748755    list.1 = G.OutPath"\include\QtCore\qconfig.h"
    749756    list.2 = G.OutPath"\include\Qt\qconfig.h"
     
    761768
    762769    /* put back original qconfig.h */
    763     call MoveFile qconfig_h, qmake_qconfig_h
    764     if (old_qconfig_h \== "") then
    765         call MoveFile old_qconfig_h".old", old_qconfig_h
     770    call RunAtExitSlot exs
    766771
    767772    /* exit on failure */
     
    23352340 *  @version 1.1
    23362341 */
    2337 /* <<< export to qt.cmd starts */
    23382342AddPathVar: procedure expose (Globals)
    23392343    parse arg name, path, mode, environment
     
    23852389    else call value name, cur
    23862390    return
    2387 /* >>> export to qt.cmd ends */
    23882391
    23892392/**
    23902393 *  Shortcut to AddPathVar(name, path, prepend, 'OS2ENVIRONMENT')
    23912394 */
    2392 /* <<< export to qt.cmd starts */
    23932395AddPathEnv: procedure expose (Globals)
    23942396    parse arg name, path, prepend
    23952397    call AddPathVar name, path, prepend, 'OS2ENVIRONMENT'
    23962398    return
    2397 /* >>> export to qt.cmd ends */
    23982399
    23992400/**
     
    24222423    end
    24232424    return str
     2425
     2426
     2427
     2428
     2429
     2430
     2431
     2432
     2433
     2434
     2435
     2436
     2437
     2438
     2439
     2440
     2441
     2442
     2443
     2444
     2445
     2446
     2447
     2448
     2449
     2450
     2451
     2452
     2453
     2454
     2455
     2456
     2457
     2458
     2459
     2460
     2461
     2462
     2463
     2464
     2465
     2466
     2467
     2468
     2469
     2470
     2471
     2472
     2473
     2474
     2475
    24242476
    24252477/**
     
    24882540    call value 'G.Done_done', 1
    24892541    /* cleanup stuff goes there */
    2490     /* ... */
     2542    if (symbol('G.AtExit.0') == 'VAR') then do
     2543        /* run all AtExit slots */
     2544        do i = 1 to G.AtExit.0
     2545            if (symbol('G.AtExit.'i) == 'VAR') then
     2546                call RunAtExitSlot i
     2547        end
     2548    end
     2549    drop G.AtExit.
    24912550    /* finally, exit */
    24922551    exit code
Note: See TracChangeset for help on using the changeset viewer.