@@ -86,7 +86,7 @@ unpack_archive(struct xbps_handle *xhp,
8686 const char * fname ,
8787 struct archive * ar )
8888{
89- const struct xbps_file * file ;
89+ const struct xbps_file * old = NULL , * new = NULL ;
9090 xbps_dictionary_t binpkg_filesd , pkg_filesd , obsd ;
9191 xbps_array_t array , obsoletes ;
9292 xbps_trans_type_t ttype ;
@@ -292,19 +292,19 @@ unpack_archive(struct xbps_handle *xhp,
292292 continue ;
293293 }
294294
295- file = xbps_transaction_file_get (xhp , entry_pname + 1 );
296- if (! file ) {
295+ rv = xbps_transaction_file_get (xhp , entry_pname + 1 , & old , & new );
296+ if (rv < 0 ) {
297297 xbps_error_printf ("unknown file in binary package: %s: %s\n" ,
298298 pkgver , entry_pname + 1 );
299- rv = EINVAL ;
299+ rv = - rv ;
300300 goto out ;
301301 }
302302
303303 /*
304304 * Check if current entry is a configuration file,
305305 * that should be kept.
306306 */
307- keep_conf_file = (file -> flags & XBPS_FILE_CONF ) != 0 ;
307+ keep_conf_file = (new -> flags & XBPS_FILE_CONF ) != 0 ;
308308
309309 /*
310310 * If file to be extracted does not match the file type of
@@ -341,13 +341,13 @@ unpack_archive(struct xbps_handle *xhp,
341341 }
342342 rv = 0 ;
343343 } else {
344- if (!file -> sha256 ) {
344+ if (!new -> sha256 ) {
345345 xbps_error_printf ("missing checksum in binary package"
346346 ": %s: %s\n" , pkgver , entry_pname + 1 );
347347 rv = EINVAL ;
348348 goto out ;
349349 }
350- rv = xbps_file_sha256_check (entry_pname , file -> sha256 );
350+ rv = xbps_file_sha256_check (entry_pname , new -> sha256 );
351351 if (rv == -1 ) {
352352 /* error */
353353 xbps_dbg_printf (
0 commit comments