Mailinglist Archive: yast-commit (819 mails)

< Previous Next >
[yast-commit] r54595 - in /trunk/packager: package/yast2-packager.changes src/clients/inst_productsources.ycp
  • From: lslezak@xxxxxxxxxxxxxxxx
  • Date: Wed, 14 Jan 2009 08:41:15 -0000
  • Message-id: <E1LN1JL-0007vj-78@xxxxxxxxxxxxxxxx>
Author: lslezak
Date: Wed Jan 14 09:41:14 2009
New Revision: 54595

URL: http://svn.opensuse.org/viewcvs/yast?rev=54595&view=rev
Log:
- use a better alias instread of "repo_N" for community
repositories (bnc#456099)

Modified:
trunk/packager/package/yast2-packager.changes
trunk/packager/src/clients/inst_productsources.ycp

Modified: trunk/packager/package/yast2-packager.changes
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/packager/package/yast2-packager.changes?rev=54595&r1=54594&r2=54595&view=diff
==============================================================================
--- trunk/packager/package/yast2-packager.changes (original)
+++ trunk/packager/package/yast2-packager.changes Wed Jan 14 09:41:14 2009
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Wed Jan 14 09:36:24 CET 2009 - lslezak@xxxxxxx
+
+- use a better alias instread of "repo_N" for community
+ repositories (bnc#456099)
+
+-------------------------------------------------------------------
Tue Jan 13 14:28:50 CET 2009 - lslezak@xxxxxxx

- display USB devices when adding USB mass storage repository

Modified: trunk/packager/src/clients/inst_productsources.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/packager/src/clients/inst_productsources.ycp?rev=54595&r1=54594&r2=54595&view=diff
==============================================================================
--- trunk/packager/src/clients/inst_productsources.ycp (original)
+++ trunk/packager/src/clients/inst_productsources.ycp Wed Jan 14 09:41:14 2009
@@ -1251,6 +1251,30 @@
// probing succeeded?
if (repo_type != nil && repo_type != "NONE")
{
+ // create alias in form "<hostname>-<last_path_element>"
+ map parsed_url = URL::Parse(url);
+ string alias = parsed_url["host"]:"";
+
+ list<string> path_parts = splitstring(parsed_url["path"]:"", "/");
+ // remove empty parts
+ path_parts = filter(string p, path_parts, {return size(p) > 0;});
+
+ if (size(path_parts) > 0)
+ {
+ string suffix = path_parts[size(path_parts) - 1]:"";
+
+ if (regexpmatch(suffix, "[0-9]+$") && size(path_parts) > 1)
+ {
+ y2milestone("Version string detected in path element");
+ suffix = path_parts[size(path_parts) - 2]:"";
+ }
+
+ alias = alias + "-" + suffix;
+ }
+
+ alias = GetUniqueAlias(alias);
+ y2milestone("Using alias: %1", alias);
+
src_id = Pkg::RepositoryAdd ($[
"enabled" : false,
"name" : repo_name,
@@ -1258,7 +1282,7 @@
"prod_dir" : pth,
// alias needs to be unique
// bugzilla #309317
- "alias" : GetUniqueAlias("repo"),
+ "alias" : alias,
"type" : repo_type,
]);
}

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages