[pacman-dev] [PATCH] Make 'SRCDEST', 'PKGDEST' and 'PKGSRCDEST' respect the 'BUILDDIR'
--- A task has also been added to the bugtracker: https://bugs.archlinux.org/task/35498 scripts/makepkg.sh.in | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index b85b87e..c27c74d 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -2790,7 +2790,15 @@ if [[ $BUILDDIR = "$startdir" ]]; then else srcdir="$BUILDDIR/$pkgbase/src" pkgdirbase="$BUILDDIR/$pkgbase/pkg" - + if [[ $SRCDEST = "$startdir" ]]; then + SRCDEST="$BUILDDIR/$pkgbase" + fi + if [[ $PKGDEST = "$startdir" ]]; then + PKGDEST="$BUILDDIR/$pkgbase" + fi + if [[ $SRCPKGDEST = "$startdir" ]]; then + SRCPKGDEST="$BUILDDIR/$pkgbase" + fi fi # set pkgdir to something "sensible" for (not recommended) use during build() -- 1.8.2.3
On 28/05/13 02:07, Techlive Zheng wrote: Explain your patch in the commit message.
--- A task has also been added to the bugtracker:
This is intended. If I set BUILDDIR to a tmpfs (which is mostly the point of this...), then I do not want the final packages being stored there. Or the sources.
scripts/makepkg.sh.in | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index b85b87e..c27c74d 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -2790,7 +2790,15 @@ if [[ $BUILDDIR = "$startdir" ]]; then else srcdir="$BUILDDIR/$pkgbase/src" pkgdirbase="$BUILDDIR/$pkgbase/pkg" - + if [[ $SRCDEST = "$startdir" ]]; then + SRCDEST="$BUILDDIR/$pkgbase" + fi + if [[ $PKGDEST = "$startdir" ]]; then + PKGDEST="$BUILDDIR/$pkgbase" + fi + if [[ $SRCPKGDEST = "$startdir" ]]; then + SRCPKGDEST="$BUILDDIR/$pkgbase" + fi fi
# set pkgdir to something "sensible" for (not recommended) use during build()
2013/5/28 Allan McRae <allan@archlinux.org>:
On 28/05/13 02:07, Techlive Zheng wrote:
Explain your patch in the commit message.
--- A task has also been added to the bugtracker:
This is intended. If I set BUILDDIR to a tmpfs (which is mostly the point of this...), then I do not want the final packages being stored there. Or the sources.
I keep a separate partition for ABS build on my disk, and my PKGBUILDs are always located aside the actual project sources, that's why I need downloaded source and target tars to be placed in the BUILDDIR. If so, is there possible to add this as an option?
scripts/makepkg.sh.in | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index b85b87e..c27c74d 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -2790,7 +2790,15 @@ if [[ $BUILDDIR = "$startdir" ]]; then else srcdir="$BUILDDIR/$pkgbase/src" pkgdirbase="$BUILDDIR/$pkgbase/pkg" - + if [[ $SRCDEST = "$startdir" ]]; then + SRCDEST="$BUILDDIR/$pkgbase" + fi + if [[ $PKGDEST = "$startdir" ]]; then + PKGDEST="$BUILDDIR/$pkgbase" + fi + if [[ $SRCPKGDEST = "$startdir" ]]; then + SRCPKGDEST="$BUILDDIR/$pkgbase" + fi fi
# set pkgdir to something "sensible" for (not recommended) use during build()
On 28/05/13 14:33, 郑文辉(Techlive Zheng) wrote:
2013/5/28 Allan McRae <allan@archlinux.org>:
On 28/05/13 02:07, Techlive Zheng wrote:
Explain your patch in the commit message.
--- A task has also been added to the bugtracker:
This is intended. If I set BUILDDIR to a tmpfs (which is mostly the point of this...), then I do not want the final packages being stored there. Or the sources.
I keep a separate partition for ABS build on my disk, and my PKGBUILDs are always located aside the actual project sources, that's why I need downloaded source and target tars to be placed in the BUILDDIR.
I don't understand. You want to store the source files and built packages in their own directory for each package but separate from the PKGBUILD?
2013/5/28 Allan McRae <allan@archlinux.org>:
On 28/05/13 14:33, 郑文辉(Techlive Zheng) wrote:
2013/5/28 Allan McRae <allan@archlinux.org>:
On 28/05/13 02:07, Techlive Zheng wrote:
Explain your patch in the commit message.
--- A task has also been added to the bugtracker:
This is intended. If I set BUILDDIR to a tmpfs (which is mostly the point of this...), then I do not want the final packages being stored there. Or the sources.
I keep a separate partition for ABS build on my disk, and my PKGBUILDs are always located aside the actual project sources, that's why I need downloaded source and target tars to be placed in the BUILDDIR.
I don't understand. You want to store the source files and built packages in their own directory for each package but separate from the PKGBUILD?
Yes, that's is exactly I am trying to accomplish, as the PKGBUILD is maintained in a git repository along with the project source, building package inside this directory will make the git repo hard to maintain and the partition grow bigger and bigger, I have a separate partition for all ABS building stuff, so I want to keep the building there.
2013/5/28 郑文辉(Techlive Zheng) <techlivezheng@gmail.com>:
2013/5/28 Allan McRae <allan@archlinux.org>:
On 28/05/13 14:33, 郑文辉(Techlive Zheng) wrote:
2013/5/28 Allan McRae <allan@archlinux.org>:
On 28/05/13 02:07, Techlive Zheng wrote:
Explain your patch in the commit message.
--- A task has also been added to the bugtracker:
This is intended. If I set BUILDDIR to a tmpfs (which is mostly the point of this...), then I do not want the final packages being stored there. Or the sources.
I keep a separate partition for ABS build on my disk, and my PKGBUILDs are always located aside the actual project sources, that's why I need downloaded source and target tars to be placed in the BUILDDIR.
I don't understand. You want to store the source files and built packages in their own directory for each package but separate from the PKGBUILD?
Yes, that's is exactly I am trying to accomplish, as the PKGBUILD is maintained in a git repository along with the project source, building package inside this directory will make the git repo hard to maintain and the partition grow bigger and bigger, I have a separate partition for all ABS building stuff, so I want to keep the building there.
So, how is it going? do I need to revise the patch to make this behavior a configurable option or what? TZheng
2013/5/31 郑文辉(Techlive Zheng) <techlivezheng@gmail.com>:
2013/5/28 郑文辉(Techlive Zheng) <techlivezheng@gmail.com>:
2013/5/28 Allan McRae <allan@archlinux.org>:
On 28/05/13 14:33, 郑文辉(Techlive Zheng) wrote:
2013/5/28 Allan McRae <allan@archlinux.org>:
On 28/05/13 02:07, Techlive Zheng wrote:
Explain your patch in the commit message.
--- A task has also been added to the bugtracker:
This is intended. If I set BUILDDIR to a tmpfs (which is mostly the point of this...), then I do not want the final packages being stored there. Or the sources.
I keep a separate partition for ABS build on my disk, and my PKGBUILDs are always located aside the actual project sources, that's why I need downloaded source and target tars to be placed in the BUILDDIR.
I don't understand. You want to store the source files and built packages in their own directory for each package but separate from the PKGBUILD?
Yes, that's is exactly I am trying to accomplish, as the PKGBUILD is maintained in a git repository along with the project source, building package inside this directory will make the git repo hard to maintain and the partition grow bigger and bigger, I have a separate partition for all ABS building stuff, so I want to keep the building there.
So, how is it going? do I need to revise the patch to make this behavior a configurable option or what?
TZheng
I have an iden, since you don't want these variables change with $BUILDDIR, how about append $pkgbase to the path if the value of these variables is the same as $BUILDDIR but not with the $startdir? E.g.: + if [[ $SRCDEST = $BUILDDIR ]] && [[ $SRCDEST != "$startdir" ]]; then + SRCDEST="$BUILDDIR/$pkgbase" + fi + if [[ $PKGDEST = $BUILDDIR ]] && [[ $PKGDEST != "$startdir" ]]; then + PKGDEST="$BUILDDIR/$pkgbase" + fi + if [[ $SRCPKGDEST = $BUILDDIR ]] && [[ $SRCPKGDEST != "$startdir" ]]; then + SRCPKGDEST="$BUILDDIR/$pkgbase" + fi
On 31/05/13 09:12, 郑文辉(Techlive Zheng) wrote:
I have an iden, since you don't want these variables change with $BUILDDIR, how about append $pkgbase to the path if the value of these variables is the same as $BUILDDIR but not with the $startdir?
E.g.:
+ if [[ $SRCDEST = $BUILDDIR ]] && [[ $SRCDEST != "$startdir" ]]; then + SRCDEST="$BUILDDIR/$pkgbase" + fi + if [[ $PKGDEST = $BUILDDIR ]] && [[ $PKGDEST != "$startdir" ]]; then + PKGDEST="$BUILDDIR/$pkgbase" + fi + if [[ $SRCPKGDEST = $BUILDDIR ]] && [[ $SRCPKGDEST != "$startdir" ]]; then + SRCPKGDEST="$BUILDDIR/$pkgbase" + fi
That seems an awful hack. Is this not something that you can achieve using "makepkg -p" or symlinking the files into your build directory. Allan
2013/5/31 Allan McRae <allan@archlinux.org>:
On 31/05/13 09:12, 郑文辉(Techlive Zheng) wrote:
I have an iden, since you don't want these variables change with $BUILDDIR, how about append $pkgbase to the path if the value of these variables is the same as $BUILDDIR but not with the $startdir?
E.g.:
+ if [[ $SRCDEST = $BUILDDIR ]] && [[ $SRCDEST != "$startdir" ]]; then + SRCDEST="$BUILDDIR/$pkgbase" + fi + if [[ $PKGDEST = $BUILDDIR ]] && [[ $PKGDEST != "$startdir" ]]; then + PKGDEST="$BUILDDIR/$pkgbase" + fi + if [[ $SRCPKGDEST = $BUILDDIR ]] && [[ $SRCPKGDEST != "$startdir" ]]; then + SRCPKGDEST="$BUILDDIR/$pkgbase" + fi
That seems an awful hack.
Is this not something that you can achieve using "makepkg -p" or symlinking the files into your build directory.
Allan
With recent introduced commit 3d3c7eb ''makepkg: allow make-style environment var overrides" and my two patches [1587](https://patchwork.archlinux.org/patch/1587/ and [1588](https://patchwork.archlinux.org/patch/1588/), I can now achieve this with `makepkg SRCDEST='$BUILDDIR/$pkgbase'`. This patch ticket could be colsed, I think.
participants (3)
-
Allan McRae
-
Techlive Zheng
-
郑文辉(Techlive Zheng)