mirror of
https://github.com/moparisthebest/pacman
synced 2025-01-10 21:38:19 -05:00
makepkg: use single redirection when writing PKGINFO
Instead of specifying the output file on every echo, leave it to the caller of write_pkginfo to specify the target. Signed-off-by: Andres P <aepd87@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
f258ffab25
commit
0e96532096
@ -902,56 +902,56 @@ write_pkginfo() {
|
|||||||
size="$(( ${size%%[^0-9]*} * 1024 ))"
|
size="$(( ${size%%[^0-9]*} * 1024 ))"
|
||||||
|
|
||||||
msg2 "$(gettext "Generating .PKGINFO file...")"
|
msg2 "$(gettext "Generating .PKGINFO file...")"
|
||||||
echo "# Generated by makepkg $myver" >.PKGINFO
|
echo "# Generated by makepkg $myver"
|
||||||
if (( INFAKEROOT )); then
|
if (( INFAKEROOT )); then
|
||||||
echo "# using $(fakeroot -v)" >>.PKGINFO
|
echo "# using $(fakeroot -v)"
|
||||||
fi
|
fi
|
||||||
echo "# $(LC_ALL=C date -u)" >>.PKGINFO
|
echo "# $(LC_ALL=C date -u)"
|
||||||
echo "pkgname = $1" >>.PKGINFO
|
echo "pkgname = $1"
|
||||||
(( SPLITPKG )) && echo pkgbase = $pkgbase >>.PKGINFO
|
(( SPLITPKG )) && echo pkgbase = $pkgbase
|
||||||
echo "pkgver = $pkgver-$pkgrel" >>.PKGINFO
|
echo "pkgver = $pkgver-$pkgrel"
|
||||||
echo "pkgdesc = $pkgdesc" >>.PKGINFO
|
echo "pkgdesc = $pkgdesc"
|
||||||
echo "url = $url" >>.PKGINFO
|
echo "url = $url"
|
||||||
echo "builddate = $builddate" >>.PKGINFO
|
echo "builddate = $builddate"
|
||||||
echo "packager = $packager" >>.PKGINFO
|
echo "packager = $packager"
|
||||||
echo "size = $size" >>.PKGINFO
|
echo "size = $size"
|
||||||
echo "arch = $PKGARCH" >>.PKGINFO
|
echo "arch = $PKGARCH"
|
||||||
if [[ $(check_option force) = "y" ]]; then
|
if [[ $(check_option force) = "y" ]]; then
|
||||||
echo "force = true" >> .PKGINFO
|
echo "force = true"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local it
|
local it
|
||||||
for it in "${license[@]}"; do
|
for it in "${license[@]}"; do
|
||||||
echo "license = $it" >>.PKGINFO
|
echo "license = $it"
|
||||||
done
|
done
|
||||||
for it in "${replaces[@]}"; do
|
for it in "${replaces[@]}"; do
|
||||||
echo "replaces = $it" >>.PKGINFO
|
echo "replaces = $it"
|
||||||
done
|
done
|
||||||
for it in "${groups[@]}"; do
|
for it in "${groups[@]}"; do
|
||||||
echo "group = $it" >>.PKGINFO
|
echo "group = $it"
|
||||||
done
|
done
|
||||||
for it in "${depends[@]}"; do
|
for it in "${depends[@]}"; do
|
||||||
echo "depend = $it" >>.PKGINFO
|
echo "depend = $it"
|
||||||
done
|
done
|
||||||
for it in "${optdepends[@]}"; do
|
for it in "${optdepends[@]}"; do
|
||||||
echo "optdepend = $it" >>.PKGINFO
|
echo "optdepend = $it"
|
||||||
done
|
done
|
||||||
for it in "${conflicts[@]}"; do
|
for it in "${conflicts[@]}"; do
|
||||||
echo "conflict = $it" >>.PKGINFO
|
echo "conflict = $it"
|
||||||
done
|
done
|
||||||
for it in "${provides[@]}"; do
|
for it in "${provides[@]}"; do
|
||||||
echo "provides = $it" >>.PKGINFO
|
echo "provides = $it"
|
||||||
done
|
done
|
||||||
for it in "${backup[@]}"; do
|
for it in "${backup[@]}"; do
|
||||||
echo "backup = $it" >>.PKGINFO
|
echo "backup = $it"
|
||||||
done
|
done
|
||||||
for it in "${packaging_options[@]}"; do
|
for it in "${packaging_options[@]}"; do
|
||||||
local ret="$(check_option $it)"
|
local ret="$(check_option $it)"
|
||||||
if [[ $ret != "?" ]]; then
|
if [[ $ret != "?" ]]; then
|
||||||
if [[ $ret = y ]]; then
|
if [[ $ret = y ]]; then
|
||||||
echo "makepkgopt = $it" >>.PKGINFO
|
echo "makepkgopt = $it"
|
||||||
else
|
else
|
||||||
echo "makepkgopt = !$it" >>.PKGINFO
|
echo "makepkgopt = !$it"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@ -1005,7 +1005,7 @@ create_package() {
|
|||||||
PKGARCH=$CARCH
|
PKGARCH=$CARCH
|
||||||
fi
|
fi
|
||||||
|
|
||||||
write_pkginfo $nameofpkg
|
write_pkginfo $nameofpkg > .PKGINFO
|
||||||
|
|
||||||
local comp_files=".PKGINFO"
|
local comp_files=".PKGINFO"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user