1 |
brianr |
1.1 |
diff -Nur smeserver-usbdisksmanager-1.2.old/root/etc/e-smith/db/confusbdisks/migrate/00openRW smeserver-usbdisksmanager-1.2/root/etc/e-smith/db/confusbdisks/migrate/00openRW |
2 |
|
|
--- smeserver-usbdisksmanager-1.2.old/root/etc/e-smith/db/confusbdisks/migrate/00openRW 1969-12-31 19:00:00.000000000 -0500 |
3 |
|
|
+++ smeserver-usbdisksmanager-1.2/root/etc/e-smith/db/confusbdisks/migrate/00openRW 2019-01-13 23:14:26.433000000 -0500 |
4 |
|
|
@@ -0,0 +1,4 @@ |
5 |
|
|
+{ |
6 |
|
|
+ $DB = esmith::ConfigDB->open(${DB_FILENAME}); |
7 |
|
|
+} |
8 |
|
|
+ |
9 |
|
|
diff -Nur smeserver-usbdisksmanager-1.2.old/root/etc/e-smith/db/confusbdisks/migrate/10options smeserver-usbdisksmanager-1.2/root/etc/e-smith/db/confusbdisks/migrate/10options |
10 |
|
|
--- smeserver-usbdisksmanager-1.2.old/root/etc/e-smith/db/confusbdisks/migrate/10options 1969-12-31 19:00:00.000000000 -0500 |
11 |
|
|
+++ smeserver-usbdisksmanager-1.2/root/etc/e-smith/db/confusbdisks/migrate/10options 2019-01-13 23:14:51.014000000 -0500 |
12 |
|
|
@@ -0,0 +1,27 @@ |
13 |
|
|
+{ |
14 |
|
|
+ my @add = split(/[,; ]+/, ''); |
15 |
|
|
+ my %remove = map { $_ => 1 } split(/[,; ]+/, 'managed,pamconsole'); |
16 |
|
|
+# options=pamconsole,exec,noauto,managed,gid=102,uid=101 |
17 |
|
|
+# options=pamconsole,exec,noauto,managed |
18 |
|
|
+ for my $repo ( $DB->get_all ) |
19 |
|
|
+ { |
20 |
|
|
+ #warn $repo->key; |
21 |
|
|
+ my @options = split(/,/, $repo->prop('options') || ''); |
22 |
|
|
+ push @options, @add; |
23 |
|
|
+ @options = grep(!defined $remove{$_} , @options); |
24 |
|
|
+ |
25 |
|
|
+ # remove duplicates |
26 |
|
|
+ undef %saw; |
27 |
|
|
+ @options = grep(!$saw{$_}++, @options); |
28 |
|
|
+ |
29 |
|
|
+ if ($#options >= 0) |
30 |
|
|
+ { |
31 |
|
|
+ $repo->set_prop('options', join(',', @options)); |
32 |
|
|
+ } |
33 |
|
|
+ else |
34 |
|
|
+ { |
35 |
|
|
+ # $repo->delete('options'); |
36 |
|
|
+ } |
37 |
|
|
+ } |
38 |
|
|
+} |
39 |
|
|
+ |