Bug 418440

Summary: yast repostitory view, editor doesn`t apply repo name changes on all places
Product: [openSUSE] openSUSE 11.1 Reporter: Forgotten User 7pwnVrOCb1 <forgotten_7pwnVrOCb1>
Component: YaST2Assignee: E-mail List <yast2-maintainers>
Status: RESOLVED INVALID QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P5 - None    
Version: Factory   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE 11.0   
Whiteboard:
Found By: Beta-Customer Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: package versions of yasgt and zypp

Description Forgotten User 7pwnVrOCb1 2008-08-19 19:04:13 UTC
How to find the problem:

1) rename a repository name(not path or url) and look in
   /etc/zypp/repos.d

   YaST uses the repository name AS FILENAME and as value inside
   this file, but the YaST Repository Editor does only change the value.

Example with file: 

/etc/zypp/repos.d/test_repository_name_change.repo            <====

It contains the new value now:

[test_repository_name_change]
name=test_repository_name_change__FAILED                      <====
enabled=1
autorefresh=1
baseurl=http://ftp5.gwdg.de/pub/opensuse/repositories/Virtualization%3a/Qemu/openSUSE_Factory/
path=/
type=rpm-md
keeppackages=0

2) I`ve used YaST with active zypper caching in /var/cache/zypp/packages

   a)Activate zypper cache by: 
     zypper mr -kt
   b)Install a package by using yast or zypper
   c)Rename the repository name by yast repository editor (embedded 
     in software installer)
   d)Activate caching for the new name(for zypper it`s a new repository):
     zypper mr -kt          (the output does not show the new repo name, but the
                             old name)
   e)remove the package rpm from cache directory

   d)re-install the same or other package(now with new repository name
     (I`ve used "test_repository_name_change__FAILED", old name was
     "test_repository_name_change".

   and look, what was done on the cache directory /var/cache/zypp/packages,
   which does also use the subdirectory naming from yast repository name editor.


   Zypper`s cache directory view /var/cache/zypp/packages 

drwxr-xr-x 17 root root 4096 Aug 19 22:32 .
drwxr-xr-x 20 root root 4096 Aug 18 23:11 ..
drwxr-xr-x  5 root root 4096 Aug 18 09:58 education
drwxr-xr-x  4 root root 4096 Aug 18 10:37 java-32bit
drwxr-xr-x  3 root root 4096 Aug 18 02:00 languages-pascal
drwxr-xr-x  3 root root 4096 Aug 18 10:26 makesusedvd_1
drwxr-xr-x  4 root root 4096 Aug 19 00:11 my_1
drwxr-xr-x  3 root root 4096 Aug 17 23:26 non-oss
drwxr-xr-x  3 root root 4096 Aug 17 23:26 oss
drwxr-xr-x  5 root root 4096 Aug 18 03:46 packman
drwxr-xr-x  5 root root 4096 Aug 18 12:11 python-skype
drwxr-xr-x  3 root root 4096 Aug 18 12:09 skype
drwxr-xr-x  3 root root 4096 Aug 19 22:32 test_repository_name_change  <===
drwxr-xr-x  4 root root 4096 Aug 18 03:27 tools
drwxr-xr-x  3 root root 4096 Aug 17 23:46 videolan
drwxr-xr-x  4 root root 4096 Aug 18 07:27 yast-svn
drwxr-xr-x  3 root root 4096 Aug 18 08:58 yast-tools


As you can see on the new file download(was removed manually before),
the old directory name is really in use for new downloads from
new repository name... I have not in mind what was going on after
editing the download path for an given repository name :-(

'grep' and 'find' do help to find such naming problems, if you build automatic testing tools for yast development, but you now.
So, please do some code cleaning if anybody get the time :-)

-
I found it out because I use zypper cache to create my own repository
(one repo for all packages I need).
Comment 1 Forgotten User 7pwnVrOCb1 2008-08-19 19:05:35 UTC
Created attachment 234217 [details]
package versions of yasgt and zypp

package list
Comment 2 Ladislav Slezák 2008-09-11 14:43:07 UTC
You must distinguish between repository alias and repository name.

In the example:
[test_repository_name_change] <============== this is the alias
name=test_repository_name_change__FAILED <=== this is the name

Name is long repository name (a descriptive string).

Alias is a unique short repository name used for identifying the repository (that's why it must be unique). And it's used in zypper so the user does not need to write very long names.

Yast uses name string only, alias is hidden from user point of view.

The package manager (libzypp) uses alias for persistent storage (package and metadata cache).

So if you want to keep packages in test_repository_name_change subdirectory you have to change the alias.
Comment 3 Ladislav Slezák 2008-09-11 14:48:15 UTC
A typo, the last paragraph should be:

So if you want to keep packages in test_repository_name_change__FAILED subdirectory you have to change the alias.