[pacman-dev] [PATCH 2/2] Drop vestiges of SIZECMD

2018-09-20 Thread Dave Reisner
SIZECMD was replaced in 1af766987f with a POSIX solution, and this token
is no longer used/needed.
---
 scripts/Makefile.am | 1 -
 1 file changed, 1 deletion(-)

diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index f83e16c0..462962e1 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -161,7 +161,6 @@ edit = sed \
-e "s|@INODECMD[@]|$(INODECMD)|g" \
-e "s|@OWNERCMD[@]|$(OWNERCMD)|g" \
-e "s|@MODECMD[@]|$(MODECMD)|g" \
-   -e 's|@SIZECMD[@]|$(SIZECMD)|g' \
-e 's|@SEDINPLACEFLAGS[@]|$(SEDINPLACEFLAGS)|g' \
-e 's|@SEDPATH[@]|$(SEDPATH)|g' \
-e 's|@DUFLAGS[@]|$(DUFLAGS)|g' \
-- 
2.19.0


[pacman-dev] [PATCH 1/2] Port pactest to python3

2018-09-20 Thread Dave Reisner
Use BytesIO instead of StringIO, and ensure that we unicode-encode data
where needed.
---
 configure.ac   | 2 +-
 test/pacman/pactest.py | 2 +-
 test/pacman/pmdb.py| 5 +++--
 test/pacman/pmpkg.py   | 8 +---
 test/pacman/util.py| 2 +-
 5 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/configure.ac b/configure.ac
index a569ffeb..c369ca74 100644
--- a/configure.ac
+++ b/configure.ac
@@ -179,7 +179,7 @@ AC_SUBST(LFS_CFLAGS)
 AC_PROG_AWK
 AC_PROG_CC_C99
 AC_PROG_INSTALL
-AC_CHECK_PROGS([PYTHON], [python2.7 python2 python], [false])
+AC_CHECK_PROGS([PYTHON], [python3 python], [false])
 AC_PATH_PROGS([BASH_SHELL], [bash bash4], [false])
 
 # check for perl 5.10.1 (needed by makepkg-template)
diff --git a/test/pacman/pactest.py b/test/pacman/pactest.py
index 1f5b8483..628193ff 100755
--- a/test/pacman/pactest.py
+++ b/test/pacman/pactest.py
@@ -1,4 +1,4 @@
-#! /usr/bin/python2
+#! /usr/bin/python3
 #
 #  pactest : run automated testing on the pacman binary
 #
diff --git a/test/pacman/pmdb.py b/test/pacman/pmdb.py
index f7671987..26a8d9a4 100644
--- a/test/pacman/pmdb.py
+++ b/test/pacman/pmdb.py
@@ -17,9 +17,10 @@
 
 import os
 import shutil
-from StringIO import StringIO
 import tarfile
 
+from io import BytesIO
+
 import pmpkg
 import tap
 import util
@@ -251,7 +252,7 @@ def generate(self):
 filename = os.path.join(pkg.fullname(), name)
 info = tarfile.TarInfo(filename)
 info.size = len(data)
-tar.addfile(info, StringIO(data))
+tar.addfile(info, BytesIO(data.encode('utf8')))
 tar.close()
 # TODO: this is a bit unnecessary considering only one test uses it
 serverpath = os.path.join(self.root, util.SYNCREPO, self.treename)
diff --git a/test/pacman/pmpkg.py b/test/pacman/pmpkg.py
index 5a32ccd6..e42bd4d5 100644
--- a/test/pacman/pmpkg.py
+++ b/test/pacman/pmpkg.py
@@ -15,7 +15,9 @@
 #  along with this program.  If not, see .
 
 import os
-from StringIO import StringIO
+
+from io import BytesIO
+
 import tarfile
 
 import util
@@ -146,7 +148,7 @@ def makepkg(self, path):
 for name, data in archive_files:
 info = tarfile.TarInfo(name)
 info.size = len(data)
-tar.addfile(info, StringIO(data))
+tar.addfile(info, BytesIO(data.encode('utf8')))
 
 # Generate package file system
 for name in self.files:
@@ -167,7 +169,7 @@ def makepkg(self, path):
 # TODO wow what a hack, adding a newline to match mkfile?
 filedata = name + "\n"
 info.size = len(filedata)
-tar.addfile(info, StringIO(filedata))
+tar.addfile(info, BytesIO(filedata.encode('utf8')))
 
 tar.close()
 
diff --git a/test/pacman/util.py b/test/pacman/util.py
index 5fbe4c35..544bdd8d 100644
--- a/test/pacman/util.py
+++ b/test/pacman/util.py
@@ -152,7 +152,7 @@ def getmd5sum(filename):
 
 def mkmd5sum(data):
 checksum = hashlib.md5()
-checksum.update("%s\n" % data)
+checksum.update(("%s\n" % data).encode('utf8'))
 return checksum.hexdigest()
 
 
-- 
2.19.0


Re: [pacman-dev] [PATCH] makepkg: Pass --stream to `hg clone` when creating the working copy

2018-09-20 Thread Eli Schwartz
On 9/19/18 3:15 PM, Luke Shumaker wrote:
> On Sat, 08 Sep 2018 16:31:16 -0400,
> Luke Shumaker wrote:
>> From: Luke Shumaker 
>>
>> Without --stream, `hg clone` reencodes+recompresses the entire repository,
>> to the storage settings of the host.  But download_hg() already did that
>> on the initial network clone, and it is 100% pointless duplicated work for
>> the local clone.
>>
>> The work that this saves is CPU-bound (not disk-bound), and is restricted
>> to a single core.
> 
> After more testing, this didn't have the speed-up that I expected.
> Consider the patch withdrawn.

As a matter of curiosity, was this just "not much savings" or "not
actually saving"? What kind of practical effect does it have, ultimately?

...

I'm wondering if it's worth doing something similar elsewhere,
specifically for git clone --shared

It would save cp'ing possibly bloaty files from SRCDEST to BUILDDIR, in
the event that the two directories are on different partitions. Normally
git would optimize this away by creating hardlinks.

Downsides are:

- If SRCDEST is rm'ed then the BUILDDIR clone breaks -- but I consider
  that reasonable, plus if you re-clone to SRCDEST it magically works
  again...
- If the upstream source does a force push and SRCDEST prunes some
  commits in our ephemeral clone via git gc --auto, *and* users treat
  BUILDDIR as a place to commit changes they want to keep, they may
  get a broken repo and missing commits. Do we care about this? Worth
  noting is they will already have makepkg trying to force-reset the
  default "makepkg" branch.

-- 
Eli Schwartz
Bug Wrangler and Trusted User



signature.asc
Description: OpenPGP digital signature