mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
makepkg: Integrate check_install into tidy_install
Rearrange tidy_install so we first remove docs, unwanted files, libtool files, and empty directories. Then check for missing backup files and references to $srcdir and $pkgdir. Finally compress manpages, strip debug symbols, and compress executables with upx. Fixes FS33318 Signed-off-by: Chirantan Ekbote <chirantan.ekbote@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
27067b1372
commit
266b3dd706
@ -1497,6 +1497,32 @@ tidy_install() {
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if check_option "libtool" "n"; then
|
||||||
|
msg2 "$(gettext "Removing "%s" files...")" "libtool"
|
||||||
|
find . ! -type d -name "*.la" -exec rm -f -- '{}' \;
|
||||||
|
fi
|
||||||
|
|
||||||
|
if check_option "emptydirs" "n"; then
|
||||||
|
msg2 "$(gettext "Removing empty directories...")"
|
||||||
|
find . -depth -type d -exec rmdir '{}' + 2>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
|
# check existence of backup files
|
||||||
|
local file
|
||||||
|
for file in "${backup[@]}"; do
|
||||||
|
if [[ ! -f $file ]]; then
|
||||||
|
warning "$(gettext "%s entry file not in package : %s")" "backup" "$file"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# check for references to the build and package directory
|
||||||
|
if find "${pkgdir}" -type f -print0 | xargs -0 grep -q -I "${srcdir}" ; then
|
||||||
|
warning "$(gettext "Package contains reference to %s")" "\$srcdir"
|
||||||
|
fi
|
||||||
|
if find "${pkgdir}" -type f -print0 | xargs -0 grep -q -I "${pkgdir}" ; then
|
||||||
|
warning "$(gettext "Package contains reference to %s")" "\$pkgdir"
|
||||||
|
fi
|
||||||
|
|
||||||
if check_option "zipman" "y" && [[ -n ${MAN_DIRS[*]} ]]; then
|
if check_option "zipman" "y" && [[ -n ${MAN_DIRS[*]} ]]; then
|
||||||
msg2 "$(gettext "Compressing man and info pages...")"
|
msg2 "$(gettext "Compressing man and info pages...")"
|
||||||
local file files inode link
|
local file files inode link
|
||||||
@ -1552,16 +1578,6 @@ tidy_install() {
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if check_option "libtool" "n"; then
|
|
||||||
msg2 "$(gettext "Removing "%s" files...")" "libtool"
|
|
||||||
find . ! -type d -name "*.la" -exec rm -f -- '{}' \;
|
|
||||||
fi
|
|
||||||
|
|
||||||
if check_option "emptydirs" "n"; then
|
|
||||||
msg2 "$(gettext "Removing empty directories...")"
|
|
||||||
find . -depth -type d -exec rmdir '{}' + 2>/dev/null
|
|
||||||
fi
|
|
||||||
|
|
||||||
if check_option "upx" "y"; then
|
if check_option "upx" "y"; then
|
||||||
msg2 "$(gettext "Compressing binaries with %s...")" "UPX"
|
msg2 "$(gettext "Compressing binaries with %s...")" "UPX"
|
||||||
local binary
|
local binary
|
||||||
@ -1753,27 +1769,6 @@ write_pkginfo() {
|
|||||||
check_license
|
check_license
|
||||||
}
|
}
|
||||||
|
|
||||||
check_package() {
|
|
||||||
cd_safe "$pkgdir"
|
|
||||||
|
|
||||||
# check existence of backup files
|
|
||||||
local file
|
|
||||||
for file in "${backup[@]}"; do
|
|
||||||
if [[ ! -f $file ]]; then
|
|
||||||
warning "$(gettext "%s entry file not in package : %s")" "backup" "$file"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# check for references to the build and package directory
|
|
||||||
if find "${pkgdir}" -type f -print0 | xargs -0 grep -q -I "${srcdir}" ; then
|
|
||||||
warning "$(gettext "Package contains reference to %s")" "\$srcdir"
|
|
||||||
fi
|
|
||||||
if find "${pkgdir}" -type f -print0 | xargs -0 grep -q -I "${pkgdir}" ; then
|
|
||||||
warning "$(gettext "Package contains reference to %s")" "\$pkgdir"
|
|
||||||
fi
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
create_package() {
|
create_package() {
|
||||||
if [[ ! -d $pkgdir ]]; then
|
if [[ ! -d $pkgdir ]]; then
|
||||||
error "$(gettext "Missing %s directory.")" "pkg/"
|
error "$(gettext "Missing %s directory.")" "pkg/"
|
||||||
@ -1781,8 +1776,6 @@ create_package() {
|
|||||||
exit 1 # $E_MISSING_PKGDIR
|
exit 1 # $E_MISSING_PKGDIR
|
||||||
fi
|
fi
|
||||||
|
|
||||||
check_package
|
|
||||||
|
|
||||||
cd_safe "$pkgdir"
|
cd_safe "$pkgdir"
|
||||||
msg "$(gettext "Creating package \"%s\"...")" "$pkgname"
|
msg "$(gettext "Creating package \"%s\"...")" "$pkgname"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user