| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | # Author: Steven Shiau <steven _at_ clonezilla org> |
| 3 | # License: GPL |
| 4 | # Description: To get the latest version of deb in a local directory. |
| 5 | |
| 6 | # Load DRBL setting and functions |
| 7 | DRBL_SCRIPT_PATH="${DRBL_SCRIPT_PATH:-/usr/share/drbl}" |
| 8 | |
| 9 | . $DRBL_SCRIPT_PATH/sbin/drbl-conf-functions |
| 10 | |
| 11 | |
| 12 | # |
| 13 | usagescip-shell shell shell-project 0.0.0 usage(). () { |
| 14 | echoscip-shell system . . echo. "Usage: `basenamescip-shell system . . basename. $0` [path]" |
| 15 | echoscip-shell system . . echo. "Example:" |
| 16 | echoscip-shell system . . echo. "`basenamescip-shell system . . basename. $0` /mirror/drbl-core/drbl-core/pool/drbl/unstable/drbl/" |
| 17 | } |
| 18 | |
| 19 | TDIR=$1 |
| 20 | [scip-shell system . . `[`. -z "$TDIR" ] && echoscip-shell system . . echo. "You must provide the PATH!" && usagescip-shell shell shell-project 0.0.0 usage(). && exit 1 |
| 21 | latest_deb="$(LC_ALL=C lsscip-shell system . . ls. -lv $TDIR/*.deb 2>/dev/nullscip-shell filesystem . . `/dev/null`. | tailscip-shell system . . tail. -n 1 | awkscip-shell system . . awk. -F" " '{print $NF}')" |
| 22 | if [scip-shell system . . `[`. -n "$latest_deb" ]; then |
| 23 | echoscip-shell system . . echo. "$(basenamescip-shell system . . basename. $latest_deb)" |
| 24 | fi |