Merge lp:~sergiusens/goget-ubuntu-touch/clean into lp:goget-ubuntu-touch

Proposed by Sergio Schvezov
Status: Merged
Approved by: Manuel de la PeΓ±a
Approved revision: 21
Merged at revision: 24
Proposed branch: lp:~sergiusens/goget-ubuntu-touch/clean
Merge into: lp:goget-ubuntu-touch
Diff against target: 34 lines (+8/-1)
2 files modified
ubuntu-device-flash/args.go (+1/-0)
ubuntu-device-flash/main.go (+7/-1)
To merge this branch: bzr merge lp:~sergiusens/goget-ubuntu-touch/clean
Reviewer Review Type Date Requested Status
Alan Pope 🍺🐧🐱 πŸ¦„ (community) Approve
Manuel de la PeΓ±a (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+210266@code.launchpad.net

Commit message

Simple cleanup option for flashing.

Description of the change

This is a quick way of getting a cleanup option in place. Take a look at answering proposals in
https://bugs.launchpad.net/phablet-tools/+bug/1157710/comments/4

To post a comment you must log in.
Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Looks good.

alan@deep-thought:/tmp$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sdb1 231G 33G 197G 15% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 7.8G 4.0K 7.8G 1% /dev
tmpfs 1.6G 1.7M 1.6G 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 7.8G 44M 7.8G 1% /run/shm
none 100M 128K 100M 1% /run/user
/dev/sda1 224G 176G 48G 79% /home
/home/alan/.Private 224G 176G 48G 79% /home/alan
alan@deep-thought:/tmp$ ubuntu-device-flash --help
Usage:
  ubuntu-device-flash [OPTIONS]

Application Options:
      --revision= revision to flash, absolute or relative allowed
      --bootstrap bootstrap the system, do this from the bootloader
      --list-channels List available channels
      --wipe Clear all data after flashing
      --channel= Specify an alternate channel (stable)
      --device= Specify the device to flash
      --serial= Serial of the device to operate
      --server= Use a different image server (https://system-image.ubuntu.com)
      --clean-cache Cleans up cache with all downloaded bits

Help Options:
  -h, --help Show this help message

alan@deep-thought:/tmp$ ubuntu-device-flash --clean-cache
2014/03/10 17:59:27 Cleaning prevously downloaded content
alan@deep-thought:/tmp$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sdb1 231G 33G 197G 15% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
udev 7.8G 4.0K 7.8G 1% /dev
tmpfs 1.6G 1.7M 1.6G 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 7.8G 44M 7.8G 1% /run/shm
none 100M 128K 100M 1% /run/user
/dev/sda1 224G 171G 52G 77% /home
/home/alan/.Private 224G 171G 52G 77% /home/alan

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Manuel de la PeΓ±a (mandel) :
review: Approve
Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

alan@deep-thought:~$ du -hs .cache/ubuntuimages/
1.5G .cache/ubuntuimages/
alan@deep-thought:~$ ubuntu-device-flash --clean-cache
2014/03/17 22:44:59 Cleaning prevously downloaded content
alan@deep-thought:~$ du -hs .cache/ubuntuimages/
du: cannot access β€˜.cache/ubuntuimages/’: No such file or directory

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntu-device-flash/args.go'
2--- ubuntu-device-flash/args.go 2014-02-19 15:17:00 +0000
3+++ ubuntu-device-flash/args.go 2014-03-10 17:42:58 +0000
4@@ -33,6 +33,7 @@
5 Device string `long:"device" description:"Specify the device to flash"`
6 Serial string `long:"serial" description:"Serial of the device to operate"`
7 Server string `long:"server" description:"Use a different image server"`
8+ CleanCache bool `long:"clean-cache" description:"Cleans up cache with all downloaded bits"`
9 }
10
11 var args arguments
12
13=== modified file 'ubuntu-device-flash/main.go'
14--- ubuntu-device-flash/main.go 2014-02-26 12:40:51 +0000
15+++ ubuntu-device-flash/main.go 2014-03-10 17:42:58 +0000
16@@ -40,6 +40,13 @@
17 os.Exit(1)
18 }
19 cacheDir := ubuntuimage.GetCacheDir()
20+ if args.CleanCache {
21+ log.Print("Cleaning prevously downloaded content")
22+ if err := os.RemoveAll(cacheDir); err != nil {
23+ log.Fatal(err)
24+ }
25+ return
26+ }
27 adb, err := devices.NewUbuntuDebugBridge()
28 var fastboot devices.Fastboot
29 if err != nil {
30@@ -272,4 +279,3 @@
31
32 return rpipe
33 }
34-

Subscribers

People subscribed via source and target branches