Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dh_make call for Debian packaging #73

Merged
merged 1 commit into from
Jan 8, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion updater/packaging/debian/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ all: clean
cd $(BUILDDIR) && \
export DEBEMAIL=$(EMAIL) && \
export DEBFULLNAME=$(MAINTAINER) && \
python2 /usr/bin/dh_make -p $(PKGNAME)_$(PKGVERSION) -i --native -c mit -y && \
python /usr/bin/dh_make -p $(PKGNAME)_$(PKGVERSION) -i --native -c mit -y && \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would happen if I have the wrong Python version? Would it scream loud or error silently?

Copy link
Contributor Author

@pluehne pluehne Jan 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling dh_make with the wrong Python version results in errors.

dh_make 2.201701 (the new version) with Python 2 gives a module dependency error:

Traceback (most recent call last):
  File "/usr/bin/dh_make", line 16, in <module>
    from enum import Enum
ImportError: No module named enum

dh_make 2.201608 (the old version) with Python 3 even results in a syntax error:

  File "dh_make", line 715
    os.mkdir('source', 0755)
                          ^
SyntaxError: invalid token

So in both cases, we get an error.

Copy link
Contributor Author

@pluehne pluehne Jan 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, we should, perhaps, require dh_make to succeed for any of the later commands. In this way, make would get an error exit code and report the version mismatch more nicely.

Currently, the result would be a file not found error toward the end of the Makefile.

Copy link
Contributor Author

@pluehne pluehne Jan 8, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, I’d like to call dh_make without python and to rely on a proper shebang declaration. However, dh_make as of 2.201608 declares /usr/bin/python as its interpreter without specifying the required Python version explicitly. This is unfortunate, because now, we have to care about the correct version. However, dh_make 2.201701 has a proper interpreter directive (/usr/bin/python3).

dpkg-buildpackage -rfakeroot -d -us -uc
mkdir -p $(PKGDIR)
mv $(BUILDDIR)/../*.deb $(PKGDIR)/
Expand Down