[arch-projects] [devtools] [PATCH] Add support for building bzr packages
Fixes FS#36654: https://bugs.archlinux.org/task/36654. Signed-off-by: Maxime Gauduin <alucryd@gmail.com> --- makechrootpkg.in | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/makechrootpkg.in b/makechrootpkg.in index 8c64ae1..b842d2f 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -296,6 +296,16 @@ _chrootbuild() { done done + # Same with bzr sources + for dir in /srcdest /startdir; do + cd $dir + for bzrdir in */.bzr; do + rm ${bzrdir%/.bzr} + cp -a ${dir}_host/${bzrdir%/.bzr} . + chown -R nobody ${bzrdir%/.bzr} + done + done + cd /startdir # XXX: Keep PKGBUILD writable for pkgver() -- 1.8.3.4
On Sun, Aug 25, 2013 at 06:35:03PM +0200, Maxime Gauduin wrote:
Fixes FS#36654: https://bugs.archlinux.org/task/36654.
Signed-off-by: Maxime Gauduin <alucryd@gmail.com> --- makechrootpkg.in | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/makechrootpkg.in b/makechrootpkg.in index 8c64ae1..b842d2f 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -296,6 +296,16 @@ _chrootbuild() { done done
+ # Same with bzr sources + for dir in /srcdest /startdir; do + cd $dir + for bzrdir in */.bzr; do + rm ${bzrdir%/.bzr}
Isn't this going to be a directory? How does this rm call succeed?
+ cp -a ${dir}_host/${bzrdir%/.bzr} . + chown -R nobody ${bzrdir%/.bzr} + done + done
General mention: please quote liberally rather than assuming that the contents will never be quoteworthy.
+ cd /startdir
# XXX: Keep PKGBUILD writable for pkgver() -- 1.8.3.4
On Sun, Aug 25, 2013 at 7:06 PM, Dave Reisner <d@falconindy.com> wrote:
On Sun, Aug 25, 2013 at 06:35:03PM +0200, Maxime Gauduin wrote:
Fixes FS#36654: https://bugs.archlinux.org/task/36654.
Signed-off-by: Maxime Gauduin <alucryd@gmail.com> --- makechrootpkg.in | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/makechrootpkg.in b/makechrootpkg.in index 8c64ae1..b842d2f 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -296,6 +296,16 @@ _chrootbuild() { done done
+ # Same with bzr sources + for dir in /srcdest /startdir; do + cd $dir + for bzrdir in */.bzr; do + rm ${bzrdir%/.bzr}
Isn't this going to be a directory? How does this rm call succeed?
+ cp -a ${dir}_host/${bzrdir%/.bzr} . + chown -R nobody ${bzrdir%/.bzr} + done + done
General mention: please quote liberally rather than assuming that the contents will never be quoteworthy.
+ cd /startdir
# XXX: Keep PKGBUILD writable for pkgver() -- 1.8.3.4
Right, all I did was copy paste the equivalent for svn in the script, replacing svn with bzr. I'll modify both svn and bzr with quotes and add -rf to the rm command. -- Maxime
On Sun, Aug 25, 2013 at 9:34 PM, Maxime GAUDUIN <alucryd@gmail.com> wrote:
On Sun, Aug 25, 2013 at 7:06 PM, Dave Reisner <d@falconindy.com> wrote:
On Sun, Aug 25, 2013 at 06:35:03PM +0200, Maxime Gauduin wrote:
Fixes FS#36654: https://bugs.archlinux.org/task/36654.
Signed-off-by: Maxime Gauduin <alucryd@gmail.com> --- makechrootpkg.in | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/makechrootpkg.in b/makechrootpkg.in index 8c64ae1..b842d2f 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -296,6 +296,16 @@ _chrootbuild() { done done
+ # Same with bzr sources + for dir in /srcdest /startdir; do + cd $dir + for bzrdir in */.bzr; do + rm ${bzrdir%/.bzr}
Isn't this going to be a directory? How does this rm call succeed?
+ cp -a ${dir}_host/${bzrdir%/.bzr} . + chown -R nobody ${bzrdir%/.bzr} + done + done
General mention: please quote liberally rather than assuming that the contents will never be quoteworthy.
+ cd /startdir
# XXX: Keep PKGBUILD writable for pkgver() -- 1.8.3.4
Right, all I did was copy paste the equivalent for svn in the script, replacing svn with bzr. I'll modify both svn and bzr with quotes and add -rf to the rm command.
-- Maxime
Just checked the dir to be rm which is in fact a symlink, that is why the rm command succeeds and there is no need for -rf. I'll just add quotes and email the patch again. -- Maxime
Fixes FS#36654: https://bugs.archlinux.org/task/36654. Signed-off-by: Maxime Gauduin <alucryd@gmail.com> --- makechrootpkg.in | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/makechrootpkg.in b/makechrootpkg.in index 8c64ae1..2833906 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -288,11 +288,21 @@ _chrootbuild() { # XXX: Keep svn sources writable # Since makepkg 4.1.1 they get checked out via cp -a, copying the symlink for dir in /srcdest /startdir; do - cd $dir + cd "$dir" for svndir in */.svn; do - rm ${svndir%/.svn} - cp -a ${dir}_host/${svndir%/.svn} . - chown -R nobody ${svndir%/.svn} + rm -rf "${svndir%/.svn}" + cp -a "${dir}_host/${svndir%/.svn}" . + chown -R nobody "${svndir%/.svn}" + done + done + + # Same with bzr sources + for dir in /srcdest /startdir; do + cd "$dir" + for bzrdir in */.bzr; do + rm -rf "${bzrdir%/.bzr}" + cp -a "${dir}_host/${bzrdir%/.bzr}" . + chown -R nobody "${bzrdir%/.bzr}" done done -- 1.8.3.4
Fixes FS#36654: https://bugs.archlinux.org/task/36654. Signed-off-by: Maxime Gauduin <alucryd@gmail.com> --- makechrootpkg.in | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/makechrootpkg.in b/makechrootpkg.in index 8c64ae1..34f9ff3 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -288,11 +288,21 @@ _chrootbuild() { # XXX: Keep svn sources writable # Since makepkg 4.1.1 they get checked out via cp -a, copying the symlink for dir in /srcdest /startdir; do - cd $dir + cd "$dir" for svndir in */.svn; do - rm ${svndir%/.svn} - cp -a ${dir}_host/${svndir%/.svn} . - chown -R nobody ${svndir%/.svn} + rm "${svndir%/.svn}" + cp -a "${dir}_host/${svndir%/.svn}" . + chown -R nobody "${svndir%/.svn}" + done + done + + # Same with bzr sources + for dir in /srcdest /startdir; do + cd "$dir" + for bzrdir in */.bzr; do + rm "${bzrdir%/.bzr}" + cp -a "${dir}_host/${bzrdir%/.bzr}" . + chown -R nobody "${bzrdir%/.bzr}" done done -- 1.8.3.4
Fixes FS#36654: https://bugs.archlinux.org/task/36654. Signed-off-by: Maxime Gauduin <alucryd@gmail.com> --- makechrootpkg.in | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/makechrootpkg.in b/makechrootpkg.in index 8c64ae1..e582a07 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -285,14 +285,16 @@ _chrootbuild() { ln -sft /srcdest /srcdest_host/* ln -sft /startdir /startdir_host/* - # XXX: Keep svn sources writable + # XXX: Keep bzr and svn sources writable # Since makepkg 4.1.1 they get checked out via cp -a, copying the symlink for dir in /srcdest /startdir; do - cd $dir - for svndir in */.svn; do - rm ${svndir%/.svn} - cp -a ${dir}_host/${svndir%/.svn} . - chown -R nobody ${svndir%/.svn} + for vcs in bzr svn; do + cd "$dir" + for vcsdir in */.$vcs; do + rm "${vcsdir%/.*}" + cp -a "${dir}_host/${vcsdir%/.*}" . + chown -R nobody "${vcsdir%/.*}" + done done done -- 1.8.3.4
Fixes FS#36654: https://bugs.archlinux.org/task/36654. Signed-off-by: Maxime Gauduin <alucryd@gmail.com> --- makechrootpkg.in | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/makechrootpkg.in b/makechrootpkg.in index 8c64ae1..e582a07 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -285,14 +285,16 @@ _chrootbuild() { ln -sft /srcdest /srcdest_host/* ln -sft /startdir /startdir_host/* - # XXX: Keep svn sources writable + # XXX: Keep bzr and svn sources writable # Since makepkg 4.1.1 they get checked out via cp -a, copying the symlink for dir in /srcdest /startdir; do - cd $dir - for svndir in */.svn; do - rm ${svndir%/.svn} - cp -a ${dir}_host/${svndir%/.svn} . - chown -R nobody ${svndir%/.svn} + for vcs in bzr svn; do + cd "$dir" + for vcsdir in */.$vcs; do + rm "${vcsdir%/.$vcs}" + cp -a "${dir}_host/${vcsdir%/.$vcs}" . + chown -R nobody "${vcsdir%/.$vcs}" + done done done -- 1.8.3.4
participants (3)
-
Dave Reisner
-
Maxime GAUDUIN
-
Maxime Gauduin