Debian Codegraph @

scripts/bin/list_latest_tarball

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2 # The script is borrowed from
3 #============================================================================
4 # http://staff.washington.edu/corey/tools.html
5 # Author: Corey Satten, corey @ cac.washington.edu, 06/26/03, release 1.8
6 #============================================================================
7 # Modified by Steven Shiau <steven _at_ clonezilla org> Sep/03/07
8 # We use this one to find the last version tar.bz2 in the repository.
9 # Because we might have a lot of tar.bz2...
10 # clonezilla-2.1.8-1.tar.bz2
11 # clonezilla-2.1.8-2.tar.bz2
12 # clonezilla-2.1.8-3.tar.bz2
13 # clonezilla-2.1.9-1.tar.bz2
14 # clonezilla-2.1.9-2.tar.bz2
15 # clonezilla-2.2.0-1.tar.bz2
16 # clonezilla-2.2.0-2.tar.bz2
17 # clonezilla-2.2.0-3.tar.bz2
18 # clonezilla-2.2.0-4.tar.bz2
19 # we just want to list the last one clonezilla-2.2.0-4.tar.bz2
20 #============================================================================
21 # "$GREP_NEWER" is in drbl-functions
22
23 # Load DRBL setting and functions
24 DRBL_SCRIPT_PATH="${DRBL_SCRIPT_PATH:-/usr/share/drbl}"
25
26 . $DRBL_SCRIPT_PATH/sbin/drbl-conf-functions
27
28 # Default settings
29 suf_default="gz"
30 #
31 USAGEscip-shell shell shell-project 0.0.0 USAGE(). () {
32 echoscip-shell system . . echo. "Usage: `basenamescip-shell system . . basename. $0` [path]"
33 echoscip-shell system . . echo. "Example:"
34 echoscip-shell system . . echo. "`basenamescip-shell system . . basename. $0` /mirror/src/stable/"
35 echoscip-shell system . . echo. "`basenamescip-shell system . . basename. $0` http://free.nchc.org.tw/drbl-core/src/stable/"
36 }
37
38 # Try to help people figure out if/when this file has DOS line terminators
39 # Chances are the initial #!/bin/sh will fail with a cryptic "not found" msg
40 # If someone tries to debug it by feeding it to sh manually, this should help:
41 NL=
42 case "$NL" in '');; *) #
43 echoscip-shell system . . echo. "ERROR: $0 was improperly saved with CR-LF newlines." 1>&2 #
44 echoscip-shell system . . echo. "Please try again after restoring Unix-style (LF) newlines" 1>&2 #
45 exit 1 ;; #
46 esac #
47
48 #
49 while [scip-shell system . . `[`. $# -gt 0 ]; do
50 case "$1" in
51 -f|--comp-format)
52 shift;
53 if [scip-shell system . . `[`. -z "$(echoscip-shell system . . echo. $1 |grepscip-shell system . . grep. ^-.)" ]; then
54 # skip the -xx option, in case
55 suf="$1"
56 shift;
57 fi
58 [scip-shell system . . `[`. -z "$ocsroot" ] && USAGEscip-shell shell shell-project 0.0.0 USAGE(). && exit 1
59 ;;
60 -*) echoscip-shell system . . echo. "${0}: ${1}: invalid option" >&2
61 USAGEscip-shell shell shell-project 0.0.0 USAGE(). >& 2
62 exit 2 ;;
63 *) break ;;
64 esac
65 done
66
67 SRC=$1
68 [scip-shell system . . `[`. -z "$SRC" ] && echoscip-shell system . . echo. "You must provide the URL or PATH!" && USAGEscip-shell shell shell-project 0.0.0 USAGE(). && exit 1
69
70 case "$SRC" in */);; *) SRC=$SRC/;; esac # URL must end in slash
71
72 #
73 [scip-shell system . . `[`. -z "$suf" ] && suf="$suf_default"
74
75 #-------------------------------------------------------------------------------
76 list_available_tarball -f $suf $SRC |
77 #-------------------------------------------------------------------------------
78 #
79 # Find all installed packages with patches
80 #
81 (
82 case "${EFLAG}${OFLAG}${UFLAG}" in
83 '')
84 # Note! Here we'd better ot use gawk, not awk (mawk which exists in Debian)
85 gawkscip-shell system . . gawk. "$GREP_NEWER"' # omit all but newest of multiple available patches
86 { L0=R0; L1=R1; L2=R2
87 R0=$0
88 R1=$0; sub(/\.[^.]+.${suf}$/,"",R1) # pkg name+version
89 R2=$0; sub(/-[^-]+$/, "",R2) # pkg name-version
90 if ((R2 == L2) && newer(R1, L1)) {R0=L0; R1=L1}
91 if ((R2 != L2) && L0) {print L0}
92 }
93 END { print R0 }';;
94 *) catscip-shell system . . cat. -;;
95 esac
96 )