)
func (s *Sync) syncPackagesDebian() error {
- s.log.Debugf("packages: detected debian")
-
+ s.log.Debugf("packages: checking %s (debian detected)",
+ strings.Join(s.req.Packages, " "))
installed, err := s.debianInstalledPackages()
if err != nil {
return err
}
-
- s.log.Debugf("packages: checking %s",
- strings.Join(s.req.Packages, " "))
var install []string
for _, x := range s.req.Packages {
if !installed[x] {
Stderr: &bytes.Buffer{},
}},
[]string{
- "4: sync remote: packages: detected debian",
+ "4: sync remote: packages: checking package-one package-two (debian detected)",
`4: sync remote: packages: running "/usr/bin/dpkg-query" "--show" "--showformat=${Status}\\t${Package}\\n"`,
`5: sync remote: packages: command stdout:
install ok installed golang
hold ok installed package-one
install ok installed package-two
`,
- "4: sync remote: packages: checking package-one package-two",
},
safcm.MsgSyncResp{},
nil,
),
}},
[]string{
- "4: sync remote: packages: detected debian",
+ "4: sync remote: packages: checking package-one package-two package-three (debian detected)",
`4: sync remote: packages: running "/usr/bin/dpkg-query" "--show" "--showformat=${Status}\\t${Package}\\n"`,
`5: sync remote: packages: command stdout:
install ok installed golang
install ok installed golang-1.16-src
install ok installed package-two
`,
- "4: sync remote: packages: checking package-one package-two package-three",
"3: sync remote: packages: installing package-one package-three",
`4: sync remote: packages: running "/usr/bin/apt-get" "install" "--assume-yes" "--no-upgrade" "--no-install-recommends" "-o" "Dpkg::Options::=--force-confdef" "-o" "Dpkg::Options::=--force-confold" "package-one" "package-three"`,
"5: sync remote: packages: command output:\nfake stdout/stderr",
),
}},
[]string{
- "4: sync remote: packages: detected debian",
+ "4: sync remote: packages: checking package-one package-two (debian detected)",
`4: sync remote: packages: running "/usr/bin/dpkg-query" "--show" "--showformat=${Status}\\t${Package}\\n"`,
`5: sync remote: packages: command stdout:
install ok installed golang
install ok installed golang-1.16-go
install ok installed golang-1.16-src
`,
- "4: sync remote: packages: checking package-one package-two",
"3: sync remote: packages: installing package-one package-two",
`4: sync remote: packages: running "/usr/bin/apt-get" "install" "--assume-yes" "--no-upgrade" "--no-install-recommends" "-o" "Dpkg::Options::=--force-confdef" "-o" "Dpkg::Options::=--force-confold" "package-one" "package-two"`,
"5: sync remote: packages: command output:\nfake stdout/stderr",
Stderr: &bytes.Buffer{},
}},
[]string{
- "4: sync remote: packages: detected debian",
+ "4: sync remote: packages: checking package-one package-two (debian detected)",
`4: sync remote: packages: running "/usr/bin/dpkg-query" "--show" "--showformat=${Status}\\t${Package}\\n"`,
`5: sync remote: packages: command stdout:
install ok installed golang
install ok installed golang-1.16-go
install ok installed golang-1.16-src
`,
- "4: sync remote: packages: checking package-one package-two",
},
safcm.MsgSyncResp{
PackageChanges: []safcm.PackageChange{
)
func (s *Sync) syncServicesSystemd() error {
- s.log.Debugf("services: detected systemd")
-
- s.log.Debugf("services: checking %s",
+ s.log.Debugf("services: checking %s (systemd detected)",
strings.Join(s.req.Services, " "))
services, err := s.systemdServiceState(s.req.Services)
if err != nil {
Stderr: &bytes.Buffer{},
}},
[]string{
- "4: sync remote: services: detected systemd",
- "4: sync remote: services: checking service-one service-two",
+ "4: sync remote: services: checking service-one service-two (systemd detected)",
`4: sync remote: services: running "/bin/systemctl" "show" "--property=ActiveState,UnitFileState,LoadError" "--" "service-one" "service-two"`,
`5: sync remote: services: command stdout:
ActiveState=active
Stderr: &bytes.Buffer{},
}},
[]string{
- "4: sync remote: services: detected systemd",
- "4: sync remote: services: checking service-one service-two",
+ "4: sync remote: services: checking service-one service-two (systemd detected)",
`4: sync remote: services: running "/bin/systemctl" "show" "--property=ActiveState,UnitFileState,LoadError" "--" "service-one" "service-two"`,
`5: sync remote: services: command stdout:
ActiveState=active
Stderr: &bytes.Buffer{},
}},
[]string{
- "4: sync remote: services: detected systemd",
- "4: sync remote: services: checking service-does-not-exist service-two",
+ "4: sync remote: services: checking service-does-not-exist service-two (systemd detected)",
`4: sync remote: services: running "/bin/systemctl" "show" "--property=ActiveState,UnitFileState,LoadError" "--" "service-does-not-exist" "service-two"`,
`5: sync remote: services: command stdout:
ActiveState=inactive
Stderr: &bytes.Buffer{},
}},
[]string{
- "4: sync remote: services: detected systemd",
- "4: sync remote: services: checking service-one service-two service-three",
+ "4: sync remote: services: checking service-one service-two service-three (systemd detected)",
`4: sync remote: services: running "/bin/systemctl" "show" "--property=ActiveState,UnitFileState,LoadError" "--" "service-one" "service-two" "service-three"`,
`5: sync remote: services: command stdout:
ActiveState=inactive
Stderr: &bytes.Buffer{},
}},
[]string{
- "4: sync remote: services: detected systemd",
- "4: sync remote: services: checking service-one service-two service-three",
+ "4: sync remote: services: checking service-one service-two service-three (systemd detected)",
`4: sync remote: services: running "/bin/systemctl" "show" "--property=ActiveState,UnitFileState,LoadError" "--" "service-one" "service-two" "service-three"`,
`5: sync remote: services: command stdout:
ActiveState=inactive
Stderr: &bytes.Buffer{},
}},
[]string{
- "4: sync remote: services: detected systemd",
- "4: sync remote: services: checking service-one service-two service-three",
+ "4: sync remote: services: checking service-one service-two service-three (systemd detected)",
`4: sync remote: services: running "/bin/systemctl" "show" "--property=ActiveState,UnitFileState,LoadError" "--" "service-one" "service-two" "service-three"`,
`5: sync remote: services: command stdout:
ActiveState=inactive