Fritzing: use clone --single-branch on parts db

This is what upstream uses in their packages, and reduces the .git
directory from ~140MB to ~24MB.
This commit is contained in:
Jeremy Drake
2020-12-06 14:36:35 -08:00
parent 9aa5703250
commit 323f6cb288

View File

@@ -66,11 +66,14 @@ package() {
install -Dm644 ${srcdir}/${_realname}/LICENSE.* ${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/
rm -rf "${pkgdir}${MINGW_PREFIX}/share/fritzing/parts"
cp -Rf "${srcdir}"/${_realname}-parts "${pkgdir}${MINGW_PREFIX}/share/fritzing/parts"
git clone --single-branch -b makepkg --no-local --dissociate "${srcdir}"/${_realname}-parts "${pkgdir}${MINGW_PREFIX}/share/fritzing/parts"
cd "${pkgdir}${MINGW_PREFIX}/share/fritzing/parts"
git remote set-url origin https://github.com/fritzing/fritzing-parts.git
git branch -M master
git repack -a -d
rm -f .git/objects/info/alternates
git remote set-branches origin master
git update-ref --no-deref refs/remotes/origin/master refs/remotes/origin/makepkg
git branch --set-upstream-to origin/master
git update-ref -d refs/remotes/origin/makepkg
git remote set-head origin master
git remote set-url origin https://github.com/fritzing/fritzing-parts.git
"${pkgdir}${MINGW_PREFIX}/bin/Fritzing" -db "${pkgdir}${MINGW_PREFIX}/share/fritzing/parts/parts.db" -pp "${pkgdir}${MINGW_PREFIX}/share/fritzing/parts" -f "${pkgdir}${MINGW_PREFIX}/share/fritzing"
}