Corinna Vinschen wrote:
I'm wondering if what you did in your patch shouldn't be just the default behaviour. No -e option.
Of course :-) +1 Thanks for all +1 feedbacks. New patch attached, function name in changelog fixed. The nullptr check for Base() return value might not be really needed. Christian
2011-12-15 Christian Franke <[email protected]> * install.cc (do_install_thread): Install src packages in /usr/src/PACKAGE-VERSION instead of /usr/src. diff --git a/install.cc b/install.cc index 5e3331a..89e8ce0 100644 --- a/install.cc +++ b/install.cc @@ -740,9 +740,23 @@ do_install_thread (HINSTANCE h, HWND owner) i != sourceinstall_q.end (); ++i) { packagemeta & pkg = **i; + + std::string prefix = "/usr/src/"; + /* Install PACKAGE-VERSION-src.tar.bz2 contents in directory + /usr/src/PACKAGE-VERSION . */ + const char *base = pkg.desired.sourcePackage().source()->Base(); + if (base) + { + int len = strlen (base); + if (len > 4 && ! strcmp (base + len - 4, "-src")) + len -= 4; + prefix.append(base, len); + prefix += '/'; + } + myInstaller.installOne (pkg, pkg.desired.sourcePackage(), *pkg.desired.sourcePackage().source(), - "cygfile://", "/usr/src/", owner); + "cygfile://", prefix, owner); } if (rebootneeded)
