On 07/05/2011 08:12 PM, Scott Schaefer wrote:
On 07/05/2011 05:49 AM, Holger Levsen wrote:
Hi Scott,

On Montag, 4. Juli 2011, Scott Schaefer wrote:
awesome than you already are, you could include debian/changelog entries
in your patches too :-)
Um ... OK.  I will have to learn how to do that.  I will add to my
"Learn About ..." list :-)
sudo apt-get install devscripts
man dch
dch

:-)

Ah ... That will get us into long discussion about host of topics concerning development workflows, packaging/release workflows, patch approvals, testing, policies, reposibilities, etc., etc. For now, I would like to continue to rely on you to update the changelog.


it also seems to contain unwanted noise about force-confdef :/
I didn't see that in my (limited) testing.  I will re-test (after mod
described below) and look specifically for anything about confdef.  In
meantime, do you recall precisely what it reports ?
You misunderstood me: it's in the patch you posted, not in the output of the
code running...

Hm ......

This is against svn r907 ...

$ svn log|head
------------------------------------------------------------------------
r907 | holger | 2011-06-27 03:17:41 -0400 (Mon, 27 Jun 2011) | 1 line

piuparts-report.py: correct a typo from the patch for #523950.
------------------------------------------------------------------------


And piuparts.py:

$ cksum piuparts.py
1279739423 86368 piuparts.py

Applies with fuzz, since patch is against version with "dpkg_divert.patch" already applied
$ patch -p1 < .hg/patches/apt_proxy.patch
patching file piuparts.py
Hunk #1 succeeded at 677 (offset -5 lines).


Applies cleanly with "dpkg_divert.patch" popped

$ hg qpop
popping apt_proxy.patch
$ patch -p1 < .hg/patches/apt_proxy.patch
patching file piuparts.py

I have run result with both HTTP_PROXY set and unset, with both --dpkg-force-confdef and without.

I will test against the piuparts.conf I have from piatti for master/slave testing.

Or perhaps I'll just get the revision for apt-config coded, and test the revised one :-)


I already found 'apt-config' (which addresses all three of my
"issues").  I have it on my list to execute it and pull any
Acquire::Proxy value from there if HTTP_PROXY is not in os.environ.  So
I'll send revised patch in next 3-4 days.
Cool!


cheers,
    Holger



_______________________________________________
Piuparts-devel mailing list
piuparts-de...@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/piuparts-devel


Revised patch attached.  Should apply cleanly against SVN r 907.

Uses env HTTP_PROXY in preference to apt_config value, if present.
diff --git a/piuparts.py b/piuparts.py
--- a/piuparts.py
+++ b/piuparts.py
@@ -677,14 +677,32 @@
 
     def create_apt_conf(self):
         """Create /etc/apt/apt.conf inside the chroot."""
+        lines = [
+            'APT::Get::Assume-Yes "yes";\n',
+            'APT::Install-Recommends "0";\n',
+            'APT::Install-Suggests "0";\n',
+            ]
+        lines.append('APT::Get::AllowUnauthenticated "%s";\n' % settings.apt_unauthenticated) 
+        if "HTTP_PROXY" in os.environ:
+            proxy = os.environ["HTTP_PROXY"]
+        else:
+            proxy = None;
+            pat = re.compile(r"^Acquire::http::Proxy\s+\"([^\"]+)\"", re.I);
+            p = subprocess.Popen(["apt-config", "dump"], 
+                             stdout=subprocess.PIPE)
+            stdout, _ = p.communicate()
+            if stdout:
+                for line in stdout.split("\n"):
+                    m = re.match(pat, line)
+                    if proxy is None and m:
+                        proxy = m.group(1)
+        if proxy:
+            lines.append('Acquire::http::Proxy "%s";\n' % proxy)
+        if settings.dpkg_force_confdef:
+            lines.append('Dpkg::Options {"--force-confdef";};\n')
+
         create_file(self.relative("etc/apt/apt.conf"),
-                    'APT::Get::AllowUnauthenticated "%s";\n' % settings.apt_unauthenticated + 
-                    'APT::Get::Assume-Yes "yes";\n' +
-                    'APT::Install-Recommends "0";\n' +
-                    'APT::Install-Suggests "0";\n')
-        if settings.dpkg_force_confdef:
-          append_to_file(self.relative("etc/apt/apt.conf"),
-                         'Dpkg::Options {"--force-confdef";};\n')
+            "".join(lines))
 
     def create_dpkg_conf(self):
         """Create /etc/dpkg/dpkg.cfg.d/piuparts inside the chroot."""

Reply via email to