~snappy-dev/snappy/15.04

« back to all changes in this revision

Viewing changes to snappy/datadir.go

  • Committer: Snappy Tarmac
  • Author(s): John R. Lenton, Michael Vogt, Leo Arias, Launchpad Translations on behalf of snappy-dev, Federico Gimenez, Ricardo Mendoza
  • Date: 2015-10-13 06:03:57 UTC
  • mfrom: (711.1.54 snappy)
  • Revision ID: snappy_tarmac-20151013060357-rf1cz6y7190uzzlr
Merge trunk fixes. by snappy-dev approved by chipaca

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
import (
23
23
        "path/filepath"
24
24
        "strings"
 
25
 
 
26
        "launchpad.net/snappy/dirs"
25
27
)
26
28
 
27
29
// A SnapDataDir represents a single data directory for a version of a package
75
77
        // and you want us to be able to clean that up.
76
78
        for _, dir := range dirs {
77
79
                version := filepath.Base(dir)
 
80
                if version == "current" {
 
81
                        continue
 
82
                }
78
83
                name := filepath.Base(filepath.Dir(dir))
79
84
                origin := ""
80
85
                idx := strings.LastIndexAny(name, ".")
102
107
 
103
108
// DataDirs returns the list of all SnapDataDirs in the system.
104
109
func DataDirs(spec string) []SnapDataDir {
105
 
        return append(data1(spec, snapDataHomeGlob), data1(spec, snapDataDir)...)
 
110
        return append(data1(spec, dirs.SnapDataHomeGlob), data1(spec, dirs.SnapDataDir)...)
106
111
}