[Merge] lp:~jani/goget-ubuntu-touch/push-errormsg into lp:goget-ubuntu-touch

Sergio Schvezov sergio.schvezov at canonical.com
Tue Feb 10 01:22:02 UTC 2015


one minor comment

Diff comments:

> === modified file 'devices/adb.go'
> --- devices/adb.go	2014-09-25 13:40:20 +0000
> +++ devices/adb.go	2015-02-09 13:29:23 +0000
> @@ -76,7 +76,11 @@
>  func (adb AndroidDebugBridge) Push(src, dst string) (err error) {
>  	// TODO add file path verification
>  	cmd := append(adb.params, []string{"push", src, dst}...)
> -	return exec.Command(adbCommand, cmd...).Run()
> +	b, err := exec.Command(adbCommand, cmd...).CombinedOutput()
> +	if err != nil {
> +		return fmt.Errorf("Error pushing: %s\n", b)

"Error" should be lower case.

> +	}
> +	return nil
>  }
>  
>  // Pull copies a file from src to dst over the adb server
> 
> === modified file 'ubuntu-device-flash/touch.go'
> --- ubuntu-device-flash/touch.go	2015-01-15 13:52:31 +0000
> +++ ubuntu-device-flash/touch.go	2015-02-09 13:29:23 +0000
> @@ -304,29 +304,17 @@
>  	if _, err := adb.Shell("rm -rf /cache/recovery/*.xz /cache/recovery/*.xz.asc"); err != nil {
>  		log.Fatal("Cannot cleanup /cache/recovery/ to ensure clean deployment", err)
>  	}
> -	freeSpace := "unknown"
> -	dfCacheCmd := "df -h | grep /android/cache"
> -	if free, err := adb.Shell(dfCacheCmd); err != nil {
> -		log.Fatal("Unable to retrieve free space on target")
> -	} else {
> -		//Filesystem Size Used Avail Use% Mounted on
> -		free := strings.Fields(free)
> -		if len(free) > 3 {
> -			freeSpace = free[3]
> -		}
> -	}
> -	errMsg := "Cannot push %s to device: free space on /cache/recovery is %s"
>  	for {
>  		file := <-files
>  		go func() {
>  			log.Printf("Start pushing %s to device", file.FilePath)
>  			err := adb.Push(file.FilePath, "/cache/recovery/")
>  			if err != nil {
> -				log.Fatalf(errMsg, file.SigPath, freeSpace)
> +				log.Fatal(err)
>  			}
>  			err = adb.Push(file.SigPath, "/cache/recovery/")
>  			if err != nil {
> -				log.Fatalf(errMsg, file.SigPath, freeSpace)
> +				log.Fatal(err)
>  			}
>  			log.Printf("Done pushing %s to device", file.FilePath)
>  			done <- true
> 


-- 
https://code.launchpad.net/~jani/goget-ubuntu-touch/push-errormsg/+merge/249072
Your team Ubuntu Phablet Team is subscribed to branch lp:goget-ubuntu-touch.



More information about the Ubuntu-reviews mailing list