On Mon, Mar 02, 1998 at 11:43:24PM -0600, Manoj Srivastava wrote: > Hi, > >>"Marcus" == Marcus Brinkmann <[EMAIL PROTECTED]> writes: > > Marcus> Hello! > > Marcus> I sometimes read something like "as we can now easily provide > Marcus> pristine source packages...". > Marcus> I wonder how I can provide the original tar ball if it > > Marcus> a) has not the right name (ok, could rename it) > > Correct. > > Marcus> b) does not extract in the right directory (for example, > Marcus> foo-version instead foo-version.orig). > > Do not worry about the name of the directory it installs > in. We can handle it as long as it unpacks into a single directory.
Ok, thank you all. I just wasn't sure enough to try it. The code below makes it a bit clearer. I'm sure it could be done without perl... tar|sed|uniq|wc|sed ;) Thank you for the code, Manoj Marcus > manoj > for the curious: the relevant excerpts from dpkg-source: > opendir(D,"$dirchdir") || &syserr("Unable to open dir $dirchdir"); > @dirchdirfiles = grep($_ ne "." && $_ ne "..",readdir(D)); > closedir(D) || &syserr("Unable to close dir $dirchdir"); > (@dirchdirfiles==1 && -d "$dirchdir/$dirchdirfiles[0]") || > &error("$tarfileread extracted into >1 directory"); > rename("$dirchdir/$dirchdirfiles[0]", "$dirchdir/$newtopdir") || > &syserr("Unable to rename $dirchdir/$dirchdirfiles[0] to ". > "$dirchdir/$newtopdir"); > -- "Rhubarb is no Egyptian god." Debian GNU/Linux finger brinkmd@ Marcus Brinkmann http://www.debian.org master.debian.org [EMAIL PROTECTED] for public PGP Key http://homepage.ruhr-uni-bochum.de/Marcus.Brinkmann/ PGP Key ID 36E7CD09