diff -Nru ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_build.go ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_build.go
--- ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_build.go 2015-07-01 06:54:24.000000000 +0000
+++ ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_build.go 2015-07-02 19:09:25.000000000 +0000
@@ -22,6 +22,7 @@
import (
"fmt"
+ "launchpad.net/snappy/i18n"
"launchpad.net/snappy/logger"
"launchpad.net/snappy/snappy"
)
@@ -32,11 +33,11 @@
Output string `long:"output" short:"o" description:"Specify an alternate output directory for the resulting package"`
}
-const longBuildHelp = `Creates a snap package and if available, runs the review scripts.`
+var longBuildHelp = i18n.G("Creates a snap package and if available, runs the review scripts.")
func init() {
cmd, err := parser.AddCommand("build",
- "Builds a snap package",
+ i18n.G("Builds a snap package"),
longBuildHelp,
&cmdBuild{})
if err != nil {
@@ -71,6 +72,7 @@
_ = cmd.Run()
*/
- fmt.Printf("Generated '%s' snap\n", snapPackage)
+ // TRANSLATORS: the %s is a pkgname
+ fmt.Printf(i18n.G("Generated '%s' snap\n"), snapPackage)
return nil
}
diff -Nru ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_config.go ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_config.go
--- ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_config.go 2015-07-01 06:54:24.000000000 +0000
+++ ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_config.go 2015-07-02 19:09:25.000000000 +0000
@@ -25,6 +25,7 @@
"io/ioutil"
"os"
+ "launchpad.net/snappy/i18n"
"launchpad.net/snappy/logger"
"launchpad.net/snappy/snappy"
)
@@ -36,9 +37,9 @@
} `positional-args:"yes"`
}
-const shortConfigHelp = `Set configuration for an installed package.`
+var shortConfigHelp = i18n.G("Set configuration for an installed package.")
-const longConfigHelp = "Configures a package. The configuration is a YAML file, provided in the specified file which can be \"-\" for stdin. Output of the command is the current configuration, so running this command with no input file provides a snapshot of the app's current config."
+var longConfigHelp = i18n.G("Configures a package. The configuration is a YAML file, provided in the specified file which can be \"-\" for stdin. Output of the command is the current configuration, so running this command with no input file provides a snapshot of the app's current config.")
func init() {
_, err := parser.AddCommand("config",
@@ -57,12 +58,13 @@
// FIXME transform this into something that returns the config for
// the full system
if pkgName == "" {
- return errors.New("package name is required")
+ return errors.New(i18n.G("package name is required"))
}
newConfig, err := configurePackage(pkgName, configFile)
if err == snappy.ErrPackageNotFound {
- return fmt.Errorf("No snap: '%s' found", pkgName)
+ // TRANSLATORS: the %s is a pkgname
+ return fmt.Errorf(i18n.G("No snap: '%s' found"), pkgName)
} else if err != nil {
return err
}
diff -Nru ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_first_boot.go ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_first_boot.go
--- ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_first_boot.go 2015-07-01 06:54:24.000000000 +0000
+++ ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_first_boot.go 2015-07-02 19:09:25.000000000 +0000
@@ -22,6 +22,7 @@
import (
"fmt"
+ "launchpad.net/snappy/i18n"
"launchpad.net/snappy/logger"
"launchpad.net/snappy/snappy"
)
@@ -41,7 +42,7 @@
func (x *cmdInternalFirstBootOemConfig) Execute(args []string) error {
err := snappy.OemConfig()
if err == snappy.ErrNotFirstBoot {
- fmt.Println("First boot has already run")
+ fmt.Println(i18n.G("First boot has already run"))
return nil
}
diff -Nru ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_hwassign.go ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_hwassign.go
--- ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_hwassign.go 2015-07-01 06:54:24.000000000 +0000
+++ ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_hwassign.go 2015-07-02 19:09:25.000000000 +0000
@@ -22,6 +22,7 @@
import (
"fmt"
+ "launchpad.net/snappy/i18n"
"launchpad.net/snappy/logger"
"launchpad.net/snappy/snappy"
)
@@ -33,9 +34,9 @@
} `required:"true" positional-args:"yes"`
}
-const shortHWAssignHelp = `Assign a hardware device to a package`
+var shortHWAssignHelp = i18n.G("Assign a hardware device to a package")
-const longHWAssignHelp = `This command adds access to a specific hardware device (e.g. /dev/ttyUSB0) for an installed package.`
+var longHWAssignHelp = i18n.G("This command adds access to a specific hardware device (e.g. /dev/ttyUSB0) for an installed package.")
func init() {
_, err := parser.AddCommand("hw-assign",
@@ -54,13 +55,15 @@
func (x *cmdHWAssign) doHWAssign() error {
if err := snappy.AddHWAccess(x.Positional.PackageName, x.Positional.DevicePath); err != nil {
if err == snappy.ErrHWAccessAlreadyAdded {
- fmt.Printf("'%s' previously allowed access to '%s'. Skipping\n", x.Positional.PackageName, x.Positional.DevicePath)
+ // TRANSLATORS: the first %s is a pkgname, the second %s is a path
+ fmt.Printf(i18n.G("'%s' previously allowed access to '%s'. Skipping\n"), x.Positional.PackageName, x.Positional.DevicePath)
return nil
}
return err
}
- fmt.Printf("'%s' is now allowed to access '%s'\n", x.Positional.PackageName, x.Positional.DevicePath)
+ // TRANSLATORS: the first %s is a pkgname, the second %s is a path
+ fmt.Printf(i18n.G("'%s' is now allowed to access '%s'\n"), x.Positional.PackageName, x.Positional.DevicePath)
return nil
}
diff -Nru ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_hwinfo.go ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_hwinfo.go
--- ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_hwinfo.go 2015-07-01 06:54:24.000000000 +0000
+++ ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_hwinfo.go 2015-07-02 19:09:25.000000000 +0000
@@ -23,6 +23,7 @@
"fmt"
"strings"
+ "launchpad.net/snappy/i18n"
"launchpad.net/snappy/logger"
"launchpad.net/snappy/snappy"
)
@@ -33,9 +34,9 @@
} `positional-args:"yes"`
}
-const shortHWInfoHelp = `List assigned hardware device for a package`
+var shortHWInfoHelp = i18n.G("List assigned hardware device for a package")
-const longHWInfoHelp = `This command list what hardware an installed package can access`
+var longHWInfoHelp = i18n.G("This command list what hardware an installed package can access")
func init() {
_, err := parser.AddCommand("hw-info",
@@ -49,9 +50,11 @@
func outputHWAccessForPkgname(pkgname string, writePaths []string) {
if len(writePaths) == 0 {
- fmt.Printf("'%s:' is not allowed to access additional hardware\n", pkgname)
+ // TRANSLATORS: the %s is a pkgname
+ fmt.Printf(i18n.G("'%s:' is not allowed to access additional hardware\n"), pkgname)
} else {
- fmt.Printf("%s: %s\n", pkgname, strings.Join(writePaths, ", "))
+ // TRANSLATORS: the %s is a pkgname, the second a comma separated list of paths
+ fmt.Printf(i18n.G("%s: %s\n"), pkgname, strings.Join(writePaths, ", "))
}
}
diff -Nru ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_hwunassign.go ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_hwunassign.go
--- ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_hwunassign.go 2015-07-01 06:54:24.000000000 +0000
+++ ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_hwunassign.go 2015-07-02 19:09:25.000000000 +0000
@@ -22,6 +22,7 @@
import (
"fmt"
+ "launchpad.net/snappy/i18n"
"launchpad.net/snappy/logger"
"launchpad.net/snappy/snappy"
)
@@ -33,9 +34,9 @@
} `required:"true" positional-args:"yes"`
}
-const shortHWUnassignHelp = `Unassign a hardware device to a package`
+var shortHWUnassignHelp = i18n.G("Unassign a hardware device to a package")
-const longHWUnassignHelp = `This command removes access of a specific hardware device (e.g. /dev/ttyUSB0) for an installed package.`
+var longHWUnassignHelp = i18n.G("This command removes access of a specific hardware device (e.g. /dev/ttyUSB0) for an installed package.")
func init() {
_, err := parser.AddCommand("hw-unassign",
@@ -56,6 +57,7 @@
return err
}
- fmt.Printf("'%s' is no longer allowed to access '%s'\n", x.Positional.PackageName, x.Positional.DevicePath)
+ // TRANSLATORS: the first %s is a pkgname, the second %s is a path
+ fmt.Printf(i18n.G("'%s' is no longer allowed to access '%s'\n"), x.Positional.PackageName, x.Positional.DevicePath)
return nil
}
diff -Nru ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_info.go ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_info.go
--- ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_info.go 2015-07-01 06:54:24.000000000 +0000
+++ ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_info.go 2015-07-02 19:09:25.000000000 +0000
@@ -23,6 +23,7 @@
"fmt"
"strings"
+ "launchpad.net/snappy/i18n"
"launchpad.net/snappy/logger"
"launchpad.net/snappy/pkg"
"launchpad.net/snappy/snappy"
@@ -35,15 +36,16 @@
} `positional-args:"yes"`
}
-const shortInfoHelp = `Display a summary of key attributes of the snappy system.`
+var shortInfoHelp = i18n.G("Display a summary of key attributes of the snappy system.")
-const longInfoHelp = `A concise summary of key attributes of the snappy system, such as the release and channel.
+// FIXME: gettext does not understand ``
+var longInfoHelp = i18n.G(`A concise summary of key attributes of the snappy system, such as the release and channel.
The verbose output includes the specific version information for the factory image, the running image and the image that will be run on reboot, together with a list of the available channels for this image.
Providing a package name will display information about a specific installed package.
-The verbose version of the info command for a package will also tell you the available channels for that package, when it was installed for the first time, disk space utilization, and in the case of frameworks, which apps are able to use the framework.`
+The verbose version of the info command for a package will also tell you the available channels for that package, when it was installed for the first time, disk space utilization, and in the case of frameworks, which apps are able to use the framework.`)
func init() {
_, err := parser.AddCommand("info",
@@ -69,13 +71,19 @@
return fmt.Errorf("No snap '%s' found", pkgname)
}
- fmt.Printf("channel: %s\n", snap.Channel())
- fmt.Printf("version: %s\n", snap.Version())
- fmt.Printf("updated: %s\n", snap.Date())
+ // TRANSLATORS: the %s is a channel name
+ fmt.Printf(i18n.G("channel: %s\n"), snap.Channel())
+ // TRANSLATORS: the %s is a version string
+ fmt.Printf(i18n.G("version: %s\n"), snap.Version())
+ // TRANSLATORS: the %s is a date
+ fmt.Printf(i18n.G("updated: %s\n"), snap.Date())
if verbose {
- fmt.Printf("installed: %s\n", "n/a")
- fmt.Printf("binary-size: %v\n", snap.InstalledSize())
- fmt.Printf("data-size: %s\n", "n/a")
+ // TRANSLATORS: the %s is a date
+ fmt.Printf(i18n.G("installed: %s\n"), "n/a")
+ // TRANSLATORS: the %s is a size
+ fmt.Printf(i18n.G("binary-size: %v\n"), snap.InstalledSize())
+ // TRANSLATORS: the %s is a size
+ fmt.Printf(i18n.G("data-size: %s\n"), "n/a")
// FIXME: implement backup list per spec
}
@@ -96,10 +104,15 @@
frameworks, _ := snappy.ActiveSnapNamesByType(pkg.TypeFramework)
apps, _ := snappy.ActiveSnapNamesByType(pkg.TypeApp)
- fmt.Printf("release: %s\n", release)
- fmt.Printf("architecture: %s\n", snappy.Architecture())
- fmt.Printf("frameworks: %s\n", strings.Join(frameworks, ", "))
- fmt.Printf("apps: %s\n", strings.Join(apps, ", "))
+ // TRANSLATORS: the %s release string
+ fmt.Printf(i18n.G("release: %s\n"), release)
+ // TRANSLATORS: the %s an architecture string
+ fmt.Printf(i18n.G("architecture: %s\n"), snappy.Architecture())
+ // TRANSLATORS: the %s is a comma separated list of framework names
+ fmt.Printf(i18n.G("frameworks: %s\n"), strings.Join(frameworks, ", "))
+ //TRANSLATORS: the %s represents a list of installed appnames
+ // (e.g. "apps: foo, bar, baz")
+ fmt.Printf(i18n.G("apps: %s\n"), strings.Join(apps, ", "))
return nil
}
diff -Nru ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_install.go ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_install.go
--- ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_install.go 2015-07-01 06:54:24.000000000 +0000
+++ ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_install.go 2015-07-02 19:09:25.000000000 +0000
@@ -59,7 +59,7 @@
// FIXME patch goflags to allow for specific n required positional arguments
if pkgName == "" {
- return errors.New("package name is required")
+ return errors.New(i18n.G("package name is required"))
}
flags := snappy.DoInstallGC
@@ -69,8 +69,8 @@
if x.AllowUnauthenticated {
flags |= snappy.AllowUnauthenticated
}
-
- fmt.Printf("Installing %s\n", pkgName)
+ // TRANSLATORS: the %s is a pkgname
+ fmt.Printf(i18n.G("Installing %s\n"), pkgName)
realPkgName, err := snappy.Install(pkgName, flags, progress.MakeProgressBar())
if err != nil {
diff -Nru ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_internal_unpack.go ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_internal_unpack.go
--- ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_internal_unpack.go 2015-07-01 06:54:24.000000000 +0000
+++ ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_internal_unpack.go 2015-07-02 19:09:25.000000000 +0000
@@ -49,9 +49,11 @@
// }
import "C"
-// for compat with the old snappy, once that is gone we can drop to a
-// different user
-const dropPrivsUser = "snappypkg"
+// we keep supporting clickpkg for compat with older images
+var dropPrivsUsers = []string{
+ "snappypkg",
+ "clickpkg",
+}
type cmdInternalUnpack struct {
Positional struct {
@@ -123,8 +125,18 @@
defer d.Close()
if helpers.ShouldDropPrivs() {
+ var dropPrivsUser string
+ // first find out what user to use
passFile := passwdFile(rootDir, "passwd")
+ for _, dropPrivsUser = range dropPrivsUsers {
+ _, err := readUID(dropPrivsUser, passFile)
+ if err == nil {
+ break
+ }
+ }
+
+ // then get uid/gid
uid, err := readUID(dropPrivsUser, passFile)
if err != nil {
return err
diff -Nru ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_internal_unpack_test.go ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_internal_unpack_test.go
--- ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_internal_unpack_test.go 1970-01-01 00:00:00.000000000 +0000
+++ ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_internal_unpack_test.go 2015-07-02 19:09:25.000000000 +0000
@@ -0,0 +1,91 @@
+// -*- Mode: Go; indent-tabs-mode: t -*-
+
+/*
+ * Copyright (C) 2014-2015 Canonical Ltd
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+package main
+
+import (
+ "os"
+ "path/filepath"
+
+ . "gopkg.in/check.v1"
+)
+
+func makeTempFile(c *C, content string) *os.File {
+ tempdir := c.MkDir()
+ f, err := os.Create(filepath.Join(tempdir, "foo"))
+ c.Assert(err, IsNil)
+ f.Write([]byte(content))
+ f.Sync()
+
+ return f
+}
+
+func (s *CmdTestSuite) TestUidReaderPasswd(c *C) {
+ f := makeTempFile(c, `root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
+snappypkg:x:101:104::/nonexistent:/bin/false
+`)
+
+ uid, err := readUID("snappypkg", f.Name())
+ c.Assert(err, IsNil)
+ c.Assert(uid, Equals, 101)
+}
+
+func (s *CmdTestSuite) TestUidReaderGroups(c *C) {
+ f := makeTempFile(c, `root:x:0:
+daemon:x:1:
+snappypkg:x:104:
+`)
+
+ gid, err := readUID("snappypkg", f.Name())
+ c.Assert(err, IsNil)
+ c.Assert(gid, Equals, 104)
+}
+
+func (s *CmdTestSuite) TestUidReaderSamePrefix(c *C) {
+ f := makeTempFile(c, `root:x:0:0:root:/root:/bin/bash
+daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
+snappypkg2:x:101:104::/nonexistent:/bin/false
+snappypkg:x:102:105::/nonexistent:/bin/false
+`)
+ defer os.Remove(f.Name())
+
+ uid, err := readUID("snappypkg", f.Name())
+ c.Assert(err, IsNil)
+ c.Assert(uid, Equals, 102)
+}
+
+func (s *CmdTestSuite) TestUidReaderInvalidPasswd(c *C) {
+ f := makeTempFile(c, `root:
+daemon:
+snappypkg:x:
+`)
+
+ _, err := readUID("snappypkg", f.Name())
+ c.Assert(err, NotNil)
+}
+
+func (s *CmdTestSuite) TestUidReaderInvalidPasswd2(c *C) {
+ f := makeTempFile(c, `root:
+daemon:
+`)
+
+ _, err := readUID("snappypkg", f.Name())
+ c.Assert(err, NotNil)
+}
diff -Nru ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_list.go ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_list.go
--- ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_list.go 2015-07-01 06:54:24.000000000 +0000
+++ ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_list.go 2015-07-02 19:09:25.000000000 +0000
@@ -26,6 +26,7 @@
"text/tabwriter"
"time"
+ "launchpad.net/snappy/i18n"
"launchpad.net/snappy/logger"
"launchpad.net/snappy/pkg"
"launchpad.net/snappy/snappy"
@@ -36,15 +37,15 @@
Verbose bool `short:"v" long:"verbose" description:"Show channel information and expand all fields"`
}
-const shortListHelp = `List active components installed on a snappy system`
+var shortListHelp = i18n.G("List active components installed on a snappy system")
-const longListHelp = `Provides a list of all active components installed on a snappy system.
+var longListHelp = i18n.G(`Provides a list of all active components installed on a snappy system.
If requested, the command will find out if there are updates for any of the components and indicate that by appending a * to the date. This will be slower as it requires a round trip to the app store on the network.
The developer information refers to non-mainline versions of a package (much like PPAs in deb-based Ubuntu). If the package is the primary version of that package in Ubuntu then the developer info is not shown. This allows one to identify packages which have custom, non-standard versions installed. As a special case, the “sideload” developer refers to packages installed manually on the system.
-When a verbose listing is requested, information about the channel used is displayed; which is one of alpha, beta, rc or stable, and all fields are fully expanded too. In some cases, older (inactive) versions of snappy packages will be installed, these will be shown in the verbose output and the active version indicated with a * appended to the name of the component.`
+When a verbose listing is requested, information about the channel used is displayed; which is one of alpha, beta, rc or stable, and all fields are fully expanded too. In some cases, older (inactive) versions of snappy packages will be installed, these will be shown in the verbose output and the active version indicated with a * appended to the name of the component.`)
func init() {
cmd, err := parser.AddCommand("list",
@@ -104,7 +105,7 @@
func showVerboseList(installed []snappy.Part, o io.Writer) {
w := tabwriter.NewWriter(o, 5, 3, 1, ' ', 0)
- fmt.Fprintln(w, "Name\tDate\tVersion\tDeveloper\t")
+ fmt.Fprintln(w, i18n.G("Name\tDate\tVersion\tDeveloper\t"))
for _, part := range installed {
active := ""
if part.IsActive() {
@@ -155,9 +156,11 @@
if needsReboot {
if snappy.VersionCompare(otherVersion, currentVersion) > 0 {
- fmt.Fprintln(o, fmt.Sprintf("Reboot to use the new %s.", otherName))
+ // TRANSLATORS: the %s is a pkgname
+ fmt.Fprintln(o, fmt.Sprintf(i18n.G("Reboot to use the new %s."), otherName))
} else {
- fmt.Fprintln(o, fmt.Sprintf("Reboot to use %s version %s.", otherName, otherVersion))
+ // TRANSLATORS: the first %s is a pkgname the second a version
+ fmt.Fprintln(o, fmt.Sprintf(i18n.G("Reboot to use %s version %s."), otherName, otherVersion))
}
}
}
@@ -167,7 +170,7 @@
w := tabwriter.NewWriter(o, 5, 3, 1, ' ', 0)
defer w.Flush()
- fmt.Fprintln(w, "Name\tDate\tVersion\t")
+ fmt.Fprintln(w, i18n.G("Name\tDate\tVersion\t"))
for _, part := range installed {
if !part.IsActive() {
continue
diff -Nru ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_login.go ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_login.go
--- ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_login.go 2015-07-01 06:54:24.000000000 +0000
+++ ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_login.go 2015-07-02 19:09:25.000000000 +0000
@@ -26,6 +26,7 @@
"golang.org/x/crypto/ssh/terminal"
+ "launchpad.net/snappy/i18n"
"launchpad.net/snappy/logger"
"launchpad.net/snappy/snappy"
)
@@ -36,9 +37,9 @@
} `positional-args:"yes" required:"yes"`
}
-const shortLoginHelp = `Log into the store`
+var shortLoginHelp = i18n.G("Log into the store")
-const longLoginHelp = `This command logs the given username into the store`
+var longLoginHelp = i18n.G("This command logs the given username into the store")
func init() {
_, err := parser.AddCommand("login",
@@ -56,7 +57,7 @@
// check if we need 2fa
if err == snappy.ErrAuthenticationNeeds2fa {
- fmt.Print("2fa code: ")
+ fmt.Print(i18n.G("2fa code: "))
reader := bufio.NewReader(os.Stdin)
// the browser shows it as well (and Sergio wants to see it ;)
otp, _, err := reader.ReadLine()
@@ -73,7 +74,7 @@
const tokenName = "snappy login token"
username := x.Positional.UserName
- fmt.Print("Password: ")
+ fmt.Print(i18n.G("Password: "))
password, err := terminal.ReadPassword(0)
fmt.Print("\n")
if err != nil {
@@ -84,7 +85,7 @@
if err != nil {
return err
}
- fmt.Println("Login successful")
+ fmt.Println(i18n.G("Login successful"))
return snappy.WriteStoreToken(*token)
}
diff -Nru ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_low_level_unpack_test.go ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_low_level_unpack_test.go
--- ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_low_level_unpack_test.go 2015-07-01 06:54:24.000000000 +0000
+++ ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_low_level_unpack_test.go 1970-01-01 00:00:00.000000000 +0000
@@ -1,91 +0,0 @@
-// -*- Mode: Go; indent-tabs-mode: t -*-
-
-/*
- * Copyright (C) 2014-2015 Canonical Ltd
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 3 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- */
-
-package main
-
-import (
- "os"
- "path/filepath"
-
- . "gopkg.in/check.v1"
-)
-
-func makeTempFile(c *C, content string) *os.File {
- tempdir := c.MkDir()
- f, err := os.Create(filepath.Join(tempdir, "foo"))
- c.Assert(err, IsNil)
- f.Write([]byte(content))
- f.Sync()
-
- return f
-}
-
-func (s *CmdTestSuite) TestUidReaderPasswd(c *C) {
- f := makeTempFile(c, `root:x:0:0:root:/root:/bin/bash
-daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
-snappypkg:x:101:104::/nonexistent:/bin/false
-`)
-
- uid, err := readUID("snappypkg", f.Name())
- c.Assert(err, IsNil)
- c.Assert(uid, Equals, 101)
-}
-
-func (s *CmdTestSuite) TestUidReaderGroups(c *C) {
- f := makeTempFile(c, `root:x:0:
-daemon:x:1:
-snappypkg:x:104:
-`)
-
- gid, err := readUID("snappypkg", f.Name())
- c.Assert(err, IsNil)
- c.Assert(gid, Equals, 104)
-}
-
-func (s *CmdTestSuite) TestUidReaderSamePrefix(c *C) {
- f := makeTempFile(c, `root:x:0:0:root:/root:/bin/bash
-daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
-snappypkg2:x:101:104::/nonexistent:/bin/false
-snappypkg:x:102:105::/nonexistent:/bin/false
-`)
- defer os.Remove(f.Name())
-
- uid, err := readUID("snappypkg", f.Name())
- c.Assert(err, IsNil)
- c.Assert(uid, Equals, 102)
-}
-
-func (s *CmdTestSuite) TestUidReaderInvalidPasswd(c *C) {
- f := makeTempFile(c, `root:
-daemon:
-snappypkg:x:
-`)
-
- _, err := readUID("snappypkg", f.Name())
- c.Assert(err, NotNil)
-}
-
-func (s *CmdTestSuite) TestUidReaderInvalidPasswd2(c *C) {
- f := makeTempFile(c, `root:
-daemon:
-`)
-
- _, err := readUID("snappypkg", f.Name())
- c.Assert(err, NotNil)
-}
diff -Nru ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_purge.go ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_purge.go
--- ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_purge.go 2015-07-01 06:54:24.000000000 +0000
+++ ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_purge.go 2015-07-02 19:09:25.000000000 +0000
@@ -22,6 +22,7 @@
import (
"fmt"
+ "launchpad.net/snappy/i18n"
"launchpad.net/snappy/logger"
"launchpad.net/snappy/progress"
"launchpad.net/snappy/snappy"
@@ -31,9 +32,9 @@
Installed bool `long:"installed" description:"Purge an installed package."`
}
-const (
- shortPurgeHelp = `Remove all the data from the listed packages`
- longPurgeHelp = `Remove all the data from the listed packages. Normally this is used for packages that have been removed and attempting to purge data for an installed package will result in an error. The --installed option overrides that and enables the administrator to purge all data for an installed package (effectively resetting the package completely).`
+var (
+ shortPurgeHelp = i18n.G("Remove all the data from the listed packages")
+ longPurgeHelp = i18n.G(`Remove all the data from the listed packages. Normally this is used for packages that have been removed and attempting to purge data for an installed package will result in an error. The --installed option overrides that and enables the administrator to purge all data for an installed package (effectively resetting the package completely).`)
)
func init() {
@@ -59,7 +60,8 @@
}
for _, part := range args {
- fmt.Printf("Purging %s\n", part)
+ // TRANSLATORS: the %s is a pkgname
+ fmt.Printf(i18n.G("Purging %s\n"), part)
if err := snappy.Purge(part, flags, progress.MakeProgressBar()); err != nil {
return err
diff -Nru ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_remove.go ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_remove.go
--- ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_remove.go 2015-07-01 06:54:24.000000000 +0000
+++ ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_remove.go 2015-07-02 19:09:25.000000000 +0000
@@ -22,6 +22,7 @@
import (
"fmt"
+ "launchpad.net/snappy/i18n"
"launchpad.net/snappy/logger"
"launchpad.net/snappy/progress"
"launchpad.net/snappy/snappy"
@@ -33,8 +34,8 @@
func init() {
_, err := parser.AddCommand("remove",
- "Remove a snapp part",
- "Remove a snapp part",
+ i18n.G("Remove a snapp part"),
+ i18n.G("Remove a snapp part"),
&cmdRemove{})
if err != nil {
logger.Panicf("Unable to remove: %v", err)
@@ -54,7 +55,8 @@
}
for _, part := range args {
- fmt.Printf("Removing %s\n", part)
+ // TRANSLATORS: the %s is a pkgname
+ fmt.Printf(i18n.G("Removing %s\n"), part)
if err := snappy.Remove(part, flags, progress.MakeProgressBar()); err != nil {
return err
diff -Nru ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_rollback.go ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_rollback.go
--- ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_rollback.go 2015-07-01 06:54:24.000000000 +0000
+++ ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_rollback.go 2015-07-02 19:09:25.000000000 +0000
@@ -23,6 +23,7 @@
"fmt"
"os"
+ "launchpad.net/snappy/i18n"
"launchpad.net/snappy/logger"
"launchpad.net/snappy/progress"
"launchpad.net/snappy/snappy"
@@ -35,10 +36,9 @@
} `positional-args:"yes"`
}
-const shortRollbackHelp = "Rollback to a previous version of a package"
+var shortRollbackHelp = i18n.G("Rollback to a previous version of a package")
-const longRollbackHelp = `Allows rollback of a snap to a previous installed version. Without any arguments, the previous installed version is selected. It is also possible to specify the version to rollback to as a additional argument.
-`
+var longRollbackHelp = i18n.G("Allows rollback of a snap to a previous installed version. Without any arguments, the previous installed version is selected. It is also possible to specify the version to rollback to as a additional argument.\n")
func init() {
_, err := parser.AddCommand("rollback",
@@ -65,7 +65,8 @@
if err != nil {
return err
}
- fmt.Printf("Setting %s to version %s\n", pkg, nowVersion)
+ // TRANSLATORS: the first %s is a pkgname, the second %s is the new version
+ fmt.Printf(i18n.G("Setting %s to version %s\n"), pkg, nowVersion)
m := snappy.NewMetaRepository()
installed, err := m.Installed()
diff -Nru ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_search.go ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_search.go
--- ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_search.go 2015-07-01 06:54:24.000000000 +0000
+++ ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_search.go 2015-07-02 19:09:25.000000000 +0000
@@ -24,6 +24,7 @@
"os"
"text/tabwriter"
+ "launchpad.net/snappy/i18n"
"launchpad.net/snappy/logger"
"launchpad.net/snappy/pkg"
"launchpad.net/snappy/snappy"
@@ -35,8 +36,8 @@
func init() {
cmd, err := parser.AddCommand("search",
- "Search for packages to install",
- "Query the store for available packages",
+ i18n.G("Search for packages to install"),
+ i18n.G("Query the store for available packages"),
&cmdSearch{})
if err != nil {
logger.Panicf("Unable to search: %v", err)
@@ -59,12 +60,13 @@
defer w.Flush()
forkHelp := false
- fmt.Fprintln(w, "Name\tVersion\tSummary\t")
+ fmt.Fprintln(w, i18n.G("Name\tVersion\tSummary\t"))
for _, sharedName := range results {
if part := sharedName.Alias; !allVariants && part != nil {
if len(sharedName.Parts) > 1 {
n := len(sharedName.Parts) - 1
- fmt.Fprintln(w, fmt.Sprintf("%s\t%s\t%s (forks not shown: %d)\t", part.Name(), part.Version(), part.Description(), n))
+ // TRANSLATORS: the %s stand for "name", "version", "description"
+ fmt.Fprintln(w, fmt.Sprintf(i18n.G("%s\t%s\t%s (forks not shown: %d)\t"), part.Name(), part.Version(), part.Description(), n))
forkHelp = true
} else {
fmt.Fprintln(w, fmt.Sprintf("%s\t%s\t%s\t", part.Name(), part.Version(), part.Description()))
@@ -81,7 +83,7 @@
}
if forkHelp {
- fmt.Fprintln(w, "Use --show-all to see all available forks.")
+ fmt.Fprintln(w, i18n.G("Use --show-all to see all available forks."))
}
return nil
diff -Nru ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_set.go ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_set.go
--- ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_set.go 2015-07-01 06:54:24.000000000 +0000
+++ ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_set.go 2015-07-02 19:09:25.000000000 +0000
@@ -23,6 +23,7 @@
"fmt"
"strings"
+ "launchpad.net/snappy/i18n"
"launchpad.net/snappy/logger"
"launchpad.net/snappy/progress"
"launchpad.net/snappy/snappy"
@@ -32,18 +33,18 @@
args []string
}
-const setHelp = `Set properties of system or package
+var setHelp = i18n.G(`Set properties of system or package
Supported properties are:
active=VERSION
Example:
set hello-world active=1.0
-`
+`)
func init() {
_, err := parser.AddCommand("set",
- "Set properties of system or package",
+ i18n.G("Set properties of system or package"),
setHelp,
&cmdSet{})
if err != nil {
diff -Nru ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_update.go ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_update.go
--- ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_update.go 2015-07-01 06:54:24.000000000 +0000
+++ ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_update.go 2015-07-02 19:09:25.000000000 +0000
@@ -25,6 +25,7 @@
"os/exec"
"strings"
+ "launchpad.net/snappy/i18n"
"launchpad.net/snappy/logger"
"launchpad.net/snappy/progress"
"launchpad.net/snappy/snappy"
@@ -37,8 +38,8 @@
func init() {
_, err := parser.AddCommand("update",
- "Update all installed parts",
- "Ensures system is running with latest parts",
+ i18n.G("Update all installed parts"),
+ i18n.G("Ensures system is running with latest parts"),
&cmdUpdate{})
if err != nil {
logger.Panicf("Unable to update: %v", err)
@@ -48,10 +49,10 @@
const (
shutdownCmd = "/sbin/shutdown"
shutdownTimeout = "+10"
- shutdownMsg = "snappy autopilot triggered a reboot to boot into an up to date system" +
- "-- temprorarily disable the reboot by running 'sudo shutdown -c'"
)
+var shutdownMsg = i18n.G("snappy autopilot triggered a reboot to boot into an up to date system -- temprorarily disable the reboot by running 'sudo shutdown -c'")
+
func (x *cmdUpdate) Execute(args []string) (err error) {
return withMutex(x.doUpdate)
}
@@ -86,7 +87,9 @@
}
if len(rebootTriggers) != 0 {
- fmt.Println("Rebooting to satisfy updates for", strings.Join(rebootTriggers, ", "))
+ // TRANSLATORS: the %s shows a comma separated list
+ // of package names
+ fmt.Printf(i18n.G("Rebooting to satisfy updates for %s\n"), strings.Join(rebootTriggers, ", "))
cmd := exec.Command(shutdownCmd, shutdownTimeout, "-r", shutdownMsg)
if out, err := cmd.CombinedOutput(); err != nil {
return fmt.Errorf("failed to auto reboot: %s", out)
diff -Nru ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_versions.go ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_versions.go
--- ubuntu-snappy-1.3ubuntu1/cmd/snappy/cmd_versions.go 2015-07-01 06:54:24.000000000 +0000
+++ ubuntu-snappy-1.4ubuntu1/cmd/snappy/cmd_versions.go 2015-07-02 19:09:25.000000000 +0000
@@ -22,15 +22,16 @@
import (
"fmt"
+ "launchpad.net/snappy/i18n"
"launchpad.net/snappy/logger"
)
type cmdVersions struct {
}
-const shortVersionsHelp = `(deprecated) please use "list"`
+var shortVersionsHelp = i18n.G("(deprecated) please use \"list\"")
-const longVersionsHelp = `This command is no longer available, please use the "list" command`
+var longVersionsHelp = i18n.G("This command is no longer available, please use the \"list\" command")
func init() {
_, err := parser.AddCommand("versions",
@@ -43,12 +44,12 @@
}
func (x *cmdVersions) Execute(args []string) error {
- fmt.Println(`The "versions" command is no longer available.
+ fmt.Println(i18n.G(`The "versions" command is no longer available.
Please use the "list" command instead to see what is installed.
The "list -u" (or "list --updates") will show you the available updates
and "list -v" (or "list --verbose") will show all installed versions.
-`)
+`))
return nil
}
diff -Nru ubuntu-snappy-1.3ubuntu1/debian/changelog ubuntu-snappy-1.4ubuntu1/debian/changelog
--- ubuntu-snappy-1.3ubuntu1/debian/changelog 2015-07-01 08:37:05.000000000 +0000
+++ ubuntu-snappy-1.4ubuntu1/debian/changelog 2015-07-02 19:23:17.000000000 +0000
@@ -1,3 +1,15 @@
+ubuntu-snappy (1.4ubuntu1) wily; urgency=medium
+
+ * New upstream release, including the following changes:
+ - Allow to run the integration tests using snappy from branch
+ - Add CopyFileOverwrite flag and behaviour to helpers.CopyFile
+ - add a bunch of missing i18n.G() now that we have gettext
+ - Generate only the translators comments that start with
+ TRANSLATORS
+ - Try both clickpkg and snappypkg when dropping privs
+
+ -- Ricardo Salveti de Araujo Thu, 02 Jul 2015 16:21:53 -0300
+
ubuntu-snappy (1.3ubuntu1) wily; urgency=medium
* New upstream release, including the following changes:
diff -Nru ubuntu-snappy-1.3ubuntu1/helpers/cp.go ubuntu-snappy-1.4ubuntu1/helpers/cp.go
--- ubuntu-snappy-1.3ubuntu1/helpers/cp.go 2015-07-01 06:54:24.000000000 +0000
+++ ubuntu-snappy-1.4ubuntu1/helpers/cp.go 2015-07-02 19:09:25.000000000 +0000
@@ -33,6 +33,8 @@
CopyFlagDefault CopyFlag = 0
// CopyFlagSync does a sync after copying the files
CopyFlagSync CopyFlag = 1 << iota
+ // CopyFlagOverwrite overwrites the target if it exists
+ CopyFlagOverwrite
)
var (
@@ -70,7 +72,12 @@
return fmt.Errorf("unable to stat %s: %v", src, err)
}
- fout, err := openfile(dst, os.O_WRONLY|os.O_CREATE|os.O_EXCL, fi.Mode())
+ outflags := os.O_WRONLY | os.O_CREATE
+ if flags&CopyFlagOverwrite == 0 {
+ outflags |= os.O_EXCL
+ }
+
+ fout, err := openfile(dst, outflags, fi.Mode())
if err != nil {
return fmt.Errorf("unable to create %s: %v", dst, err)
}
diff -Nru ubuntu-snappy-1.3ubuntu1/helpers/cp_test.go ubuntu-snappy-1.4ubuntu1/helpers/cp_test.go
--- ubuntu-snappy-1.3ubuntu1/helpers/cp_test.go 2015-07-01 06:54:24.000000000 +0000
+++ ubuntu-snappy-1.4ubuntu1/helpers/cp_test.go 2015-07-02 19:09:25.000000000 +0000
@@ -90,6 +90,21 @@
c.Check(bs, DeepEquals, s.data)
}
+func (s *cpSuite) TestCpNoOverwrite(c *C) {
+ _, err := os.Create(s.f2)
+ c.Assert(err, IsNil)
+ c.Check(CopyFile(s.f1, s.f2, CopyFlagDefault), NotNil)
+}
+
+func (s *cpSuite) TestCpOverwrite(c *C) {
+ _, err := os.Create(s.f2)
+ c.Assert(err, IsNil)
+ c.Check(CopyFile(s.f1, s.f2, CopyFlagOverwrite), IsNil)
+ bs, err := ioutil.ReadFile(s.f2)
+ c.Check(err, IsNil)
+ c.Check(bs, DeepEquals, s.data)
+}
+
func (s *cpSuite) TestCpSync(c *C) {
s.mock()
c.Check(CopyFile(s.f1, s.f2, CopyFlagDefault), IsNil)
diff -Nru ubuntu-snappy-1.3ubuntu1/_integration-tests/main.go ubuntu-snappy-1.4ubuntu1/_integration-tests/main.go
--- ubuntu-snappy-1.3ubuntu1/_integration-tests/main.go 2015-07-01 06:54:24.000000000 +0000
+++ ubuntu-snappy-1.4ubuntu1/_integration-tests/main.go 2015-07-02 19:09:25.000000000 +0000
@@ -32,6 +32,7 @@
const (
baseDir = "/tmp/snappy-test"
+ testsBinDir = "_integration-tests/bin/"
defaultRelease = "rolling"
defaultChannel = "edge"
latestRevision = ""
@@ -44,9 +45,7 @@
)
var (
- testsDir = filepath.Join(baseDir, "tests")
imageDir = filepath.Join(baseDir, "image")
- outputDir = filepath.Join(baseDir, "output")
imageTarget = filepath.Join(imageDir, "snappy.img")
commonSSHOptions = []string{"---", "ssh"}
kvmSSHOptions = append(
@@ -56,7 +55,14 @@
"--", "-i", imageTarget}...)
)
-func setupAndRunTests(arch, testbedIP string, testbedPort int) {
+func setupAndRunTests(useSnappyFromBranch bool, arch, testbedIP string, testbedPort int) {
+ prepareTargetDir(testsBinDir)
+
+ if useSnappyFromBranch {
+ // FIXME We need to build an image that has the snappy from the branch
+ // installed. --elopio - 2015-06-25.
+ buildSnappyCLI(arch)
+ }
buildTests(arch)
rootPath := getRootPath()
@@ -88,9 +94,27 @@
}
}
+func buildSnappyCLI(arch string) {
+ fmt.Println("Building snappy CLI...")
+ // On the root of the project we have a directory called snappy, so we
+ // output the binary for the tests in the tests directory.
+ goCall(arch, "build", "-o", testsBinDir+"snappy", "./cmd/snappy")
+}
+
func buildTests(arch string) {
- fmt.Println("Building tests")
- prepareTargetDir(testsDir)
+ fmt.Println("Building tests...")
+ tests := []string{"latest", "failover", "update"}
+ for i := range tests {
+ testName := tests[i]
+ goCall(arch, "test", "-c",
+ "./_integration-tests/tests/"+testName)
+ // XXX Go test 1.3 does not have the output flag, so we move the
+ // binaries after they are generated.
+ os.Rename(testName+".test", testsBinDir+testName+".test")
+ }
+}
+
+func goCall(arch string, cmds ...string) {
if arch != "" {
defer os.Setenv("GOARCH", os.Getenv("GOARCH"))
os.Setenv("GOARCH", arch)
@@ -99,12 +123,8 @@
os.Setenv("GOARM", defaultGoArm)
}
}
- tests := []string{"latest", "failover", "update"}
- for i := range tests {
- testName := tests[i]
- execCommand("go", "test", "-c",
- "./_integration-tests/tests/"+testName)
- }
+ goCmd := append([]string{"go"}, cmds...)
+ execCommand(goCmd...)
}
func createImage(release, channel, revision string) {
@@ -125,6 +145,7 @@
func adtRun(rootPath string, testbedOptions []string, testname string) {
fmt.Println("Calling adt-run...")
+ outputDir := filepath.Join(baseDir, "output")
prepareTargetDir(outputDir)
cmd := []string{
@@ -170,15 +191,17 @@
func main() {
var (
+ useSnappyFromBranch = flag.Bool("snappy-from-branch", false,
+ "If this flag is used, snappy will be compiled from this branch, copied to the testbed and used for the tests. Otherwise, the snappy installed with the image will be used.")
arch = flag.String("arch", "",
"Architecture of the test bed. Defaults to use the same architecture as the host.")
testbedIP = flag.String("ip", "",
"IP of the testbed. If no IP is passed, a virtual machine will be created for the test.")
testbedPort = flag.Int("port", defaultSSHPort,
- "SSH port of the testbed. Defaults to use port 22.")
+ "SSH port of the testbed. Defaults to use port "+strconv.Itoa(defaultSSHPort))
)
flag.Parse()
- setupAndRunTests(*arch, *testbedIP, *testbedPort)
+ setupAndRunTests(*useSnappyFromBranch, *arch, *testbedIP, *testbedPort)
}
diff -Nru ubuntu-snappy-1.3ubuntu1/po/es.po ubuntu-snappy-1.4ubuntu1/po/es.po
--- ubuntu-snappy-1.3ubuntu1/po/es.po 1970-01-01 00:00:00.000000000 +0000
+++ ubuntu-snappy-1.4ubuntu1/po/es.po 2015-07-02 19:09:25.000000000 +0000
@@ -0,0 +1,25 @@
+# Spanish translation for snappy
+# Copyright (c) 2015 Rosetta Contributors and Canonical Ltd 2015
+# This file is distributed under the same license as the snappy package.
+# FIRST AUTHOR , 2015.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: snappy\n"
+"Report-Msgid-Bugs-To: FULL NAME \n"
+"POT-Creation-Date: 2015-06-18 09:43+0200\n"
+"PO-Revision-Date: 2015-07-01 19:54+0000\n"
+"Last-Translator: Leo Arias \n"
+"Language-Team: Spanish \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Launchpad-Export-Date: 2015-07-02 05:42+0000\n"
+"X-Generator: Launchpad (build 17590)\n"
+
+#. TRANSLATORS: the first %q is the file that can not be read and %v is the error message
+msgid "Can't read hook file %q: %v"
+msgstr ""
+
+msgid "Install a snap package"
+msgstr "Instalar un paquete snap"
diff -Nru ubuntu-snappy-1.3ubuntu1/po/snappy.pot ubuntu-snappy-1.4ubuntu1/po/snappy.pot
--- ubuntu-snappy-1.3ubuntu1/po/snappy.pot 2015-07-01 06:54:24.000000000 +0000
+++ ubuntu-snappy-1.4ubuntu1/po/snappy.pot 2015-07-02 19:09:25.000000000 +0000
@@ -7,7 +7,7 @@
msgid ""
msgstr "Project-Id-Version: snappy\n"
"Report-Msgid-Bugs-To: snappy-devel@lists.ubuntu.com\n"
- "POT-Creation-Date: 2015-06-18 09:43+0200\n"
+ "POT-Creation-Date: 2015-07-02 11:15-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -16,9 +16,253 @@
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
+#. TRANSLATORS: the %s stand for "name", "version", "description"
+#, c-format
+msgid "%s\t%s\t%s (forks not shown: %d)\t"
+msgstr ""
+
+#. TRANSLATORS: the %s is a pkgname, the second a comma separated list of paths
+#, c-format
+msgid "%s: %s\n"
+msgstr ""
+
+#. TRANSLATORS: the first %s is a pkgname, the second %s is a path
+#, c-format
+msgid "'%s' is no longer allowed to access '%s'\n"
+msgstr ""
+
+#. TRANSLATORS: the first %s is a pkgname, the second %s is a path
+#, c-format
+msgid "'%s' is now allowed to access '%s'\n"
+msgstr ""
+
+#. TRANSLATORS: the first %s is a pkgname, the second %s is a path
+#, c-format
+msgid "'%s' previously allowed access to '%s'. Skipping\n"
+msgstr ""
+
+#. TRANSLATORS: the %s is a pkgname
+#, c-format
+msgid "'%s:' is not allowed to access additional hardware\n"
+msgstr ""
+
+msgid "(deprecated) please use \"list\""
+msgstr ""
+
+msgid "2fa code: "
+msgstr ""
+
+msgid "Allows rollback of a snap to a previous installed version. Without "
+ "any arguments, the previous installed version is selected. It is "
+ "also possible to specify the version to rollback to as a additional "
+ "argument.\n"
+msgstr ""
+
+msgid "Assign a hardware device to a package"
+msgstr ""
+
+msgid "Builds a snap package"
+msgstr ""
+
#. TRANSLATORS: the first %q is the file that can not be read and %v is the error message
msgid "Can't read hook file %q: %v"
msgstr ""
+msgid "Configures a package. The configuration is a YAML file, provided in "
+ "the specified file which can be \"-\" for stdin. Output of the "
+ "command is the current configuration, so running this command with "
+ "no input file provides a snapshot of the app's current config."
+msgstr ""
+
+msgid "Creates a snap package and if available, runs the review scripts."
+msgstr ""
+
+msgid "Display a summary of key attributes of the snappy system."
+msgstr ""
+
+msgid "Ensures system is running with latest parts"
+msgstr ""
+
+msgid "First boot has already run"
+msgstr ""
+
+#. TRANSLATORS: the %s is a pkgname
+#, c-format
+msgid "Generated '%s' snap\n"
+msgstr ""
+
msgid "Install a snap package"
msgstr ""
+
+#. TRANSLATORS: the %s is a pkgname
+#, c-format
+msgid "Installing %s\n"
+msgstr ""
+
+msgid "List active components installed on a snappy system"
+msgstr ""
+
+msgid "List assigned hardware device for a package"
+msgstr ""
+
+msgid "Log into the store"
+msgstr ""
+
+msgid "Login successful"
+msgstr ""
+
+msgid "Name\tDate\tVersion\t"
+msgstr ""
+
+msgid "Name\tDate\tVersion\tDeveloper\t"
+msgstr ""
+
+msgid "Name\tVersion\tSummary\t"
+msgstr ""
+
+#. TRANSLATORS: the %s is a pkgname
+#, c-format
+msgid "No snap: '%s' found"
+msgstr ""
+
+msgid "Password: "
+msgstr ""
+
+#. TRANSLATORS: the %s is a pkgname
+#, c-format
+msgid "Purging %s\n"
+msgstr ""
+
+msgid "Query the store for available packages"
+msgstr ""
+
+#. TRANSLATORS: the first %s is a pkgname the second a version
+#, c-format
+msgid "Reboot to use %s version %s."
+msgstr ""
+
+#. TRANSLATORS: the %s is a pkgname
+#, c-format
+msgid "Reboot to use the new %s."
+msgstr ""
+
+#. TRANSLATORS: the %s shows a comma separated list
+#. of package names
+#, c-format
+msgid "Rebooting to satisfy updates for %s\n"
+msgstr ""
+
+msgid "Remove a snapp part"
+msgstr ""
+
+msgid "Remove all the data from the listed packages"
+msgstr ""
+
+#. TRANSLATORS: the %s is a pkgname
+#, c-format
+msgid "Removing %s\n"
+msgstr ""
+
+msgid "Rollback to a previous version of a package"
+msgstr ""
+
+msgid "Search for packages to install"
+msgstr ""
+
+msgid "Set configuration for an installed package."
+msgstr ""
+
+msgid "Set properties of system or package"
+msgstr ""
+
+#. TRANSLATORS: the first %s is a pkgname, the second %s is the new version
+#, c-format
+msgid "Setting %s to version %s\n"
+msgstr ""
+
+msgid "This command adds access to a specific hardware device (e.g. /dev/"
+ "ttyUSB0) for an installed package."
+msgstr ""
+
+msgid "This command is no longer available, please use the \"list\" command"
+msgstr ""
+
+msgid "This command list what hardware an installed package can access"
+msgstr ""
+
+msgid "This command logs the given username into the store"
+msgstr ""
+
+msgid "This command removes access of a specific hardware device (e.g. /dev/"
+ "ttyUSB0) for an installed package."
+msgstr ""
+
+msgid "Unassign a hardware device to a package"
+msgstr ""
+
+msgid "Update all installed parts"
+msgstr ""
+
+msgid "Use --show-all to see all available forks."
+msgstr ""
+
+#. TRANSLATORS: the %s represents a list of installed appnames
+#. (e.g. "apps: foo, bar, baz")
+#, c-format
+msgid "apps: %s\n"
+msgstr ""
+
+#. TRANSLATORS: the %s an architecture string
+#, c-format
+msgid "architecture: %s\n"
+msgstr ""
+
+#. TRANSLATORS: the %s is a size
+msgid "binary-size: %v\n"
+msgstr ""
+
+#. TRANSLATORS: the %s is a channel name
+#, c-format
+msgid "channel: %s\n"
+msgstr ""
+
+#. TRANSLATORS: the %s is a size
+#, c-format
+msgid "data-size: %s\n"
+msgstr ""
+
+#. TRANSLATORS: the %s is a comma separated list of framework names
+#, c-format
+msgid "frameworks: %s\n"
+msgstr ""
+
+#. TRANSLATORS: the %s is a date
+#, c-format
+msgid "installed: %s\n"
+msgstr ""
+
+msgid "package name is required"
+msgstr ""
+
+#. TRANSLATORS: the %s release string
+#, c-format
+msgid "release: %s\n"
+msgstr ""
+
+msgid "snappy autopilot triggered a reboot to boot into an up to date "
+ "system -- temprorarily disable the reboot by running 'sudo shutdown -"
+ "c'"
+msgstr ""
+
+#. TRANSLATORS: the %s is a date
+#, c-format
+msgid "updated: %s\n"
+msgstr ""
+
+#. TRANSLATORS: the %s is a version string
+#, c-format
+msgid "version: %s\n"
+msgstr ""
+
+msgid "versions"
+msgstr ""
diff -Nru ubuntu-snappy-1.3ubuntu1/run-checks ubuntu-snappy-1.4ubuntu1/run-checks
--- ubuntu-snappy-1.3ubuntu1/run-checks 2015-07-01 06:54:24.000000000 +0000
+++ ubuntu-snappy-1.4ubuntu1/run-checks 2015-07-02 19:09:25.000000000 +0000
@@ -60,15 +60,18 @@
TMPF="$(mktemp)"
./update-pot "$TMPF"
trap "rm -f $TMPF" 0
-if ! diff --ignore-matching-lines=.*POT-Creation-Date.* po/snappy.pot $TMPF; then
+if ! diff -u --ignore-matching-lines=.*POT-Creation-Date.* po/snappy.pot $TMPF; then
echo "You need to run ./update-pot"
exit 1
fi
+# always build
+go build _integration-tests/main.go
+
# integration tests
if which adt-run >/dev/null 2>&1; then
echo "Running integration tests"
- go run _integration-tests/main.go
+ go run _integration-tests/main.go --snappy-from-branch
fi
echo "All good, what could possibly go wrong"
diff -Nru ubuntu-snappy-1.3ubuntu1/update-pot ubuntu-snappy-1.4ubuntu1/update-pot
--- ubuntu-snappy-1.3ubuntu1/update-pot 2015-07-01 07:45:16.000000000 +0000
+++ ubuntu-snappy-1.4ubuntu1/update-pot 2015-07-02 19:09:25.000000000 +0000
@@ -11,7 +11,7 @@
fi
xgettext -d snappy -o "$OUTPUT" --c++ --from-code=UTF-8 \
- --indent --add-comments --no-location --sort-output \
+ --indent --add-comments=TRANSLATORS: --no-location --sort-output \
--package-name=snappy \
--msgid-bugs-address=snappy-devel@lists.ubuntu.com \
--keyword=NG:1,2 --keyword=G \