dot

packages and services management
Log | Files | Refs | README

pack-get (632B)


      1 #!/bin/sh -e
      2 PACK=${PACK:-/var/pack}
      3 pack=$1 version=${2:-$(sed q "/etc/pack/$1/version")}
      4 
      5 if [ -d "$PACK/src/$pack/$version" ]; then exit 0; fi
      6 printf '  get'
      7 mkdir -p "$PACK/log/$pack/$version"
      8 exec >$PACK/log/$pack/$version/get 2>&1
      9 
     10 test -f "$PACK/tar/$version/$pack.tar" ||
     11 while IFS= read -r url; do
     12 	case $url in
     13 	(http://*|https://*) pack-http "$pack" "$version" "$url" ;;
     14 	(git://*)            pack-git "$pack" "$version" "$url" ;;
     15 	(ftp://*|ftps://*)   pack-ftp "$pack" "$version" "$url" ;;
     16 	(cvs://*)            pack-cvs "$pack" "$version" "$url" ;;
     17 	esac
     18 done </etc/pack/$pack/uri/$version
     19 
     20 pack-tar "$pack" "$version"