20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
PATH="${PATH}:$(cd "$(dirname "$(which "$0")")" && pwd)"
if [ "$1" == '--cpio' ]; then
shift
mode='file'
pkgfile="$1"
else
mode='dir'
|
|
>
>
>
>
>
>
>
>
|
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
PATH="${PATH}:$(cd "$(dirname "$(which "$0")")" && pwd)"
if [ "$1" = '--cpio' ]; then
shift
if [ "$1" = '--beta' ]; then
shift
setLatest=0
else
setLatest=1
fi
mode='file'
pkgfile="$1"
else
mode='dir'
|
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
fi
if [ -n "${sitecert}" ]; then
sitecert="$(readlink -f "${sitecert}")"
fi
if [ -z "${pkgsdir}" -a -z "${pkgfile}" ] || [ -z "${appfsdir}" ]; then
echo 'Usage: appfs-mk {--cpio <pkgfile>|<pkgsdir>} <appfsdir> [<site-key> [<site-certificate>]]' >&2
exit 1
fi
appfsdir="$(cd "${appfsdir}" && pwd)"
if [ -z "${appfsdir}" ]; then
echo "Unable to find appfs directory." >&2
|
|
|
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
fi
if [ -n "${sitecert}" ]; then
sitecert="$(readlink -f "${sitecert}")"
fi
if [ -z "${pkgsdir}" -a -z "${pkgfile}" ] || [ -z "${appfsdir}" ]; then
echo 'Usage: appfs-mk {--cpio [--beta] <pkgfile>|<pkgsdir>} <appfsdir> [<site-key> [<site-certificate>]]' >&2
exit 1
fi
appfsdir="$(cd "${appfsdir}" && pwd)"
if [ -z "${appfsdir}" ]; then
echo "Unable to find appfs directory." >&2
|
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
|
dirdate="$(find . -type f -printf '%TY%Tm%Td%TH%TM.%TS\n' -quit | cut -f 1-2 -d '.')"
find . -type d -print0 | xargs -0 -- touch -t "${dirdate}"
# If this archive contains exactly one package mark it as the latest version
chk_package="$(echo *)"
if [ -d "${chk_package}" ]; then
default_isLatest='1'
fi
cat "${oldpackagelistfile}" 2>/dev/null | (
if [ -d "${chk_package}" ]; then
sed 's@^\('"{chk_package}"',.*\),1@\1,0@'
else
cat
|
|
|
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
|
dirdate="$(find . -type f -printf '%TY%Tm%Td%TH%TM.%TS\n' -quit | cut -f 1-2 -d '.')"
find . -type d -print0 | xargs -0 -- touch -t "${dirdate}"
# If this archive contains exactly one package mark it as the latest version
chk_package="$(echo *)"
if [ -d "${chk_package}" ]; then
default_isLatest="${setLatest:-1}"
fi
cat "${oldpackagelistfile}" 2>/dev/null | (
if [ -d "${chk_package}" ]; then
sed 's@^\('"{chk_package}"',.*\),1@\1,0@'
else
cat
|