Am Donnerstag, den 28.06.2007, 08:27 +0900 schrieb Junichi Uekawa:
> Hi,
> 
> > > I have a first interesting solution: Put the PACKAGENAME variable
> > > determination before reading in any configure file. This allows for
> > > example the following use case:
> > > 
> > > ~/.dpatch.conf:
> > > conf_origtargzpath="/usr/local/src/packages/${PACKAGENAME}"
> > > 
> > > dpatch-edit-patch -b my_patch
> > > 
> > > So I don't need to retype the whole path every time. Maybe you want to
> > > put the variable creation for UPSTREAMVERSION and ORIGTARGZ before the
> > > configuration file inclusion too.
> > > 
> > > What is your opinion? BTW: What is the path attribute of the
> > > --debianonly option for, when you also provide --origtargzpath? Isn't
> > > this redundant? However, here is a workaround to my original report:
> > > Simply test, if the given attribute is a directory: then set
> > > DPEP_ORIGTARGZPATH; else set DPEP_ORIGTARGZ:
> > > 
> > > /usr/share/dpatch/dpatch-edit-patch.functions:
> > > -b|--debianonly)  DPEP_DEBIANONLY=1; [[ -d $2 ]] && \
> > >                   DPEP_ORIGTARGZPATH="$2" || DPEP_ORIGTARGZ="$2"; \
> > >                   shift 2;;
> > 
> > Any news? Can I expect these fixes in the next dpatch release? I need to
> > know that, because I want to refer to at least the first possibility in
> > a manual (for just a few people). If you don't plan to change this or if
> > you have reasons to refuse this change, I would really need to know
> > this.
> 
> Where's the patch? If you provide me with a patch, I'll apply it.

Well, the changes were so simple, I didn't thought, you need an extra
patch :) But here it comes. The attached patch addresses, what I wrote
in my earlier mails.

Regards, Daniel
--- /usr/bin/dpatch-edit-patch.orig	2007-06-25 14:20:11.000000000 +0200
+++ /usr/bin/dpatch-edit-patch	2007-07-01 00:15:03.000000000 +0200
@@ -22,6 +22,9 @@ unset conf_tmpdir
 unset conf_shell
 unset conf_stampdir
 
+PACKAGENAME="$(dpkg-parsechangelog | sed -n '/^Source:/{s/^Source:[[:space:]]\+\(.*\)/\1/;p;q}')"
+UPSTREAMVERSION="$(dpkg-parsechangelog | sed -n '/^Version:/{s/^Version:[[:space:]]\+\([0-9]\+:\)\?\([^-]\+\).*/\2/;p;q}')"
+
 # Read in the user's configuration file, should it exist.
 [[ -f ~/.dpatch.conf ]] && . ~/.dpatch.conf
 
@@ -177,8 +180,6 @@ else
     if [ -n "$DPEP_DEBIANONLY" ]; then
         dpep_message norm "* debian/-only layout selected"
 	if [ -z "$DPEP_ORIGTARGZ" ]; then
-            PACKAGENAME="$(dpkg-parsechangelog | sed -n '/^Source:/{s/^Source:[[:space:]]\+\(.*\)/\1/;p;q}')"
-            UPSTREAMVERSION="$(dpkg-parsechangelog | sed -n '/^Version:/{s/^Version:[[:space:]]\+\([0-9]\+:\)\?\([^-]\+\).*/\2/;p;q}')"
             ORIGTARGZ="${PACKAGENAME}_${UPSTREAMVERSION}.orig.tar.gz"
 	    export DPGO_ORIGTARGZPATH="$DPEP_ORIGTARGZPATH"
 	    if ! eval "$DPEP_GETORIGTARGZ $REFPDIR"; then
--- /usr/share/dpatch/dpatch-edit-patch.functions.orig	2007-06-25 14:20:11.000000000 +0200
+++ /usr/share/dpatch/dpatch-edit-patch.functions	2007-06-29 04:03:12.000000000 +0200
@@ -124,7 +124,9 @@ dpep_parse_options() {
 	    -t|--tmpdir)      DPEP_TMPDIR="$2"; shift 2;;
 	    -p|--stampdir)    DPEP_STAMPDIR="$2"; shift 2;;
 	    -e|--exclude)     DPEP_EXCLUDE="$2"; shift 2;;
-	    -b|--debianonly)  DPEP_DEBIANONLY=1; DPEP_ORIGTARGZ="$2"; shift 2;;
+	    -b|--debianonly)  DPEP_DEBIANONLY=1; \
+	                      [[ -d $2 ]] && DPEP_ORIGTARGZPATH="$2" || DPEP_ORIGTARGZ="$2"; \
+	                      shift 2;;
 	    -P|--origtargzpath) DPEP_ORIGTARGZPATH="$2"; shift 2;;
 	    -k|--keeptemp)    DPEP_KEEPTEMP=1; shift;;
 	    -c|--clean)       DPEP_CLEAN=1; shift;;

Reply via email to