Bug#291668: /usr/bin/dpatch-edit-patch: autodetect debianonly situations

2005-01-22 Thread Marc Haber
Package: dpatch
Version: 2.0.10
Severity: wishlist
File: /usr/bin/dpatch-edit-patch

Please consider having dpatch-edit-patch autodetect the case when
called from a debian/-only directory layout. This could probably
automatically be detected by looking whether the current directory has
only one non-dotted entry, a directory called "debian" which in turn
has files debian/changelog and debian/control.

A less magic approach would be checking for a file
debian/dpep-debianonly or debian/patches/dpep-debianonly, which could
optionally contain instructions on how to find the origtargz.

Additionally, if the current directory is an svn work dir, the script
could look for the svn property merkeWithUpstream.

Please let me know how you would like dpep to behave, and I'll supply
a patch.

Greetings
Marc

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.9-zgserver
Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-1)

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#291668: /usr/bin/dpatch-edit-patch: autodetect debianonly situations

2005-01-22 Thread Gergely Nagy
> A less magic approach would be checking for a file
> debian/dpep-debianonly or debian/patches/dpep-debianonly, which could
> optionally contain instructions on how to find the origtargz.

This sounds best to me, for the following reasons:
- One has to explicitly mark the tree as debian-only, so it can't be
misdetected (unless one deliberately breaks the thing)
- The file containing instructions can be a good idea.. I'm not 100%
sure about that though. (more on this later)
- It's VCS-agnostic

The only concern I have is the file to flag debian-only status. It might
be more useful if it would be debian/patches/00dpep-options (or
something similar), where one could tweak a selected set of
dpatch-edit-patch options. Not instructions on how to find the
orig.tar.gz though - that's a job of the origtargz finder script, and
debian/watch should be good enough for that. If not, then I think that
whoever is building the package should know how to get ahold of the
tarball and place it in a place where it can be found. That is, if
there's an easy way to automatically fetch the tarball, we should use
that. If there is not, we should rely on the user setting it up for us,
instead of performing BlackMagic(tm).

So, for now, I'd suggest a patch that checks
debian/patches/00dpep-options, and wether it sets a variable called
DEBIANONLY, and makes dpep act accordingly. And does nothing more.

(I'd imagine the function would look something like:

dpep_load_options ()
{
  DEBIANONLY=""
  if [ -e debian/patches/00dpep-options ]; then
. debian/patches/00dpep-options
  fi
  
  if [ ! -z "${DEBIANONLY}" ]; then
DPEP_DEBIANONLY="${DEBIANONLY}"
  fi
}

(Thus, it does not allow setting all dpep options, only a selected set)

-- 
Gergely Nagy



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#291668: /usr/bin/dpatch-edit-patch: autodetect debianonly situations

2005-01-22 Thread Marc Haber
On Sat, Jan 22, 2005 at 12:43:45PM +0100, Gergely Nagy wrote:
> The only concern I have is the file to flag debian-only status. It might
> be more useful if it would be debian/patches/00dpep-options (or
> something similar), where one could tweak a selected set of
> dpatch-edit-patch options.

If the presence of that file doesn't confuse other programs from the
dpatch suite, it is of course the best option.

> Not instructions on how to find the
> orig.tar.gz though - that's a job of the origtargz finder script, and
> debian/watch should be good enough for that. If not, then I think that
> whoever is building the package should know how to get ahold of the
> tarball and place it in a place where it can be found.

When we have a config file, that file should have an option to
directly point the origtargz finder to the direct path. I am currently
debating with the svn-buildpackage maintainer to have a user-specific
config file in the home directory containing a list of package names
and locations for .orig.tar.gz files. Maybe dpep could support that
file as well.

> dpep_load_options ()
> {
>   DEBIANONLY=""
>   if [ -e debian/patches/00dpep-options ]; then
>   . debian/patches/00dpep-options
>   fi
>   
>   if [ ! -z "${DEBIANONLY}" ]; then
>   DPEP_DEBIANONLY="${DEBIANONLY}"
>   fi
> }

Yes, that would probably be it.

I'll prepare a patch.

Greetings
Marc

-- 
-
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things."Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature |  How to make an American Quilt | Fax: *49 621 72739835


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#291668: /usr/bin/dpatch-edit-patch: autodetect debianonly situations

2005-01-22 Thread Gergely Nagy
On Sat, 2005-01-22 at 15:12 +0100, Marc Haber wrote:
> On Sat, Jan 22, 2005 at 12:43:45PM +0100, Gergely Nagy wrote:
> > The only concern I have is the file to flag debian-only status. It might
> > be more useful if it would be debian/patches/00dpep-options (or
> > something similar), where one could tweak a selected set of
> > dpatch-edit-patch options.
> 
> If the presence of that file doesn't confuse other programs from the
> dpatch suite, it is of course the best option.

It shouldn't. If it does, the tool which got confused needs to be fixed.

> > Not instructions on how to find the
> > orig.tar.gz though - that's a job of the origtargz finder script, and
> > debian/watch should be good enough for that. If not, then I think that
> > whoever is building the package should know how to get ahold of the
> > tarball and place it in a place where it can be found.
> 
> When we have a config file, that file should have an option to
> directly point the origtargz finder to the direct path. I am currently
> debating with the svn-buildpackage maintainer to have a user-specific
> config file in the home directory containing a list of package names
> and locations for .orig.tar.gz files. Maybe dpep could support that
> file as well.

I do NOT want to have direct, local paths in the file. That will break
dpatch-edit-patch the first time someone has a different directory
setup. 

Say, the file has
ORIGTARGZ_LOCATION="/home/jrandomdeveloper/origs/foo_1.0.orig.tar.gz";
this will break as soon as someone else than jrandomdeveloper wants to
use dpatch-edit-patch. If it is only a hint, and other locations are
searched as well, then I do not thing it is worth the effort at all.

For the same reason I do not want dpep to support svn-buildpackage's
configfile (if there will be such a thing): that is not our territory.
Instead of parsing that file, a hook that copies or symlinks the
orig.tar.gz to a location where dpep can find it would be MUCH better (a
hook in svn-buildpackage, that is).
With cvs-buildpackage, one can do that, works fine, and does not need
hacks in dpep.

(And that is why I consider backuping out the .svn/deb-layout thing too,
now that I thought some more about the issue)

-- 
Gergely Nagy



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#291668: /usr/bin/dpatch-edit-patch: autodetect debianonly situations

2005-01-22 Thread Marc Haber
On Sat, Jan 22, 2005 at 03:26:50PM +0100, Gergely Nagy wrote:
> I do NOT want to have direct, local paths in the file. That will break
> dpatch-edit-patch the first time someone has a different directory
> setup. 

OK, Accepted.

> Instead of parsing that file, a hook that copies or symlinks the
> orig.tar.gz to a location where dpep can find it would be MUCH better (a
> hook in svn-buildpackage, that is).

dpep would need to have such a hook as well.

cvs-buildpackage reads ~/.cvsdeb.conf, which can have conf_get_orig
point to a script that is called to get the orig.tar.gz.

Would you accept that setup?

Greetings
Marc

-- 
-
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things."Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature |  How to make an American Quilt | Fax: *49 621 72739835


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#291668: /usr/bin/dpatch-edit-patch: autodetect debianonly situations

2005-01-22 Thread Gergely Nagy
On Sat, 2005-01-22 at 15:54 +0100, Marc Haber wrote:
> On Sat, Jan 22, 2005 at 03:26:50PM +0100, Gergely Nagy wrote:
> > I do NOT want to have direct, local paths in the file. That will break
> > dpatch-edit-patch the first time someone has a different directory
> > setup. 
> 
> OK, Accepted.
> 
> > Instead of parsing that file, a hook that copies or symlinks the
> > orig.tar.gz to a location where dpep can find it would be MUCH better (a
> > hook in svn-buildpackage, that is).
> 
> dpep would need to have such a hook as well.

Hm, true enough, yes. Sorry about my confusion.
(Note to self: get sober before attempting to understand e-mail)

> cvs-buildpackage reads ~/.cvsdeb.conf, which can have conf_get_orig
> point to a script that is called to get the orig.tar.gz.
> 
> Would you accept that setup?

Sorry, but I'm still not convinced I'd like to see dpep handle the
config files of *-buildpackage and the like. I'd rather see it well
explained where the original tarballs are searched for, and let the user
running dpatch-edit-patch make sure the files are there. Less magic,
less bugs, I say.

The current debian/watch and apt-get source thingy is more than enough,
I think. If one wants to avoid both of those, he should know where to
place his orig.tar.gz.

-- 
Gergely Nagy



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#291668: /usr/bin/dpatch-edit-patch: autodetect debianonly situations

2005-01-22 Thread Marc Haber
On Sat, Jan 22, 2005 at 04:05:26PM +0100, Gergely Nagy wrote:
> On Sat, 2005-01-22 at 15:54 +0100, Marc Haber wrote:
> > cvs-buildpackage reads ~/.cvsdeb.conf, which can have conf_get_orig
> > point to a script that is called to get the orig.tar.gz.
> > 
> > Would you accept that setup?
> 
> Sorry, but I'm still not convinced I'd like to see dpep handle the
> config files of *-buildpackage and the like.

I am not suggesting to have dpep read cvs-buildpackage's config file,
but to have its own, ~/dpatch.conf.

> I'd rather see it well
> explained where the original tarballs are searched for, and let the user
> running dpatch-edit-patch make sure the files are there. Less magic,
> less bugs, I say.

In sufficiently sick setups, it might be painful to put the files
where dpep expects them.

Greetins
Marc

-- 
-
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things."Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature |  How to make an American Quilt | Fax: *49 621 72739835


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#291668: /usr/bin/dpatch-edit-patch: autodetect debianonly situations

2005-01-22 Thread Gergely Nagy
On Sat, 2005-01-22 at 16:13 +0100, Marc Haber wrote:
> On Sat, Jan 22, 2005 at 04:05:26PM +0100, Gergely Nagy wrote:
> > On Sat, 2005-01-22 at 15:54 +0100, Marc Haber wrote:
> > > cvs-buildpackage reads ~/.cvsdeb.conf, which can have conf_get_orig
> > > point to a script that is called to get the orig.tar.gz.
> > > 
> > > Would you accept that setup?
> > 
> > Sorry, but I'm still not convinced I'd like to see dpep handle the
> > config files of *-buildpackage and the like.
> 
> I am not suggesting to have dpep read cvs-buildpackage's config file,
> but to have its own, ~/dpatch.conf.

Hrm. So it would be per-user, not per-package? That sounds much better.

(so, autodetect debian-only setup from per-package
debian/patches/00dpep-options, and get a list of possible locations from
~/.dpatch.conf... sounds fine!)

-- 
Gergely Nagy



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#291668: /usr/bin/dpatch-edit-patch: autodetect debianonly situations

2005-01-22 Thread Marc Haber
On Sat, Jan 22, 2005 at 04:22:13PM +0100, Gergely Nagy wrote:
> (so, autodetect debian-only setup from per-package
> debian/patches/00dpep-options, and get a list of possible locations from
> ~/.dpatch.conf... sounds fine!)

debian-only setup is now detected from debian/patches/00dpatch.conf.
Upstream tarball is located via the new script dpatch-get-origtargz
which can be replaced with a local script via configuration option,
read from ~/.dpatch.conf.

The infrastructure allows setting of configuration options from
debian/patches/00dpatch.conf and ~/.dpatch.conf, with conf-debianonly
being the only one that can actually be set from
debian/patches/00dpatch.conf. The parsing code can easily be changed
to allow variables to be set from the other or even from both
configuration files.

The code that accomplishes this is attached to #291666.

Greetings
Marc


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]