summaryrefslogblamecommitdiffstats
path: root/bzr_download.function
blob: a0886308e79232d8f7576cf1ea0e68c3ae0d8b70 (plain) (tree)
1
2
3
4
5



                                                                      
                                      









                                                                                

                                                                         





                                                                      
#---------------------------------------------------------------------
## Handler for downloading from bzr URLs
#---------------------------------------------------------------------
function bzr_download() {
  if file_exists $SOURCE_CACHE/$SOURCE
  then
    message "${MESSAGE_COLOR}Unpacking the source...${DEFAULT_COLOR}" &&
    tar xjf $SOURCE_CACHE/$SOURCE &&
    cd $SOURCE_DIRECTORY &&
    message "${MESSAGE_COLOR}Updating...${DEFAULT_COLOR}" &&
    echo bzr update &&
    bzr update &&
    cd -
  else
    message "${MESSAGE_COLOR}Doing a lightweight checkout...${DEFAULT_COLOR}" &&
    echo bzr checkout --lightweight ${SOURCE_URL%:*} $SOURCE_DIRECTORY &&
    bzr checkout --lightweight ${SOURCE_URL%:*} $SOURCE_DIRECTORY
  fi &&

  message "${MESSAGE_COLOR}Repacking the source...${DEFAULT_COLOR}" &&
  tar cjf $SOURCE $SOURCE_DIRECTORY &&
  mv $SOURCE $SOURCE_CACHE
}