Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

- Add timestamped release values (debuild will now warn, but at least we

  can differentiate)
- Permit patching by a lame PATCHES environ hack
- Use ed(1) to make a hacked setup.py that replaces 'setup' with a
  method that outputs name, version, etc.
  • Loading branch information...
commit 482e33aefe5f1ea6b22294ee843d693baa9a6cdb 1 parent c5999f4
Jordan Sissel authored

Showing 1 changed file with 17 additions and 10 deletions. Show diff stats Hide diff stats

  1. +17 10 python2deb.sh
27 python2deb.sh
@@ -7,9 +7,10 @@ if [ "$1" = "-h" ] ; then
7 7 exit 0
8 8 fi
9 9
  10 +# debuild requires package names be lowercase.
10 11 if [ "0$#" -ne 0 ] ; then
11 12 easy_install --editable --build-directory . "$@"
12   - cd $1
  13 + cd $(ls -td */ | sed -ne '1p')
13 14 fi
14 15
15 16 if [ ! -r "setup.py" ] ; then
@@ -17,9 +18,14 @@ if [ ! -r "setup.py" ] ; then
17 18 exit 1
18 19 fi
19 20
  21 +if [ ! -z "$PATCHES" ] ; then
  22 + sh $PATCHES
  23 +fi
  24 +
20 25 # I know, this is pretty crappy, but it's quicker than monkeypatching or
21 26 # extending distutils.
22   -eval "$(python <<PYTHON)"
  27 +ed setup.py << ED_IS_AWESOME
  28 +/^ *setup *(/i
23 29 import pipes
24 30
25 31 def setup(**kwds):
@@ -28,21 +34,22 @@ def setup(**kwds):
28 34 if "requires" in kwds:
29 35 print "requires=%s" % pipes.quote((", ".join(["python-%s" % x for x in kwds["requires"]])))
30 36
31   -$(
32   - # Include the setup.py, minus distutils.
33   - sed -re 's/(import .*)setup, */\1/; s/^.*import setup$//;' setup.py
34   -)
35   -PYTHON
  37 +.
  38 +w hacked_setup.py
  39 +q
  40 +ED_IS_AWESOME
  41 +
  42 +eval "$(python hacked_setup.py)"
36 43
37 44 if [ -z "$name" -o -z "$version" ] ; then
38 45 echo "Unable to find name, version, etc..."
39 46 exit 1
40 47 fi
41 48
42   -# debuild requires package names be lowercase.
43   -name=$(echo "$name" | tr A-Z a-z)
44 49 set -e
45 50 set -x
46   -dh_make -s -n -c blank -e $USER -p "python-${name}_${version}"
  51 +name=$(echo "$name" | tr A-Z a-z)
  52 +release="$(date +%Y%m%d.%H%M%S)"
  53 +dh_make -s -n -c blank -e $USER -p "python-${name}_${version}-${release}" < /dev/null
47 54 sed -i -e "/Depends:.*$requires/! { s/^Depends: .*/&, $requires/ }" debian/control
48 55 debuild -us -uc

0 comments on commit 482e33a

Please sign in to comment.
Something went wrong with that request. Please try again.