summaryrefslogblamecommitdiffstats
path: root/bzr_download.function
blob: 7c528c3080bdf5be90664fd506f4b91c7114ee7b (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
}