Package: dpkg-dev
Version: 1.16.2
Severity: wishlist

Hello:

Debian policy 4.9 [1] says this about the get-orig-source target:
"This target may be invoked in any directory, and should take care to
clean up any temporary files it may have left".

If one wants to use let say:
TARBALL         = $(DEB_SOURCE)_$(DEB_VERSION_UPSTREAM).orig.tar.gz

and runs for example
mkdir -p temp && cd temp && ../debian/rules get-orig-source

This will generate several:
awk: cannot open debian/control (No such file or directory)
tail: cannot open `debian/changelog' for reading: No such file or directory

and the get-orig-source routine just keeps going as normal resulting
in possibly unwanted behavior.

One of the many possible uses for pkg-info.mk is to help with
get-orig-source routines. Currently I was testing something similar to

# Get the information needed by get-orig-source.
# include /usr/share/dpkg/pkg-info.mk
# This requires dpkg-dev >= 1.16.1, hardcodes debian/{control,changelog} and
# makes get-orig-source fail when called from different paths.
DEB_DEBIAN_DIR          = $(dir $(firstword $(MAKEFILE_LIST)))
DEB_SOURCE              = $(shell dpkg-parsechangelog 
-l$(DEB_DEBIAN_DIR)/changelog |\
                                awk '/^Source: / { print $$2 }')
DEB_VERSION_UPSTREAM    = $(shell dpkg-parsechangelog
-l$(DEB_DEBIAN_DIR)/changelog |\
                                sed -nr '/^Version:/s/Version: 
(.*:)?(.*)-(.*)/\2/p')

If possible adding a DEB_DEBIAN_DIR variable and
-l$(DEB_DEBIAN_DIR)/changelog to dpkg-parsechangelog in pkg-info.mk
should make the script work as before and with get-orig-source.

Also  DEB_DEBIAN_DIR is useful if one uses something like
REMOVE_DFSG     = $(DEB_DEBIAN_DIR)/get-orig-source-remove

where get-orig-source-remove contains a list of all the files and
directories to remove when making a source DFSG-free.

Hope this helps and makes sense,
Miguel

[1] http://www.debian.org/doc/debian-policy/ch-source.html#s-debianrules



-- 
To UNSUBSCRIBE, email to debian-dpkg-bugs-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to