Merge lp:~cwayne/project-rootstock-ng/mimes into lp:~ogra/project-rootstock-ng/trunk

Proposed by Chris Wayne
Status: Merged
Merged at revision: 31
Proposed branch: lp:~cwayne/project-rootstock-ng/mimes
Merge into: lp:~ogra/project-rootstock-ng/trunk
Diff against target: 45 lines (+19/-5)
1 file modified
rootstock-touch-install (+19/-5)
To merge this branch: bzr merge lp:~cwayne/project-rootstock-ng/mimes
Reviewer Review Type Date Requested Status
Oliver Grawert Pending
Review via email: mp+206788@code.launchpad.net

Description of the change

Allow for the rootfs tar to be mimetype application/x-gzip too

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'rootstock-touch-install'
2--- rootstock-touch-install 2014-02-17 14:26:46 +0000
3+++ rootstock-touch-install 2014-02-17 18:48:10 +0000
4@@ -90,16 +90,30 @@
5
6 TARBALL=$(basename $TARPATH)
7
8-if [ -z "$TARBALL" ] || [ -z "$SYSIMG" ] || \
9- [ "$(file --mime-type $TARPATH|sed 's/^.* //')" != "application/gzip" ] || \
10+if [ -z "$TARBALL" ]; then
11+ echo "need valid rootfs tarball path"
12+ usage
13+fi
14+
15+TARTYPE=$(file --mime-type $TARPATH|sed 's/^.* //')
16+case ${TARTYPE#application\/} in
17+ gzip|x-gzip)
18+ ;;
19+ *)
20+ echo "Need valid rootfs tarball gzip type"
21+ usage
22+ ;;
23+esac
24+
25+if [ -z "$SYSIMG" ] || \
26 [ "$(file --mime-type $SYSIMG|sed 's/^.* //')" != "application/octet-stream" ]; then
27- echo "need valid tarball and system.img paths"
28+ echo "need valid system.img path and type application/octet-stream"
29 usage
30 fi
31
32 if [ ! -z $CUST_TARPATH ] && \
33 [ "$(file --mime-type $CUST_TARPATH|sed 's/^.* //')" != "application/x-xz" ]; then
34- echo "Custom tarball needs to be .tar.xz"
35+ echo "Custom tarball needs to be valid path and type .tar.xz"
36 usage
37 fi
38
39@@ -167,4 +181,4 @@
40 echo "[done]"
41
42 echo "rebooting device"
43-adb reboot
44+adb reboot
45\ No newline at end of file

Subscribers

People subscribed via source and target branches