[pacman-dev] [PATCH v3 2/2] Add makepkg option --packagelist; fix bug #42150

Andrew Gregory andrew.gregory.8 at gmail.com
Wed Mar 25 21:11:07 UTC 2015


On 03/25/15 at 03:09pm, Allan McRae wrote:
> On 21/03/15 10:19, joyfulgirl at archlinux.us wrote:
> > From: Ivy Foster <joyfulgirl at archlinux.us>
> > 
> > makepkg --packagelist prints the name of each package that would
> > normally be produced, minus $PKGEXT, and exits.
> > 
> > Signed-off-by: Ivy Foster <joyfulgirl at archlinux.us>
> > ---
> 
> Delete the bug number from the subject line, it can be added as a note
> to the commit message.
> 
> 
> I have added some changes below.  This allows two things
> 1) we can run --packagelist on any PKGBUILD no matter the architecture
> we are running and the architecture required to build the PKGBUILD
> 2) it lists all package products - so both foo-1-1-i686 and
> foo-1-1-x86_64.  It is easy to filter the unwanted ones away.
> 
> I have made the changes on my patchqueue branch.  Let me know if you
> approve and I can push the patch.
> https://projects.archlinux.org/users/allan/pacman.git/log/?h=patchqueue
> 
> Thanks,
> Allan
> 
> 
> > v3: Separate change to get_pkg_arch into another commit
> >  doc/makepkg.8.txt     |  3 +++
> >  scripts/makepkg.sh.in | 26 +++++++++++++++++++++++---
> >  2 files changed, 26 insertions(+), 3 deletions(-)

<snip>

> > diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> > index 5b3bffd..3c2e381 100755
> > --- a/scripts/makepkg.sh.in
> > +++ b/scripts/makepkg.sh.in
> > @@ -2834,6 +2834,19 @@ run_split_packaging() {
> >  	pkgname=${pkgname_backup[@]}
> >  }
> >  
> > +print_all_package_names() {
> > +	local version=$(get_full_version)
> > +	local architecture pkg opts 
> 
> local architecture pkg opts a
> 
> > +	for pkg in ${pkgname[@]}; do
> > +		architecture=$(get_pkg_arch $pkg)
> 
> pkgbuild_get_attribute "$pkg" 'arch' 1 architectures
> 
> > +		pkgbuild_get_attribute "$pkg" 'options' 1 opts
> 
> for a in ${architectures[@]}; do
> 
> > +		printf "%s-%s-%s\n" "$pkg" "$version" "$architecture"
> > +		if in_opt_array "debug" ${opts[@]} && in_opt_array "strip" ${opts[@]}; then
> > +			printf "%s-%s-%s-%s\n" "$pkg" "@DEBUGSUFFIX@" "$pkgver" "$architecture"

s/pkgver/version/ s/architecture/a/


More information about the pacman-dev mailing list