~stephen-stewart/snapweb/hide-installer-for-oem

« back to all changes in this revision

Viewing changes to snappy/icon.go

Using package types to determine the resource name (ID) as frameworks and oem packages installed locally contain no origin/namespace by sergiusens approved by chipaca

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
        ErrIconNotExist = errors.New("the icon does not exist")
38
38
)
39
39
 
40
 
func localIconPath(pkgName, iconPath string) (relativePath string, err error) {
 
40
func localIconPath(ID, iconPath string) (relativePath string, err error) {
41
41
        dataPath, relativePath, err := IconDir()
42
42
        if err != nil {
43
43
                return "", err
44
44
        }
45
45
 
46
 
        baseIcon := fmt.Sprintf("%s_%s", pkgName, filepath.Base(iconPath))
 
46
        baseIcon := fmt.Sprintf("%s_%s", ID, filepath.Base(iconPath))
47
47
 
48
48
        relativePath = filepath.Join(relativePath, baseIcon)
49
49
        iconDstPath := filepath.Join(dataPath, baseIcon)