Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   CRUX (http://www.linux-archive.org/crux/)
-   -   Possible bug in prt-get (http://www.linux-archive.org/crux/503457-possible-bug-prt-get.html)

uki 03-20-2011 10:48 PM

Possible bug in prt-get
 
Hi,
I found a strange behaviour in prt-get, I suppose this might be a bug.
In my Pkgfile I have:[...]TIP=`cd $REPO && hg tip | grep changeset | cut -d ':' -f2 | sed -e 's/ //g'`
version=rev-${TIP}[...]
prt-get builds the package properly:=======> Building '/home/pkgmk/packages/uki-awesome#rev-6738-1.pkg.tar.gz' succeeded.

but than when it tries to install it:prt-get: installing uki-awesome rev-${TIP}-1pkgadd: could not open uki-awesome#rev--1.pkg.tar.gz: No such file or directory

Is this a bug? And if not - how can I fix my Pkgfile?
Cheers,--
Ɓukasz Gruner


_______________________________________________
CRUX mailing list
CRUX@lists.crux.nu
http://lists.crux.nu/mailman/listinfo/crux

Michal Soltys 03-21-2011 07:22 AM

Possible bug in prt-get
 
W dniu 21.03.2011 00:48, uki pisze:

Hi,

I found a strange behaviour in prt-get, I suppose this might be a bug.

In my Pkgfile I have:
[...]
TIP=`cd $REPO && hg tip | grep changeset | cut -d ':' -f2 | sed -e 's/ //g'`
version=rev-${TIP}
[...]

prt-get builds the package properly:
=======> Building
'/home/pkgmk/packages/uki-awesome#rev-6738-1.pkg.tar.gz' succeeded.

but than when it tries to install it:
prt-get: installing uki-awesome rev-${TIP}-1
pkgadd: could not open uki-awesome#rev--1.pkg.tar.gz: No such file or
directory

Is this a bug? And if not - how can I fix my Pkgfile?



From what I saw in sources, the reason is that prt-get is not really a
shell script, and during installation phase it looks into Pkgfile itself
- caring /only/ for version= - thus other lines are not shell expanded
or cared at all. To be precise, peek into package.cpp:


expandShellCommands(m_data->version, timeNow, unameBuf);

is the "culprit" here (quotes intended, actually we're are the culprits ;)

Just use pkg{mk,add,rm} for Pkgfiles bent towards versioning systems (I
do analogous stuff for git). Or, make sure everything needed for shell
expansion is in version=, e.g.


version=rev-$(stuff you had in TIP, without dependency on other shell lines)


_______________________________________________
CRUX mailing list
CRUX@lists.crux.nu
http://lists.crux.nu/mailman/listinfo/crux

Michal Soltys 03-23-2011 12:11 PM

Possible bug in prt-get
 
W dniu 21.03.2011 09:22, Michal Soltys pisze:


Just use pkg{mk,add,rm} for Pkgfiles bent towards versioning systems (I
do analogous stuff for git). Or, make sure everything needed for shell
expansion is in version=, e.g.

version=rev-$(stuff you had in TIP, without dependency on other shell
lines)




Small correction, after looking a bit more.

prt-get handles $() and ``, but only with uname -r, date "+..." or date
'+...'. I generally use the last one in my Pkgfiles (the ones depending
on git), so I never noticed any problems.


Note it only applies to version= . release= is taken verbatim without
any interpretation.




_______________________________________________
CRUX mailing list
CRUX@lists.crux.nu
http://lists.crux.nu/mailman/listinfo/crux


All times are GMT. The time now is 02:43 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.