public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: lib/portage/sync/modules/git/, /
@ 2022-10-21  2:34 Sam James
  0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2022-10-21  2:34 UTC (permalink / raw
  To: gentoo-commits

commit:     f101272f139e1494dcef90554bbc24db5f66d401
Author:     Philipp Rösner <rndxelement <AT> protonmail <DOT> com>
AuthorDate: Tue Oct 18 20:40:03 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Oct 20 23:36:19 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f101272f

sync: git: Fix sync printing local repo path

In the add_safe_directory method in the git sync module
the subprocess calling 'git config --get safe.directory <repo_location>'
prints the path to the local repo.
Directing the subprocess output to DEVNULL fixes the issue.

Bug: https://bugs.gentoo.org/875812
Signed-off-by: Philipp Rösner <rndxelement <AT> protonmail.com>
Closes: https://github.com/gentoo/portage/pull/924
Signed-off-by: Sam James <sam <AT> gentoo.org>

 NEWS                                | 2 ++
 lib/portage/sync/modules/git/git.py | 6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 3e2a5a2d6..39c94efac 100644
--- a/NEWS
+++ b/NEWS
@@ -36,6 +36,8 @@ Bug fixes:
 * emerge(1), make.conf(5), xpak(5): document BINPKG_FORMAT and the gpkg binary
   packate format further.
 
+* sync: git: Fix sync printing local repo path (bug #875812)
+
 portage-3.0.38.1 (2022-10-04)
 --------------
 

diff --git a/lib/portage/sync/modules/git/git.py b/lib/portage/sync/modules/git/git.py
index 31ce5febf..b4c470160 100644
--- a/lib/portage/sync/modules/git/git.py
+++ b/lib/portage/sync/modules/git/git.py
@@ -362,7 +362,8 @@ class GitSync(NewBase):
                 "--get",
                 "safe.directory",
                 f"^{location_escaped}$",
-            ]
+            ],
+            stdout=subprocess.DEVNULL,
         )
         if result.returncode == 1:
             result = subprocess.run(
@@ -373,6 +374,7 @@ class GitSync(NewBase):
                     "--add",
                     "safe.directory",
                     self.repo.location,
-                ]
+                ],
+                stdout=subprocess.DEVNULL,
             )
         return result.returncode == 0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/portage/sync/modules/git/, /
@ 2023-02-22  9:40 Sam James
  0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2023-02-22  9:40 UTC (permalink / raw
  To: gentoo-commits

commit:     f29cc2578b1c97164c1411b14a2dd8195b14ab1e
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 22 09:07:31 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Feb 22 09:40:08 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=f29cc257

sync: git: fix code comment regarding clobbering the repository

The logic the code comment stated was simply inverted, and so was the
NEWS item. The actual implementation is correct.

Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>
Closes: https://github.com/gentoo/portage/pull/992
Signed-off-by: Sam James <sam <AT> gentoo.org>

 NEWS                                | 10 ++++++++--
 lib/portage/sync/modules/git/git.py |  5 +++--
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index 9389d2c09..ac658c923 100644
--- a/NEWS
+++ b/NEWS
@@ -125,8 +125,14 @@ Breaking changes:
     to work.
 
   The default value of 'volatile' is determined as follows:
-  - If unset and the repository is under /var/db/repos and the repository
-    exists and it's owned by either 'portage' or 'root', set to yes.
+  - If the repository is under /var/db/repos or if it is owned by either
+    'portage' or 'root', then it defaults to 'no'. That is, portage
+    assumes full control over the repository, potentially performing
+    destructive changes to the repository.
+  - If the repository is not under /var/db/repos or owned by a different
+    user than 'portage' or 'root', then it defaults to 'yes'. That is,
+    portage assumes the repository is user owned and does *not* perform
+    any destructive changes.
 
 Features:
 * cnf: make.conf.example.loong: add for the loong arch (bug #884135).

diff --git a/lib/portage/sync/modules/git/git.py b/lib/portage/sync/modules/git/git.py
index bd31f0445..6551ef29d 100644
--- a/lib/portage/sync/modules/git/git.py
+++ b/lib/portage/sync/modules/git/git.py
@@ -194,13 +194,14 @@ class GitSync(NewBase):
         # 1. sync-type=git
         # 2.
         #   - volatile=no (explicitly set to no), OR
-        #   - volatile is unset AND the repository owner is neither root or portage
+        #   - volatile is unset AND the repository owner is either root or portage
         # 3. Portage is syncing the respository (rather than e.g. auto-sync=no
         # and never running 'emaint sync -r foo')
         #
         # Portage will not clobber if:
         # 1. volatile=yes (explicitly set in the config), OR
-        # 2. volatile is unset and the repository owner is root or portage.
+        # 2. volatile is unset and the repository owner is neither root nor
+        #    portage.
         #
         # 'volatile' refers to whether the repository is volatile and may
         # only be safely changed by Portage itself, i.e. whether Portage


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] proj/portage:master commit in: lib/portage/sync/modules/git/, /
@ 2023-08-19 15:42 Sam James
  0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2023-08-19 15:42 UTC (permalink / raw
  To: gentoo-commits

commit:     b7abeab6041247a0b5f9d750fb5c85e6f573f90c
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 19 15:38:22 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Aug 19 15:38:56 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b7abeab6

sync: git: don't log on OK signature with --quiet

No point in emitting a message if everything is fine when the user asks
for --quiet.

Bug: https://bugs.gentoo.org/673624
Signed-off-by: Sam James <sam <AT> gentoo.org>

 NEWS                                | 2 ++
 lib/portage/sync/modules/git/git.py | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 74b45f488d..11879d7c58 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,8 @@ Bug fixes:
 * sync (inc. emerge-webrsync): Handle https_proxy to help users who only have it set
   - the expectation is to have http_proxy set (bug #691434, bug #835927, bug #911629)
 
+* sync: git: respect --quiet more for PGP verification (bug #673624).
+
 * emerge-webrsync: Explicitly pass http_proxy or https_proxy into gemato
   via --proxy (bug #911629).
 

diff --git a/lib/portage/sync/modules/git/git.py b/lib/portage/sync/modules/git/git.py
index b73b07e32a..ead276a98d 100644
--- a/lib/portage/sync/modules/git/git.py
+++ b/lib/portage/sync/modules/git/git.py
@@ -418,6 +418,7 @@ class GitSync(NewBase):
 
         opts = self.options.get("emerge_config").opts
         debug = "--debug" in opts
+        quiet = self.settings.get("PORTAGE_QUIET") == "1"
 
         openpgp_env = self._get_openpgp_env(self.repo.sync_openpgp_key_path, debug)
 
@@ -459,7 +460,8 @@ class GitSync(NewBase):
                 return False
 
             if status == "G":  # good signature is good
-                out.einfo("Trusted signature found on top commit")
+                if not quiet:
+                    out.einfo("Trusted signature found on top commit")
                 return True
             if status == "U":  # untrusted
                 out.ewarn("Top commit signature is valid but not trusted")


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-19 15:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-21  2:34 [gentoo-commits] proj/portage:master commit in: lib/portage/sync/modules/git/, / Sam James
  -- strict thread matches above, loose matches on Subject: below --
2023-02-22  9:40 Sam James
2023-08-19 15:42 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox