summaryrefslogtreecommitdiffstats
path: root/abs/core/mythinstall/installdialog.cpp.patch
blob: b188bab606cef5f7c64428d17d8dba1aaa24eca7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
--- installdialog.cpp.orig	2013-12-05 21:06:13.358926594 +0000
+++ installdialog.cpp	2013-12-06 17:26:16.491833828 +0000
@@ -881,50 +881,32 @@
             }
             if ( flag )
             {
-                tflag =  1;
-            }
-            else
-            {
-                cout << "searching for knoppmyth-versin" << endl;
-                //couldn't open /etc/systemconfig, so now look for /tmp/etc/Knoppmyth-version
-                QFile file("/tmp/etc/KnoppMyth-version");
-                if ( file.exists() )
-                {   //appears to be a knoppmyth version, proceed
-                    cout << "found knoppmyth-version" << endl;
-                    QFile kmfile("/tmp/etc/hostname");
-                    if ( kmfile.open(QIODevice::ReadOnly | QIODevice::Text) )
-                    {
-                        Q3TextStream t( &kmfile );        // use a text stream
-                        line = t.readLine();
-                        flag=true;
-                        currentitem = line.stripWhiteSpace();
-                        current_hostname =  currentitem   ;
-                        //gCoreContext->ActivateSettingsCache(true);
-                        gCoreContext->ClearSettingsCache();
-                        //FixME
-                        //gCoreContext->SetSetting("HostMyhostname",current_hostname);
-                        gCoreContext->SaveSetting("HostMyhostname",current_hostname);
-                    }
-                    kmfile.close();
-                    runNextSetting = ask_validate_network();
-                }
-                else
+                //check if LinHES-release is 8.0 or newer
+                cout << "searching for LinHES-release" << endl;
+                //look for /tmp/etc/LinHES-release
+                QFile file("/tmp/etc/LinHES-release");
+                if ( file.open(QIODevice::ReadOnly | QIODevice::Text) )
                 {
-                    //popup things went wrong
-                    DialogCode returncode  = MythPopupBox::Show2ButtonPopup(GetMythMainWindow(),
-                                             QString(""),
-                                             QObject::tr("Couldn't find the old config file, proceed with update?"),
-                                             QObject::tr("No"), QObject::tr("Yes"), kDialogCodeButton1);
-                    if ( returncode == kDialogCodeButton1 )
+                    Q3TextStream t( &file );        // use a text stream
+                    while ( !t.eof() )
                     {
-                        runNextSetting = ask_validate_network();
-                    }
-                    else if ( returncode == kDialogCodeButton0 )
-                    {
-                        runNextSetting = 1;
+                        line = t.readLine();
+                        if ( line.contains("8.") )
+                        {
+                            tflag = 1;
+                        }
                     }
+                    file.close();
                 }
-
+            }
+            if ( tflag == 0 )
+            {
+                //popup install doesn't look like R8
+                MythPopupBox::showOkPopup(
+                    GetMythMainWindow(),
+                    QObject::tr(""),
+                    QObject::tr("The selected disk cannot be upgraded because it is older than LinHES R8.0."));
+                runNextSetting = 1;
             }
         }
     }