~ubuntu-branches/ubuntu/raring/smartmontools/raring

« back to all changes in this revision

Viewing changes to os_win32/update-smart-drivedb.nsi

  • Committer: Package Import Robot
  • Author(s): Giuseppe Iuculano
  • Date: 2012-05-12 13:02:49 UTC
  • mfrom: (2.2.17 sid)
  • Revision ID: package-import@ubuntu.com-20120512130249-x4vmqc2uu3bynss1
Tags: 5.42+svn3539-1
* [e165493] Imported Upstream version 5.42+svn3539
  (Closes: #668391, #608953)
* [9fcd449] Refreshed patches
* [65c801f] Do not install upstream init (Closes: #631075)
* [9a19418] Fixed check for /usr/bin/mail.
  Thanks to Martin von Gagern (Closes: #649515)

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
; You should have received a copy of the GNU General Public License
14
14
; (for example COPYING); If not, see <http://www.gnu.org/licenses/>.
15
15
;
16
 
; $Id: update-smart-drivedb.nsi 3296 2011-03-16 22:17:51Z chrfranke $
 
16
; $Id: update-smart-drivedb.nsi 3392 2011-06-29 19:13:22Z chrfranke $
17
17
;
18
18
 
19
19
 
49
49
  Push $0
50
50
  Call Download
51
51
  IfErrors 0 endload
52
 
    MessageBox MB_OK "Download failed"
 
52
    MessageBox MB_OK "Download failed" /SD IDOK
53
53
    Abort "Download failed"
54
54
  endload:
55
55
 
59
59
    ExecWait '.\smartctl-nc.exe -B drivedb.h.new -P showall' $1
60
60
    StrCmp $1 "0" endsyntax
61
61
      Rename "drivedb.h.new" "drivedb.h.error"
62
 
      MessageBox MB_OK "drivedb.h.error: rejected by smartctl, probably no longer compatible"
 
62
      MessageBox MB_OK "drivedb.h.error: rejected by smartctl, probably no longer compatible" /SD IDOK
63
63
      Abort "drivedb.h.error: rejected by smartctl, probably no longer compatible"
64
64
  endsyntax:
65
65
 
69
69
    Call Cmp
70
70
    IfErrors changed 0
71
71
      DetailPrint "drivedb.h is already up to date"
72
 
      MessageBox MB_OK "$INSTDIR\drivedb.h is already up to date"
 
72
      MessageBox MB_OK "$INSTDIR\drivedb.h is already up to date" /SD IDOK
73
73
      Delete "drivedb.h.new"
74
74
      DetailPrint "Create file: drivedb.h.lastcheck"
75
75
      FileOpen $1 "drivedb.h.lastcheck" w
81
81
 
82
82
  endcomp:
83
83
  Rename "drivedb.h.new" "drivedb.h"
84
 
  MessageBox MB_OK "$INSTDIR\drivedb.h updated from $0"
 
84
  MessageBox MB_OK "$INSTDIR\drivedb.h updated from $0" /SD IDOK
85
85
 
86
86
SectionEnd
87
87
 
124
124
; Compare drivedb.h drivedb.h.new, SetErrors if different
125
125
; TODO: ignore differences in Id string
126
126
Function Cmp
127
 
    ClearErrors
128
 
    FileOpen $R0 "drivedb.h" r
129
 
    FileOpen $R1 "drivedb.h.new" r
130
 
    readloop:
131
 
      FileRead $R0 $R2
132
 
      FileRead $R1 $R3
133
 
      StrCmp $R2 $R3 0 +2
134
 
    IfErrors 0 readloop
135
 
    FileClose $R0
136
 
    FileClose $R1
137
 
    ClearErrors
 
127
  ClearErrors
 
128
  FileOpen $R0 "drivedb.h" r
 
129
  FileOpen $R1 "drivedb.h.new" r
 
130
  readloop:
 
131
    FileRead $R0 $R2
 
132
    FileRead $R1 $R3
138
133
    StrCmp $R2 $R3 0 +2
139
 
      Return
140
 
    SetErrors
 
134
  IfErrors 0 readloop
 
135
  FileClose $R0
 
136
  FileClose $R1
 
137
  ClearErrors
 
138
  StrCmp $R2 $R3 0 +2
 
139
    Return
 
140
  SetErrors
141
141
FunctionEnd