[gentoo-portage-dev] Support for per-repository per-attribute environmental variables

2014-12-08 Thread Arfrever Frehtes Taifersar Arahesis
I suggest to add support for per-repository per-attribute environmental 
variables in Portage.
These variables would be used when PORTAGE_REPOSITORIES is not set.

Example of setting of them by user and detection of them by Portage:

$ env \
> PORTAGE_REPOSITORY:gentoo:location=/var/db/repositories/gentoo-cvs \
> PORTAGE_REPOSITORY:gentoo:sync-type=cvs \
> PORTAGE_REPOSITORY:gentoo:sync-uri=:pserver:anonym...@anoncvs.gentoo.org:/var/cvsroot
>  \
> python -c 'import os, pprint; pprint.pprint([x for x in os.environ.items() if 
> x[0].startswith("PORTAGE_REPOSITORY:")])'
[('PORTAGE_REPOSITORY:gentoo:sync-type', 'cvs'),
 ('PORTAGE_REPOSITORY:gentoo:location', '/var/db/repositories/gentoo-cvs'),
 ('PORTAGE_REPOSITORY:gentoo:sync-uri',
  ':pserver:anonym...@anoncvs.gentoo.org:/var/cvsroot')]

A separator between components of names of these variables cannot be any 
character valid in names of repositories.

--
Arfrever Frehtes Taifersar Arahesis


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-portage-dev] [PATCH] Sort PORTAGE_ARCHLIST

2014-12-08 Thread Brian Dolbec
On Mon, 8 Dec 2014 20:16:20 +0100
Arfrever Frehtes Taifersar Arahesis  wrote:

> Currently PORTAGE_ARCHLIST has random value:
> $ bin/portageq envvar PORTAGE_ARCHLIST
> x64-macos x86-linux amd64-fbsd ppc x86 x86-macos x86-winnt hppa alpha
> sparc64-solaris x86-freebsd ppc-openbsd x86-solaris s390 m68k mips
> ppc64-linux ia64-linux x64-openbsd amd64-linux x86-cygwin amd64
> sparc64-freebsd ppc64 ia64-hpux sparc-solaris ia64 ppc-macos
> x86-interix x86-openbsd arm arm64 hppa-hpux arm-linux sparc
> x64-solaris m68k-mint sh x86-netbsd sparc-fbsd ppc-aix x86-fbsd
> x64-freebsd $ bin/portageq envvar PORTAGE_ARCHLIST arm-linux
> sparc64-solaris x86-openbsd ppc64-linux ppc-macos x64-macos
> sparc-solaris ppc mips hppa-hpux ppc-aix x86-linux sparc x86-macos
> x86 ia64-hpux x86-fbsd arm64 x64-freebsd ppc64 amd64 x86-winnt alpha
> x86-freebsd sh x86-solaris sparc64-freebsd m68k amd64-fbsd s390
> x64-openbsd ia64 x86-netbsd amd64-linux ppc-openbsd arm x86-interix
> ia64-linux x64-solaris sparc-fbsd hppa m68k-mint x86-cygwin $
> bin/portageq envvar PORTAGE_ARCHLIST x86-netbsd x86-solaris x86-winnt
> x64-solaris amd64 x86-fbsd x86-interix m68k-mint x64-macos arm64 hppa
> x86-freebsd amd64-fbsd m68k x86-openbsd ppc sparc x64-freebsd ppc-aix
> ia64 x86 sparc-solaris x86-macos arm ppc-openbsd alpha sh mips ppc64
> sparc64-solaris sparc-fbsd ppc64-linux ia64-linux sparc64-freebsd
> arm-linux hppa-hpux amd64-linux s390 x64-openbsd ia64-hpux x86-linux
> x86-cygwin ppc-macos $ bin/portageq envvar PORTAGE_ARCHLIST
> sparc64-solaris arm-linux x86-openbsd x86-macos ia64-linux x86-fbsd
> ppc64-linux hppa amd64 x64-macos ia64-hpux hppa-hpux ia64
> sparc-solaris sparc-fbsd amd64-fbsd alpha mips x86-cygwin x86-interix
> ppc64 amd64-linux x86-freebsd m68k s390 ppc-openbsd x64-freebsd
> ppc-macos sparc64-freebsd arm ppc-aix x86-netbsd x86-solaris
> x64-openbsd x86-winnt sparc x86-linux m68k-mint x64-solaris sh x86
> ppc arm64
> 
> I suggest to make it predictable.
> 
> [[[
> Sort PORTAGE_ARCHLIST.
> ]]]
> 
> --
> Arfrever Frehtes Taifersar Arahesis

ok to merge

-- 
Brian Dolbec 



signature.asc
Description: PGP signature


Re: [gentoo-portage-dev] [PATCH] emerge --info: Modernize output of configuration of repositories

2014-12-08 Thread Brian Dolbec
On Mon, 8 Dec 2014 20:04:11 +0100
Arfrever Frehtes Taifersar Arahesis  wrote:

> [[[
> emerge --info: Modernize output of configuration of repositories.
> 
> - Always print detailed configuration of repositories.
> - Always skip PORTAGE_REPOSITORIES variable.
> - Always skip deprecated PORTDIR, PORTDIR_OVERLAY and SYNC variables.
> ]]]
> 
> --
> Arfrever Frehtes Taifersar Arahesis


@team, I want everyone to weigh in on this one before it is merged.
-- 
Brian Dolbec 



signature.asc
Description: PGP signature


Re: [gentoo-portage-dev] [PATCH] Almost always print ::repository

2014-12-08 Thread Brian Dolbec
On Mon, 8 Dec 2014 20:46:21 +0100
Arfrever Frehtes Taifersar Arahesis  wrote:

> +++ pym/_emerge/main.py
> @@ -50,6 +50,7 @@
>  "--tree",
>  "--unordered-display",
>  "--update",
> +# Option does nowt, but temporarily kept for backward compatibility.
>  "--verbose-main-repo-display",
>  ]


+++ pym/_emerge/main.py
@@ -50,6 +50,7 @@
 "--tree",
 "--unordered-display",
 "--update",
+# Option does nowt, but temporarily kept for backward compatibility.

^^^  what the hell is that, another olde English word ;)


 "--verbose-main-repo-display",
 ]


-- 
Brian Dolbec 



signature.asc
Description: PGP signature


[gentoo-portage-dev] [PATCH] Almost always print ::repository

2014-12-08 Thread Arfrever Frehtes Taifersar Arahesis
[[[
Almost always print ::repository in list of packages for installation.

--verbose-main-repo-display option is now ignored.
3 calls to deprecated portage.repository.config.RepoConfigLoader.mainRepo() 
function
have been deleted.
]]]

--
Arfrever Frehtes Taifersar Arahesis
--- man/emerge.1
+++ man/emerge.1
@@ -897,9 +897,6 @@
 Make slot conflicts more verbose. Note that this may in some cases output
 hundreds of packages for slot conflicts.
 .TP
-.BR "\-\-verbose\-main\-repo\-display"
-In the package merge list display, print ::repository even for main repository.
-.TP
 .BR "\-\-verbose\-slot\-rebuilds [ y | n ]"
 Turns on/off the extra emerge output to list which packages are causing rebuilds.
 The default is set to "y" (on).
--- pym/_emerge/depgraph.py
+++ pym/_emerge/depgraph.py
@@ -4293,14 +4293,9 @@
 		child = None
 		all_parents = self._dynamic_config._parent_atoms
 		graph = self._dynamic_config.digraph
-		verbose_main_repo_display = "--verbose-main-repo-display" in \
-			self._frozen_config.myopts
 
 		def format_pkg(pkg):
-			pkg_name = "%s" % (pkg.cpv,)
-			if verbose_main_repo_display or pkg.repo != \
-pkg.root_config.settings.repositories.mainRepo().name:
-pkg_name += _repo_separator + pkg.repo
+			pkg_name = "%s%s%s" % (pkg.cpv, _repo_separator, pkg.repo)
 			return pkg_name
 
 		if target_atom is not None and isinstance(node, Package):
--- pym/_emerge/main.py
+++ pym/_emerge/main.py
@@ -50,6 +50,7 @@
 "--tree",
 "--unordered-display",
 "--update",
+# Option does nowt, but temporarily kept for backward compatibility.
 "--verbose-main-repo-display",
 ]
 
--- pym/_emerge/resolver/output.py
+++ pym/_emerge/resolver/output.py
@@ -387,9 +387,7 @@
 		if old_pkg.slot != old_pkg.sub_slot or \
 			old_pkg.slot == pkg.slot and old_pkg.sub_slot != pkg.sub_slot:
 			key += "/" + old_pkg.sub_slot
-	if not self.quiet_repo_display and (self.verbose_main_repo_display or
-		self.portdb.repositories.mainRepo() is None or
-		any(x.repo != self.portdb.repositories.mainRepo().name for x in myoldbest + [pkg])):
+	if not self.quiet_repo_display:
 		key += _repo_separator + old_pkg.repo
 versions.append(key)
 			myoldbest_str = blue("["+", ".join(versions)+"]")
@@ -422,9 +420,7 @@
 		@param pkg_info: dictionary
 		@rtype string
 		"""
-		if not self.quiet_repo_display and (self.verbose_main_repo_display or
-			self.portdb.repositories.mainRepo() is None or
-			any(x.repo != self.portdb.repositories.mainRepo().name for x in pkg_info.oldbest_list + [pkg])):
+		if not self.quiet_repo_display:
 			pkg_str += _repo_separator + pkg.repo
 		return pkg_str
 
@@ -819,7 +815,6 @@
 			# and disable the entire repo display in this case.
 			repoadd_set = set()
 
-		self.verbose_main_repo_display = "--verbose-main-repo-display" in depgraph._frozen_config.myopts
 		self.restrict_fetch_list = {}
 
 		for mylist_index in range(len(mylist)):


signature.asc
Description: This is a digitally signed message part.


[gentoo-portage-dev] [PATCH] Sort PORTAGE_ARCHLIST

2014-12-08 Thread Arfrever Frehtes Taifersar Arahesis
Currently PORTAGE_ARCHLIST has random value:
$ bin/portageq envvar PORTAGE_ARCHLIST
x64-macos x86-linux amd64-fbsd ppc x86 x86-macos x86-winnt hppa alpha 
sparc64-solaris x86-freebsd ppc-openbsd x86-solaris s390 m68k mips ppc64-linux 
ia64-linux x64-openbsd amd64-linux x86-cygwin amd64 sparc64-freebsd ppc64 
ia64-hpux sparc-solaris ia64 ppc-macos x86-interix x86-openbsd arm arm64 
hppa-hpux arm-linux sparc x64-solaris m68k-mint sh x86-netbsd sparc-fbsd 
ppc-aix x86-fbsd x64-freebsd
$ bin/portageq envvar PORTAGE_ARCHLIST
arm-linux sparc64-solaris x86-openbsd ppc64-linux ppc-macos x64-macos 
sparc-solaris ppc mips hppa-hpux ppc-aix x86-linux sparc x86-macos x86 
ia64-hpux x86-fbsd arm64 x64-freebsd ppc64 amd64 x86-winnt alpha x86-freebsd sh 
x86-solaris sparc64-freebsd m68k amd64-fbsd s390 x64-openbsd ia64 x86-netbsd 
amd64-linux ppc-openbsd arm x86-interix ia64-linux x64-solaris sparc-fbsd hppa 
m68k-mint x86-cygwin
$ bin/portageq envvar PORTAGE_ARCHLIST
x86-netbsd x86-solaris x86-winnt x64-solaris amd64 x86-fbsd x86-interix 
m68k-mint x64-macos arm64 hppa x86-freebsd amd64-fbsd m68k x86-openbsd ppc 
sparc x64-freebsd ppc-aix ia64 x86 sparc-solaris x86-macos arm ppc-openbsd 
alpha sh mips ppc64 sparc64-solaris sparc-fbsd ppc64-linux ia64-linux 
sparc64-freebsd arm-linux hppa-hpux amd64-linux s390 x64-openbsd ia64-hpux 
x86-linux x86-cygwin ppc-macos
$ bin/portageq envvar PORTAGE_ARCHLIST
sparc64-solaris arm-linux x86-openbsd x86-macos ia64-linux x86-fbsd ppc64-linux 
hppa amd64 x64-macos ia64-hpux hppa-hpux ia64 sparc-solaris sparc-fbsd 
amd64-fbsd alpha mips x86-cygwin x86-interix ppc64 amd64-linux x86-freebsd m68k 
s390 ppc-openbsd x64-freebsd ppc-macos sparc64-freebsd arm ppc-aix x86-netbsd 
x86-solaris x64-openbsd x86-winnt sparc x86-linux m68k-mint x64-solaris sh x86 
ppc arm64

I suggest to make it predictable.

[[[
Sort PORTAGE_ARCHLIST.
]]]

--
Arfrever Frehtes Taifersar Arahesis
--- pym/portage/package/ebuild/config.py
+++ pym/portage/package/ebuild/config.py
@@ -779,7 +779,7 @@
 
 			archlist = [grabfile(os.path.join(x, "arch.list")) \
 for x in locations_manager.profile_and_user_locations]
-			archlist = stack_lists(archlist, incremental=1)
+			archlist = sorted(stack_lists(archlist, incremental=1))
 			self.configdict["conf"]["PORTAGE_ARCHLIST"] = " ".join(archlist)
 
 			pkgprovidedlines = [grabfile(


signature.asc
Description: This is a digitally signed message part.


[gentoo-portage-dev] [PATCH] emerge --info: Modernize output of configuration of repositories

2014-12-08 Thread Arfrever Frehtes Taifersar Arahesis
[[[
emerge --info: Modernize output of configuration of repositories.

- Always print detailed configuration of repositories.
- Always skip PORTAGE_REPOSITORIES variable.
- Always skip deprecated PORTDIR, PORTDIR_OVERLAY and SYNC variables.
]]]

--
Arfrever Frehtes Taifersar Arahesis
--- pym/_emerge/actions.py
+++ pym/_emerge/actions.py
@@ -1707,13 +1707,9 @@
 			((cp + ":").ljust(cp_max_len + 1), versions))
 
 	repos = portdb.settings.repositories
-	if "--verbose" in myopts:
-		append("Repositories:\n")
-		for repo in repos:
-			append(repo.info_string())
-	else:
-		append("Repositories: %s" % \
-			" ".join(repo.name for repo in repos))
+	append("Repositories:\n")
+	for repo in repos:
+		append(repo.info_string())
 
 	installed_sets = sorted(s for s in
 		root_config.sets['selected'].getNonAtoms() if s.startswith(SETPREFIX))
@@ -1726,8 +1722,8 @@
 		myvars = list(settings)
 	else:
 		myvars = ['GENTOO_MIRRORS', 'CONFIG_PROTECT', 'CONFIG_PROTECT_MASK',
-		  'PORTDIR', 'DISTDIR', 'PKGDIR', 'PORTAGE_TMPDIR',
-		  'PORTDIR_OVERLAY', 'PORTAGE_BUNZIP2_COMMAND',
+		  'DISTDIR', 'PKGDIR', 'PORTAGE_TMPDIR',
+		  'PORTAGE_BUNZIP2_COMMAND',
 		  'PORTAGE_BZIP2_COMMAND',
 		  'USE', 'CHOST', 'CFLAGS', 'CXXFLAGS',
 		  'ACCEPT_KEYWORDS', 'ACCEPT_LICENSE', 'FEATURES',
@@ -1735,6 +1731,16 @@
 
 		myvars.extend(portage.util.grabfile(settings["PORTDIR"]+"/profiles/info_vars"))
 
+	skipped_vars = ['PORTAGE_REPOSITORIES', '_']
+	# Deprecated variables
+	skipped_vars.extend(('PORTDIR', 'PORTDIR_OVERLAY', 'SYNC'))
+
+	for skipped_var in skipped_vars:
+		try:
+			myvars.remove(skipped_var)
+		except ValueError:
+			pass
+
 	myvars_ignore_defaults = {
 		'PORTAGE_BZIP2_COMMAND' : 'bzip2',
 	}


signature.asc
Description: This is a digitally signed message part.


Re: [gentoo-alt] Re: [gentoo-portage-dev] [PATCH 1/2] bin/phase-helpers.shL Fix unpack() for deb2targz .xz types

2014-12-08 Thread Zac Medico
On 12/08/2014 12:45 AM, Ulrich Mueller wrote:
>> On Sun, 07 Dec 2014, Zac Medico wrote:
> 
>> On 12/07/2014 07:06 PM, Christoph Junghans wrote:
>>> I know, I am late to the party, I just wanted to say that in
>>> unpacker.eclass I implemented a variant which uses neither deb2tags
>>> nor ar on prefix, but just bash's read and head.
> 
> The code uses "head -c" which is a GNU extension:
> 
>$ man 1p head
>HEAD(1P)POSIX Programmer's ManualHEAD(1P)
>[...]
>SYNOPSIS
>   head [−n number] [file...]
>[...]
> 
> For example, on OpenBSD and HPUX there is no -c option, or it is used
> differently. Also Busybox doesn't have it.
> 
> Are we better off by requiring GNU head instead of GNU ar?

That's a good question. We might use dd instead of head, or port the
shell code to python.

>> Very nice. We should borrow that code and use it to eliminate the
>> need for deb2targz in portage.
> 
> In PMS, this would have to go into EAPI 6, I suppose?

Yes, I suppose so, since PMS currently says deb2targz is required when
ar is not compatible with GNU ar. However, earlier you said that other
package managers currently use ar unconditionally. Also, I have to
wonder if any of the other package managers are used on AIX. So, maybe a
retroactive change to PMS would be acceptable?

Maybe it's not worth the trouble, and we should simply keep the
deb2targz usage for AIX.
-- 
Thanks,
Zac



Re: [gentoo-alt] Re: [gentoo-portage-dev] [PATCH 1/2] bin/phase-helpers.shL Fix unpack() for deb2targz .xz types

2014-12-08 Thread Michał Górny
Dnia 2014-12-07, o godz. 19:50:24
Zac Medico  napisał(a):

> On 12/07/2014 07:06 PM, Christoph Junghans wrote:
> > I know, I am late to the party, I just wanted to say that in
> > unpacker.eclass I implemented a variant which uses neither deb2tags
> > nor ar on prefix, but just bash's read and head.
> 
> Very nice. We should borrow that code and use it to eliminate the need
> for deb2targz in portage.

You shouldn't borrow code written by vapier. Ever. We have enough work
on our shoulders having to fix it in one location.

-- 
Best regards,
Michał Górny


pgpFIoLYEHMy3.pgp
Description: OpenPGP digital signature


Re: [gentoo-alt] Re: [gentoo-portage-dev] [PATCH 1/2] bin/phase-helpers.shL Fix unpack() for deb2targz .xz types

2014-12-08 Thread Ulrich Mueller
> On Sun, 07 Dec 2014, Zac Medico wrote:

> On 12/07/2014 07:06 PM, Christoph Junghans wrote:
>> I know, I am late to the party, I just wanted to say that in
>> unpacker.eclass I implemented a variant which uses neither deb2tags
>> nor ar on prefix, but just bash's read and head.

The code uses "head -c" which is a GNU extension:

   $ man 1p head
   HEAD(1P)POSIX Programmer's ManualHEAD(1P)
   [...]
   SYNOPSIS
  head [−n number] [file...]
   [...]

For example, on OpenBSD and HPUX there is no -c option, or it is used
differently. Also Busybox doesn't have it.

Are we better off by requiring GNU head instead of GNU ar?

> Very nice. We should borrow that code and use it to eliminate the
> need for deb2targz in portage.

In PMS, this would have to go into EAPI 6, I suppose?

Ulrich


pgpfesq0ME4CD.pgp
Description: PGP signature


Re: [gentoo-portage-dev] [PATCH] man/emerge.1: --quiet-build=n overridden by --jobs (505116)

2014-12-08 Thread Alexander Berntsen
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Fine. Go ahead & merge. FFR, I just require that a patch is reviewed
by a team member. There's no "at least two team members must look at a
patch" rule that I'm aware of.

- -- 
Alexander
berna...@gentoo.org
https://secure.plaimi.net/~alexander
-BEGIN PGP SIGNATURE-
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iF4EAREIAAYFAlSFY1oACgkQRtClrXBQc7W5JQEApqm/66QrsJiVY/qfEFE4OwQa
EJFHiBp0krUoA57V4nUA/3lvrROGNWR2r05bAfoSJSDjp7S4qOcUSqbS5fJ6lVDp
=k7/6
-END PGP SIGNATURE-