Skip to content

Commit

Permalink
Merge pull request #14 from jsuchome/master
Browse files Browse the repository at this point in the history
disable USB sources after installation (bnc#793709)
  • Loading branch information
jsuchome committed Dec 14, 2012
2 parents 91383bd + 8d770e2 commit 659b4bf
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
2.23.4
2.23.5
6 changes: 6 additions & 0 deletions package/yast2-installation.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Dec 14 15:16:52 CET 2012 - jsuchome@suse.cz

- disable USB sources after installation (bnc#793709)
- 2.23.5

-------------------------------------------------------------------
Tue Dec 4 16:54:56 CET 2012 - jsuchome@suse.cz

Expand Down
20 changes: 20 additions & 0 deletions src/clients/inst_extrasources.ycp
Expand Up @@ -51,6 +51,9 @@ import "Label";
// local sources that have been attached under /mnt during upgrade
map<integer,string> local_urls = $[];

// USB sources that were used during installation should be disabled (bnc#793709)
map<integer,string> usb_sources = $[];

/**
* Returns list of maps of repositories to register. See bnc #381360.
*
Expand Down Expand Up @@ -157,6 +160,12 @@ list<string> RegisteredUrls()
{
local_urls[src] = url;
}

// check for USB sources which should be disabled
if (issubstring (url, "device=/dev/disk/by-id/usb-"))
{
usb_sources[src] = url;
}
}
);

Expand All @@ -167,6 +176,8 @@ list<string> RegisteredUrls()

y2milestone("Registered local sources under /mnt: %1", local_urls);

y2milestone("Registered USB sources: %1", usb_sources);

return ret;
}

Expand Down Expand Up @@ -359,6 +370,14 @@ if (size (local_urls) > 0) {
Pkg::SourceSaveAll();
}

// disable USB sources
if (size (usb_sources) > 0) {
foreach (integer srcid, string url, usb_sources, {
y2milestone ("disabling USB source %1", url);
Pkg::SourceSetEnabled (srcid, false);
});
Pkg::SourceSaveAll();
}

// any confirmed source to register?
if (size (register_url) > 0) {
Expand Down Expand Up @@ -448,6 +467,7 @@ if (size (register_url) > 0) {
}
}


return `auto;

/* EOF */
Expand Down

0 comments on commit 659b4bf

Please sign in to comment.