[Piuparts-commits] rev 108 - / trunk trunk/debian

Lars Wirzenius lars at alioth.debian.org
Thu Nov 8 20:54:59 UTC 2007


Author: lars
Date: 2007-11-08 20:54:58 +0000 (Thu, 08 Nov 2007)
New Revision: 108

Modified:
   /
   trunk/Makefile
   trunk/debian/changelog
   trunk/debian/control
   trunk/piuparts.py
Log:
Guess flavor of Debian using lsb_release.


Property changes on: 
___________________________________________________________________
Name: bzr:revision-info
   - timestamp: 2007-11-08 22:33:19.130000114 +0200
committer: Lars Wirzenius <liw at iki.fi>
properties: 
	branch-nick: piuparts.upstream

   + timestamp: 2007-11-08 22:54:11.888000011 +0200
committer: Lars Wirzenius <liw at iki.fi>
properties: 
	branch-nick: piuparts.upstream

Name: bzr:ancestry:v3-none
   - liw at iki.fi-20071105201927-x9hsrn0rzn1ojjwd
liw at iki.fi-20071105212614-utwqgghd1c996gg6
liw at iki.fi-20071108201837-pwscbj9iiwm8h41o

   + liw at iki.fi-20071105201927-x9hsrn0rzn1ojjwd
liw at iki.fi-20071105212614-utwqgghd1c996gg6
liw at iki.fi-20071108201837-pwscbj9iiwm8h41o
liw at iki.fi-20071108205138-rg1xn3b9hz36u1f8

Name: bzr:revision-id:v3-none
   - 104 liw at iki.fi-20071105202024-ahct8ts13awaqfku
105 liw at iki.fi-20071105212653-ttr3062izcfvnyj7
106 liw at iki.fi-20071105212929-y8o8937i99hqouad
107 liw at iki.fi-20071108202016-kb4x591yu6kxbt03
108 liw at iki.fi-20071108203319-yn2spqgvngjw0ydc

   + 104 liw at iki.fi-20071105202024-ahct8ts13awaqfku
105 liw at iki.fi-20071105212653-ttr3062izcfvnyj7
106 liw at iki.fi-20071105212929-y8o8937i99hqouad
107 liw at iki.fi-20071108202016-kb4x591yu6kxbt03
108 liw at iki.fi-20071108203319-yn2spqgvngjw0ydc
109 liw at iki.fi-20071108205411-ztzieylautujrbet


Modified: trunk/Makefile
===================================================================
--- trunk/Makefile	2007-11-08 20:35:03 UTC (rev 107)
+++ trunk/Makefile	2007-11-08 20:54:58 UTC (rev 108)
@@ -9,9 +9,7 @@
 etcdir = $(prefix)/etc
 version=${shell dpkg-parsechangelog | sed -n 's/^Version: *//p'}
 
-FLAVOR = debian
 
-
 # mirror = -m 'http://liw.iki.fi/debian main'
 ignore = -I fdmount -N
 
@@ -23,8 +21,7 @@
 install: all
 	install -d $(sbindir) 
 	echo $(version)
-	sed -e 's/__PIUPARTS_VERSION__/$(version)/g' \
-	    -e 's/__DEBIAN_FLAVOR__/$(FLAVOR)/g' piuparts.py > piuparts
+	sed -e 's/__PIUPARTS_VERSION__/$(version)/g' piuparts.py > piuparts
 	install piuparts $(sbindir)/piuparts
 
 	install -d $(man1dir) 

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2007-11-08 20:35:03 UTC (rev 107)
+++ trunk/debian/changelog	2007-11-08 20:54:58 UTC (rev 108)
@@ -15,6 +15,8 @@
     to set defaults at package building time.
   * piuparts.py: Report target of broken symlink correctly, instead of
     saying "True".
+  * piuparts.py: Use lsb-release to guess the Debian flavor.
+  * debian/control: Added dependency on lsb-release.
 
  -- Lars Wirzenius <liw at iki.fi>  Mon, 05 Nov 2007 23:19:35 +0200
 

Modified: trunk/debian/control
===================================================================
--- trunk/debian/control	2007-11-08 20:35:03 UTC (rev 107)
+++ trunk/debian/control	2007-11-08 20:54:58 UTC (rev 108)
@@ -11,7 +11,7 @@
 
 Package: piuparts
 Architecture: all
-Depends: apt, python (>> 2.3), debootstrap (>= 0.3.3), lsof
+Depends: apt, python (>> 2.3), debootstrap (>= 0.3.3), lsof, lsb-release
 Description: .deb package installation, upgrading, and removal testing tool
  piuparts tests that .deb packages (as used by Debian) handle
  installation, upgrading, and removal correctly. It does this by

Modified: trunk/piuparts.py
===================================================================
--- trunk/piuparts.py	2007-11-08 20:35:03 UTC (rev 107)
+++ trunk/piuparts.py	2007-11-08 20:54:58 UTC (rev 108)
@@ -31,7 +31,6 @@
 
 
 VERSION = "__PIUPARTS_VERSION__"
-FLAVOR = "__DEBIAN_FLAVOR__"
 
 
 import time
@@ -95,11 +94,15 @@
     """Instantiate the right defaults class."""
     
     def guess_flavor(self):
-        return FLAVOR
+        p = subprocess.Popen(["lsb_release", "-i", "-s"], 
+                             stdout=subprocess.PIPE)
+        stdout, stderr = p.communicate()
+        return stdout.strip().lower()
     
     def new_defaults(self):
         if not settings.defaults:
             settings.defaults = self.guess_flavor()
+            print "Guessed:", settings.defaults
         if settings.defaults.lower() == "debian":
             return DebianDefaults()
         if settings.defaults.lower() == "ubuntu":




More information about the Piuparts-commits mailing list