On 3/28/06, Eddy Petrişor <[EMAIL PROTECTED]> wrote:
On 3/28/06, Giacomo A. Catenazzi <[EMAIL PROTECTED]> wrote:
> > I guess this is easier than manually checking, but that would mean
> > changing the source at build time, which is a huge no-no. The source
> > you see is not the source you get.
>
> I agree, the sources should not be changes, but what are the sources?
>
[snip]

but they do not change the original sources at build time (except the
dpatched ones, but that is another issue)

I can agree this would not be such a hard to follow change, but I
don't like the idea of changing the source just for this.

I have been working on this, but it seems that my Makefile knowledge
is not enough for me to do it properly.

I have this (see below) section in the rules file but the variable
VERSION is not expanded in the sed command. Help would be appreciated.

> The main point of apt-zip code is to create shell script from
> a shell script, so it would be difficult to the code reader to
> understand this small substitution. And it would work also if we
> don't substitute "--VERSION--".

My first idea was to name the common.sh file from the source into
unversioned.common.sh, but I have changed into common.sh.in to be more
inline with the make usual way of working.


Index: Makefile
===================================================================
--- Makefile    (revision 41)
+++ Makefile    (working copy)
@@ -15,9 +15,15 @@
MANPAGE=        apt-zip.8
MANLINKS=       ${SCRIPTS:=.8} ${SSCRIPTS:=.8}

-all: ${MANPAGE}
+all: ${MANPAGE} build

-install:
+build:
+       VERSION=$(shell dpkg-parsechangelog | grep 'Version: ' | cut -f2 -d' ')
+#      @echo $(value VERSION)
+       sed "s/^[[:space:]]*\(APTZIPVERSION=\).*$$/\1$(VERSION)/"
<common.sh.in >common.sh
+       sed s/APTZIPVERSION=.*$$/$(value VERSION)/ <common.sh.in >common.sh
+
+install: build
        install -d ${BINDIR} ${SBINDIR} ${CONFDIR} ${SHAREDIR} ${METHDIR} 
${MAN8DIR}

        install -m755 ${SCRIPTS} ${BINDIR}
@@ -32,6 +38,9 @@

clean:
        rm -f manpage.* ${MANPAGE}
+       rm -f common.sh

apt-zip.8: apt-zip.sgml
        docbook2man apt-zip.sgml
+
+.PHONY: clean, build, install

--
Regards,
EddyP
=============================================
"Imagination is more important than knowledge" A.Einstein

Reply via email to