@@ -157,7 +157,7 @@ func checkDnfLastTimePackagesInstalled() time.Time {
157157 lastInstall := `dnf history list | grep -m 1 update | awk '{print $5,$6}'`
158158 out , err := exec .Command ("bash" , "-c" , lastInstall ).Output ()
159159 if err != nil {
160- log .Printf ("[ERROR]: could not read APT history log, reason: %v" , err )
160+ log .Printf ("[ERROR]: could not read DNF history log, reason: %v" , err )
161161 return time.Time {}
162162 }
163163
@@ -166,14 +166,17 @@ func checkDnfLastTimePackagesInstalled() time.Time {
166166 lastInstall := `dnf history list | grep -m 1 update | awk '{print $6,$7}'`
167167 out , err := exec .Command ("bash" , "-c" , lastInstall ).Output ()
168168 if err != nil {
169- log .Printf ("[ERROR]: could not read APT history log, reason: %v" , err )
169+ log .Printf ("[ERROR]: could not read DNF history log, reason: %v" , err )
170170 return time.Time {}
171171 }
172172
173173 t , err = time .Parse ("2006-01-02 15:04" , strings .TrimSpace (string (out )))
174174 if err != nil {
175- log .Printf ("[ERROR]: could not parse time string %s from DNF history log, reason: %v" , string (out ), err )
176- return time.Time {}
175+ t , err = time .Parse ("2006-01-02 15:04:05" , strings .TrimSpace (string (out )))
176+ if err != nil {
177+ log .Printf ("[ERROR]: could not parse time string %s from DNF history log, reason: %v" , string (out ), err )
178+ return time.Time {}
179+ }
177180 }
178181 }
179182
0 commit comments