Annotation of /branches/mage-next/src/up2date/pypi.sh.in
Parent Directory | Revision Log
Revision 2591 -
(hide annotations)
(download)
Tue Mar 4 08:35:27 2014 UTC (10 years, 2 months ago) by niro
File size: 713 byte(s)
Tue Mar 4 08:35:27 2014 UTC (10 years, 2 months ago) by niro
File size: 713 byte(s)
-split function into single includes
1 | niro | 2591 | updatecmd_pypi() |
2 | { | ||
3 | local pname="$1" | ||
4 | local archive="$2" | ||
5 | local uppver | ||
6 | local fullarchive | ||
7 | local tarball= | ||
8 | local seperator | ||
9 | |||
10 | [[ -z ${pname} ]] && die "give me a \$PNAME" | ||
11 | [[ -z ${archive} ]] && die "give me a \$ARCHIVE" | ||
12 | |||
13 | case ${archive} in | ||
14 | gz|bz2) fullarchive=".tar.${archive}" ;; | ||
15 | *) fullarchive=".${archive}" ;; | ||
16 | esac | ||
17 | |||
18 | tarball="${pname}" | ||
19 | seperator="-" | ||
20 | [[ -z ${UP2TARBALL} ]] || tarball="${UP2TARBALL}" | ||
21 | [[ -z ${UP2SEPERATOR} ]] || seperator="${UP2SEPERATOR}" | ||
22 | |||
23 | # we cannot sort with C=M;O=A | ||
24 | uppver=$(updatecmd -listonly https://pypi.python.org/packages/source/${pname:0:1}/${pname}/ | grep ${tarball} | grep ${fullarchive} | sed "s:.*${tarball}${seperator}\(.*\)${fullarchive}:\1:") | ||
25 | upsort ${uppver} | ||
26 | } |