diff --git a/smartmontools/ChangeLog b/smartmontools/ChangeLog index e356273afda2d72cac12b448ac2d235495bada7d..025edf495f855f8ead8d355bd3448c3897c20a24 100644 --- a/smartmontools/ChangeLog +++ b/smartmontools/ChangeLog @@ -2,6 +2,9 @@ $Id$ 2022-02-01 Christian Franke <franke@computer.org> + os_win32/update-smart-drivedb.nsi: Remove, no longer used. + Makefile.am: Remove related targets. + os_win32/installer.nsi: Install update-smart-drivedb.ps1. Delete update-smart-drivedb.exe. Remove outdated delete commands. diff --git a/smartmontools/Makefile.am b/smartmontools/Makefile.am index 4f3c63ff452c7da1929247fc175b57aff43812bd..b87b15dcd5da333966b75a4ae54483735814d4b2 100644 --- a/smartmontools/Makefile.am +++ b/smartmontools/Makefile.am @@ -425,7 +425,6 @@ EXTRA_DIST = \ os_win32/smartd_mailer.conf.sample.ps1 \ os_win32/smartd_warning.cmd \ os_win32/syslogevt.mc \ - os_win32/update-smart-drivedb.nsi \ os_win32/update-smart-drivedb.ps1.in \ os_win32/versioninfo.rc.in \ os_win32/wtssendmsg.c \ @@ -872,10 +871,6 @@ EXEFILES_WIN32 = \ $(exedir_win32)/wtssendmsg.exe if ENABLE_DRIVEDB -if OS_WIN32_NSIS -EXEFILES_WIN32 += \ - $(exedir_win32)/update-smart-drivedb.exe -endif EXEFILES_WIN32 += \ $(exedir_win32)/update-smart-drivedb.ps1 endif @@ -914,7 +909,6 @@ CLEANFILES += \ smartctl_res.rc smartd_res.rc \ syslogevt.h \ syslogevt.rc syslogevt_*.bin \ - update-smart-drivedb.exe \ update-smart-drivedb.ps1 \ wtssendmsg.exe wtssendmsg_res.rc @@ -956,10 +950,6 @@ $(distinst_win32): os_win32/installer.nsi smartctl_res.rc distdir.mkdir $(FILES_ sha1sum $@ > $@.sha1 sha256sum $@ > $@.sha256 -# Build drivedb.h update tool -update-smart-drivedb.exe: os_win32/update-smart-drivedb.nsi - "$(MAKENSIS)" -V2 -NOCD -DBRANCH=$(DRIVEDB_BRANCH) $< - else $(distinst_win32): @echo "makensis: command not found. Please install NSIS from http://nsis.sourceforge.net/" 1>&2 @@ -979,10 +969,6 @@ $(exedir_win32)/%.exe: %.exe if test -n '$(STRIP)'; then $(STRIP) -s $@; else strip -s $@; fi touch -r $< $@ -# strip would break NSIS integrity check -$(exedir_win32)/update-smart-drivedb.exe: update-smart-drivedb.exe - cp -p $< $@ - $(exedir_win32)/%.h: $(srcdir)/%.h $(UNIX2DOS) < $< > $@ touch -r $< $@ diff --git a/smartmontools/os_win32/update-smart-drivedb.nsi b/smartmontools/os_win32/update-smart-drivedb.nsi deleted file mode 100644 index b209ee882c905ce1d1549f0c4dfa5bdd2cb87e4c..0000000000000000000000000000000000000000 --- a/smartmontools/os_win32/update-smart-drivedb.nsi +++ /dev/null @@ -1,135 +0,0 @@ -; -; smartmontools drive database update NSIS script -; -; Home page of code is: http://www.smartmontools.org -; -; Copyright (C) 2011-13 Christian Franke -; -; SPDX-License-Identifier: GPL-2.0-or-later -; -; $Id$ -; - - -;-------------------------------------------------------------------- -; Command line arguments: -; makensis -DBRANCH=<svn-branch-name> update-smart-drivedb.nsi - -!include "FileFunc.nsh" - -Name "update-smart-drivedb" -Caption "Update smartmontools drivedb.h" -OutFile "update-smart-drivedb.exe" - -SetCompressor /solid lzma - -XPStyle on -InstallColors /windows - -Page instfiles - -Section "" - - SetOutPath $INSTDIR - -!ifdef BRANCH - StrCpy $0 "branches/${BRANCH}" - Push $0 - Call Download - IfErrors 0 endload -!endif - - StrCpy $0 "trunk" - Push $0 - Call Download - IfErrors 0 endload - MessageBox MB_OK "Download failed" /SD IDOK - Abort "Download failed" - endload: - - ; Check syntax - Delete "drivedb.h.error" - IfFileExists "smartctl-nc.exe" 0 endsyntax - ExecWait '.\smartctl-nc.exe -B drivedb.h.new -P showall' $1 - StrCmp $1 "0" endsyntax - Rename "drivedb.h.new" "drivedb.h.error" - MessageBox MB_OK "drivedb.h.error: rejected by smartctl, probably no longer compatible" /SD IDOK - Abort "drivedb.h.error: rejected by smartctl, probably no longer compatible" - endsyntax: - - ; Keep old file if identical - Delete "drivedb.h.lastcheck" - IfFileExists "drivedb.h" 0 endcomp - Call Cmp - IfErrors changed 0 - DetailPrint "drivedb.h is already up to date" - MessageBox MB_OK "$INSTDIR\drivedb.h is already up to date" /SD IDOK - Delete "drivedb.h.new" - DetailPrint "Create file: drivedb.h.lastcheck" - FileOpen $1 "drivedb.h.lastcheck" w - FileClose $1 - Return - changed: - Delete "drivedb.h.old" - Rename "drivedb.h" "drivedb.h.old" - - endcomp: - Rename "drivedb.h.new" "drivedb.h" - MessageBox MB_OK "$INSTDIR\drivedb.h updated from $0" /SD IDOK - -SectionEnd - -Function .onInit - ; Install in same directory - ${GetExePath} $INSTDIR -FunctionEnd - -; Download from branch or trunk on stack, SetErrors on error -Function Download - Pop $R0 - DetailPrint "Download from $R0" - - ; SVN repository read-only URL - ; (SF code browser does not return ContentLength required for NSISdl::download) - StrCpy $R1 "http://svn.code.sf.net/p/smartmontools/code/$R0/smartmontools/drivedb.h" - - DetailPrint "($R1)" - - NSISdl::download $R1 "drivedb.h.new" - Pop $R0 - DetailPrint "Download: $R0" - ClearErrors - StrCmp $R0 "success" 0 err - - ; File must start with comment - FileOpen $R0 "drivedb.h.new" r - FileReadByte $R0 $R1 - FileClose $R0 - ClearErrors - StrCmp $R1 "47" 0 +2 - Return - DetailPrint "drivedb.h.new: syntax error ($R1)" - -err: - Delete "drivedb.h.new" - SetErrors -FunctionEnd - -; Compare drivedb.h drivedb.h.new, SetErrors if different -; TODO: ignore differences in Id string -Function Cmp - ClearErrors - FileOpen $R0 "drivedb.h" r - FileOpen $R1 "drivedb.h.new" r - readloop: - FileRead $R0 $R2 - FileRead $R1 $R3 - StrCmp $R2 $R3 0 +2 - IfErrors 0 readloop - FileClose $R0 - FileClose $R1 - ClearErrors - StrCmp $R2 $R3 0 +2 - Return - SetErrors -FunctionEnd