Merge lp:~matteo-mattei/project-rootstock/main into lp:project-rootstock

Proposed by Matteo Mattei
Status: Needs review
Proposed branch: lp:~matteo-mattei/project-rootstock/main
Merge into: lp:project-rootstock
Diff against target: 74 lines (+20/-6)
1 file modified
rootstock (+20/-6)
To merge this branch: bzr merge lp:~matteo-mattei/project-rootstock/main
Reviewer Review Type Date Requested Status
Ricardo Salveti Pending
Review via email: mp+53477@code.launchpad.net

Description of the change

I've added the possibility to create tar.bz2 archive instead of only tar.gz and I've also added a filter that allow comments (with #) into manifest file.

To post a comment you must log in.

Unmerged revisions

130. By Matteo Mattei <email address hidden>

Add support for tar.bz2 archive and add filter for comments in manifest file

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'rootstock'
2--- rootstock 2011-02-28 06:06:33 +0000
3+++ rootstock 2011-03-15 16:50:50 +0000
4@@ -188,6 +188,9 @@
5
6 -q --quiet
7 Quiet operation, only write to log
8+-a --archive <option>
9+ Select archive type (tgz or tar.bz2)
10+ (default: tgz)
11
12 Advanced:
13
14@@ -652,10 +655,10 @@
15 mount_image
16
17 cd $MOUNTPOINT >>$LOG 2>&1
18- LANG=C tar czvf ../armel-rootfs-$STAMP.tgz . >>$LOG 2>&1
19- mv ../armel-rootfs-$STAMP.tgz $DIR >>$LOG 2>&1
20+ LANG=C tar c${ARCHIVE_FLAG}vf ../armel-rootfs-$STAMP.$ARCHIVE . >>$LOG 2>&1
21+ mv ../armel-rootfs-$STAMP.$ARCHIVE $DIR >>$LOG 2>&1
22
23- echo "I: ARM rootfs created as $DIR/armel-rootfs-$STAMP.tgz"
24+ echo "I: ARM rootfs created as $DIR/armel-rootfs-$STAMP.$ARCHIVE"
25
26 cd - >/dev/null 2>&1
27
28@@ -724,6 +727,8 @@
29 DIR="$(pwd)"
30 NOSWAP=1
31 SWAPSIZE=256
32+ARCHIVE="tgz"
33+ARCHIVE_FLAG="z"
34
35 # general defaults
36 LOG="$BUILDDIR/${PROGRAM}-$STAMP.log"
37@@ -736,10 +741,10 @@
38 CHROOT="eval TMPDIR=/tmp chroot"
39
40 # parse commandline options
41-GETOPT=`getopt -o hf:l:p:n:s:i:g:m:c:t:x:d:q --long help,fqdn:,login:,\
42+GETOPT=`getopt -o h:f:l:p:n:s:i:g:m:c:t:x:d:q:a --long help:,fqdn:,login:,\
43 password:,fullname:,seed:,imagesize:,manifest:,mirror:,components:,timezone:,\
44 kblayout:,kbmodel:,kbvariant:,kboptions:,locale:,keepimage,notarball,script:,\
45-serial:,doswap,swapsize:,dist:,quiet,kernel-image:,copy-package-cache,\
46+serial:,doswap,swapsize:,dist:,quiet,archive:,kernel-image:,copy-package-cache,\
47 restore-package-cache,clean-package-cache,extra-mirror:,no-root,version \
48 -n "$PROGRAM" -- "$@"`
49 if [ $? != 0 ]; then usage; exit 1; fi
50@@ -782,7 +787,7 @@
51 shift 2
52 ;;
53 -g|--manifest)
54- SELECTION="$(cat "${2}" | sed ':a;N;$!ba;s/\n/ /g')"
55+ SELECTION="$(cat "${2}" | sed "{s/#.*//g}" | grep "^[^ ]" | sed ':a;N;$!ba;s/\n/ /g')"
56 shift 2
57 ;;
58 -m|--mirror)
59@@ -859,6 +864,15 @@
60 QUIET=1
61 shift
62 ;;
63+ -a|--archive)
64+ ARCHIVE="$2"
65+ if [ "${ARCHIVE}" = "tar.bz2" ];then
66+ ARCHIVE_FLAG="j"
67+ else
68+ ARCHIVE_FLAG="z"
69+ fi
70+ shift 2
71+ ;;
72 --kernel-image)
73 KERNEL_IMAGE=1
74 KERNEL_URL="$2"

Subscribers

People subscribed via source and target branches