Bug 295029

Summary: software manager: import installation sources
Product: [openSUSE] openSUSE 10.2 Reporter: macias - <bluedzins>
Component: YaST2Assignee: Jan Kupec <jkupec>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Enhancement    
Priority: P5 - None CC: dmacvicar, kkaempf, ma, mvidner
Version: Final   
Target Milestone: ---   
Hardware: i586   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description macias - 2007-07-27 06:50:55 UTC
You can "export" list of installation sources via 
installation_sources -s
It would be great if SM could import such list. Now user has to manually add entries one by one.
Comment 1 Ladislav Slezák 2007-07-30 07:39:48 UTC
installation_sources is an alias for zypper
Comment 2 Jan Kupec 2007-07-30 15:34:39 UTC
First of all, the installation_sources script uses zypper to do its job and was provided as a compatibility replacement for a program that was in yast2-packagemanager.rpm. You can switch to zypper now (or after 10.3 is out).

The new version of libzypp which, will be (hopefully) shipped with openSUSE 10.3 and therefore the applications using it (YaST, zypper, ...) use plain text .repo files located by default in /etc/zypp/repos.d to configure repositories (inst. sources). Exporting and importing them is a matter of copying the files. (Don't forget to refresh the repos after manipulating them).

Should we provide a simple way to export/import these through zypper anyway?
Comment 3 macias - 2007-07-30 16:47:47 UTC
Jan, I am just a user so I know this question wasn't for me, but anyway my 2 cents:

Pros:
1) black-box design, no matter what form is used to store repo list, from the user perspective it does not change, so it is great for backups for example (you just type xxxx --export and you have a guarantee all you have to do on system crash is xxxx --import and it works)

2) convenient for users,  import, export, no fiddling with raw files
2.a) security -- if you want to send such file to somebody each time you have to check what the log, config, etc. really contains, this way, since you are about to send export you are sure it is nothing more than repo list

3) with a tiny extra option new functionality, you can import the list (i.e. replace the old one) or you can import & merge at the same time (even better)
Comment 4 Duncan Mac-Vicar 2007-08-03 16:00:30 UTC
The export functionality is cp /etc/zypp/repod.d/* /backup

The import functionality is cp /backup/* /etc/zypp/repod.d

Comment 5 macias - 2007-08-03 19:30:22 UTC
Duncan, thank you for help, I will sure use it because I don't have any other chance :-) However as the solution for users it does not have any advantages mentioned before.
Comment 6 Cristian Rodriguez 2007-08-03 19:35:44 UTC
(In reply to comment #5 from Maciej Pilichowski)
> However as the solution for users it does not have any advantages
> mentioned before.


huh ? what is more simple than file copy operation... ? I dont get your point...

Comment 7 macias - 2007-08-03 21:10:49 UTC
I explained them before (take a look). For example -- how can you merge anything using cp? How can you guarantee the design (it already changed!)? Etc.
Comment 8 Jan Kupec 2007-08-07 09:15:55 UTC
OK, i think i have a solution.

For "importing" repos, you already can use zypper addrepo --repo repo_file_URL. It will add all the repos defined in the specified file (can be remote or local (although local needs fix, for now you have to specify it as file://absolute/path/to/the/file.repo).

For exporting i will soon add a functionality to write all the repos into a single .repo file. (Probably zypper repos --export <file> or something like that).

But, as mentioned before, you already can manipulate the files manually, they are just simple text files (ini format).
Comment 9 Jan Kupec 2007-08-14 17:59:05 UTC
zypper repos --export file done in svn, will be submitted in zypper 0.8.11
Comment 10 Jan Kupec 2007-08-15 18:45:18 UTC
submitted in zypper 0.8.11