]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Fix the Debian packaging script on systems with no codename
authorMarcin Mielniczuk <marmistrz.dev@gmail.com>
Tue, 12 Jul 2016 19:42:35 +0000 (21:42 +0200)
committerMichal Marek <mmarek@suse.com>
Tue, 26 Jul 2016 21:12:08 +0000 (23:12 +0200)
When calling `make deb-pkg` on a system with no codename (for example
Arch Linux), lsb_release sometimes outputs `n/a` as the codename.

This breaks dpkg-parsechangelog, which can't process the changelog
correctly.

Signed-off-by: Marcin Mielniczuk <marmistrz.dev@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.com>
scripts/package/builddeb

index 116ef00c0b8260b12652fa9c7d195cf0b0303bcd..510add6d050c76b6e87cde6ca63fc3191abbdf9d 100755 (executable)
@@ -240,7 +240,8 @@ maintainer="$name <$email>"
 # Try to determine distribution
 if [ -n "$KDEB_CHANGELOG_DIST" ]; then
         distribution=$KDEB_CHANGELOG_DIST
-elif distribution=$(lsb_release -cs 2>/dev/null) && [ -n "$distribution" ]; then
+# In some cases lsb_release returns the codename as n/a, which breaks dpkg-parsechangelog
+elif distribution=$(lsb_release -cs 2>/dev/null) && [ -n "$distribution" ] && [ "$distribution" != "n/a" ]; then
         : # nothing to do in this case
 else
         distribution="unstable"