~nacc/git-ubuntu:git-ubuntu-cleanups

Last commit made on 2017-06-28
Get this branch:
git clone -b git-ubuntu-cleanups https://git.launchpad.net/~nacc/git-ubuntu
Only Nish Aravamudan can upload to this branch. If you are Nish Aravamudan please log in for upload directions.

Branch merges

Branch information

Name:
git-ubuntu-cleanups
Repository:
lp:~nacc/git-ubuntu

Recent commits

0118ac0... by Nish Aravamudan

git ubuntu: emit newline after input() prompt

Otherwise, the line doesn't break and it's not clear where the user's input
starts.

a8127b0... by Nish Aravamudan

git ubuntu: quieten keyring logging

502dbb3... by Nish Aravamudan

gitubuntu/git_repository: correct search for string in file

We were calling open() on an file-like object, which was already open(). Also,
we need to seek to 0 in order to read in the entire file as written.

Fixes: 62550c080 ('GitUbuntuRepository: properly handle missing
debian/changelog')

38c1859... by Nish Aravamudan

gitubuntu/git_repository: open temporary file in same mode as named file

94d0f79... by Nish Aravamudan

git ubuntu import: leverage raise ... from ... syntax

This provides a bit of a cleaner stacktrace output on errors when we are
propogating/transforming exceptions. Per PEP 3134, this is present in
python 3.0+.

038533a... by Nish Aravamudan

git ubuntu import: remove unnecessary try/catch

We are just going to re-raise an exception in the catch, so don't even
bother try/catch'ing it.

Also clean up some style.

b7c23c6... by Nish Aravamudan

git ubuntu build: correct search for matching upstream version

The loop only makes sense if the publishing records are in version
order. That is not the case before this change, as they are in published
order and leads to false output (e.g., for sssd).

b9eea2c... by Robie Basak

Fix empty directory handling symlink traversal

Fix the recursion to recurse only down real directories, not symlinks.

A symlink to a directory that has under the target directory an empty
directory fails the assertion in _create_replacement_tree_builder
because the provided entry is not a tree (a symlink entry is a blob).
This is non-sensical; we don't want to follow symlinks while traversing
for empty directories anyway.

Nish discovered this when importing websockify 0.5.1+dfsg1-1.

I had assumed that os.path.isdir() would not match on symlinks to
directories, but it does. Instead, use os.lstat() to check st_mode
directly.

76cf83c... by Nish Aravamudan

git ubuntu build: handle building a new upstream version

We need two changes to correctly build:
 - do not attempt to find the orig tarball in Debian or Ubuntu
 - do not attempt to symlink the orig tarball, because we are not
   caching it from another upload

62550c0... by Nish Aravamudan

GitUbuntuRepository: properly handle missing debian/changelog

If debian/changelog does not exist (e.g., on an orphan branch), the
parsing function(s) incorrectly return 'HEAD:debian/changelog missing'
directly from `git cat-file`. Instead, check for this case of not
finding the debian/changelog file and raising a GitUbuntuChangelogError.