Changeset 4832


Ignore:
Timestamp:
11/27/08 23:03:27 (4 years ago)
Author:
werner
Message:
  • myroot/myroot: auto-detect if opkg-cl supports --cache and try to find the cache directory
  • myroot/myroot: use opkg's new --cache option
File:
1 edited

Legend:

Unmodified
Added
Removed
  • developers/werner/myroot/myroot

    r4803 r4832  
    4444 
    4545 
     46# ----- Find the cache -------------------------------------------------------- 
     47 
     48 
     49for base in $PWD $HOME /home; do 
     50    for dir in "" openmoko moko om; do 
     51        for name in opkg-cache .opkg-cache; do 
     52            try=$base/$dir/$name 
     53            if [ -d $try ]; then 
     54                CACHE=$try 
     55                break 3 
     56            fi 
     57        done 
     58    done 
     59done 
     60 
     61if [ ! -z "`opkg-cl --cache=dummy --version 2>&1 >/dev/null`" -o \ 
     62  -z "$CACHE" ]; then 
     63    cache= 
     64else 
     65    cache="--cache=$CACHE" 
     66fi 
     67 
     68 
    4669# ----- Special commands in the build script ---------------------------------- 
    4770 
     
    4972opkg() 
    5073{ 
    51     LD_LIBRARY_PATH=$LIB $OPKG_CL -f $CONF -o "$root" "$@" 
     74    LD_LIBRARY_PATH=$LIB $OPKG_CL $cache -f $CONF -o "$root" "$@" 
    5275} 
    5376 
     
    5578pkg() 
    5679{ 
    57     LD_LIBRARY_PATH=$LIB $OPKG_CL -f $CONF -o "$root" -V 0 install "$@" 
     80    LD_LIBRARY_PATH=$LIB $OPKG_CL $cache -f $CONF -o "$root" -V 0 install "$@" 
    5881} 
    5982 
Note: See TracChangeset for help on using the changeset viewer.