@@ -211,14 +211,15 @@ pkg_checksum_entry_cmp(struct pkg_checksum_entry *e1,
211
211
212
212
int
213
213
pkg_checksum_generate (struct pkg * pkg , char * dest , size_t destlen ,
214
- pkg_checksum_type_t type , bool inc_scripts , bool inc_version )
214
+ pkg_checksum_type_t type , bool inc_scripts , bool inc_version , bool inc_files )
215
215
{
216
216
unsigned char * bdigest ;
217
217
char * olduid , * buf ;
218
218
size_t blen ;
219
219
struct pkg_checksum_entry * entries = NULL ;
220
220
struct pkg_option * option = NULL ;
221
221
struct pkg_dep * dep = NULL ;
222
+ struct pkg_file * f = NULL ;
222
223
int i ;
223
224
224
225
if (pkg == NULL || type >= PKG_HASH_TYPE_UNKNOWN ||
@@ -286,6 +287,10 @@ pkg_checksum_generate(struct pkg *pkg, char *dest, size_t destlen,
286
287
}
287
288
}
288
289
290
+ while (pkg_files (pkg , & f ) == EPKG_OK ) {
291
+ pkg_checksum_add_entry (f -> path , f -> sum , & entries );
292
+ }
293
+
289
294
/* Sort before hashing */
290
295
DL_SORT (entries , pkg_checksum_entry_cmp );
291
296
@@ -619,7 +624,7 @@ pkg_checksum_type_size(pkg_checksum_type_t type)
619
624
620
625
int
621
626
pkg_checksum_calculate (struct pkg * pkg , struct pkgdb * db , bool inc_scripts ,
622
- bool inc_version )
627
+ bool inc_version , bool inc_files )
623
628
{
624
629
char * new_digest ;
625
630
struct pkg_repo * repo ;
@@ -640,7 +645,7 @@ pkg_checksum_calculate(struct pkg *pkg, struct pkgdb *db, bool inc_scripts,
640
645
641
646
new_digest = xmalloc (pkg_checksum_type_size (type ));
642
647
if (pkg_checksum_generate (pkg , new_digest , pkg_checksum_type_size (type ),
643
- type , inc_scripts , inc_version )
648
+ type , inc_scripts , inc_version , inc_files )
644
649
!= EPKG_OK ) {
645
650
free (new_digest );
646
651
return (EPKG_FATAL );
0 commit comments