@@ -684,32 +684,37 @@ function rp_installBin() {
684
684
function rp_createBin() {
685
685
printHeading " Creating binary archive for $md_desc "
686
686
687
- if [[ ! -d " $rootdir / $md_type / $md_id " ]]; then
688
- printMsgs " console" " No install directory $rootdir / $md_type / $md_id - no archive created"
687
+ if [[ ! -d " $md_inst " ]]; then
688
+ printMsgs " console" " No install directory $md_inst - no archive created"
689
689
return 1
690
690
fi
691
691
692
- if dirIsEmpty " $rootdir / $md_type / $md_id " ; then
693
- printMsgs " console" " Empty install directory $rootdir / $md_type / $md_id - no archive created"
692
+ if dirIsEmpty " $md_inst " ; then
693
+ printMsgs " console" " Empty install directory $md_inst - no archive created"
694
694
return 1
695
695
fi
696
696
697
697
local archive=" $md_id .tar.gz"
698
698
local dest=" $__tmpdir /archives/$__binary_path /$md_type "
699
699
mkdir -p " $dest "
700
700
rm -f " $dest /$archive " " $dest /$archive .asc"
701
+ local ret=1
701
702
if tar cvzf " $dest /$archive " -C " $rootdir /$md_type " " $md_id " ; then
702
703
if [[ -n " $__gpg_signing_key " ]]; then
703
704
if signFile " $dest /$archive " ; then
704
705
chown $user :$user " $dest /$archive " " $dest /$archive .asc"
705
- return 0
706
+ ret= 0
706
707
fi
707
708
else
708
- return 0
709
+ ret= 0
709
710
fi
710
711
fi
711
- rm -f " $dest /$archive "
712
- return 1
712
+ if [[ " $ret " -eq 0 ]]; then
713
+ cp " $md_inst /retropie.pkg" " $dest /$md_id .pkg"
714
+ else
715
+ rm -f " $dest /$archive "
716
+ fi
717
+ return " $ret "
713
718
}
714
719
715
720
function rp_hasModule() {
@@ -835,6 +840,12 @@ function rp_loadPackageInfo() {
835
840
local load=0
836
841
local pkg_file=" $( rp_getInstallPath $id ) /retropie.pkg"
837
842
843
+ local builder_pkg_file=" $__tmpdir /archives/$__binary_path /${__mod_info[$id/type]} /$id .pkg"
844
+ # fallback to using package info for built binaries so the binary builder code can update only changed modules
845
+ if [[ ! -f " $pkg_file " && -f " $builder_pkg_file " ]]; then
846
+ pkg_file=" $builder_pkg_file "
847
+ fi
848
+
838
849
# if the pkg file is available, we will load the data in the next loop
839
850
[[ -f " $pkg_file " ]] && load=1
840
851
0 commit comments