[pacman-dev] [PATCH] makepkg: remove ability to build individual packages
Signed-off-by: Allan McRae <allan@archlinux.org> --- scripts/makepkg.sh.in | 8 -------- 1 file changed, 8 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 793d42c..6ededa3 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -76,7 +76,6 @@ NOBUILD=0 NODEPS=0 NOEXTRACT=0 PKGFUNC=0 -PKGLIST=() PKGVERFUNC=0 PREPAREFUNC=0 REPKG=0 @@ -1718,7 +1717,6 @@ usage() { printf -- "$(gettext " --noprepare Do not run the %s function in the %s")\n" "prepare()" "$BUILDSCRIPT" printf -- "$(gettext " --nosign Do not create a signature for the package")\n" printf -- "$(gettext " --packagelist Only list packages that would be produced, without PKGEXT")\n" - printf -- "$(gettext " --pkg <list> Only build listed packages from a split package")\n" printf -- "$(gettext " --printsrcinfo Print the generated SRCINFO and exit")\n" printf -- "$(gettext " --sign Sign the resulting package with %s")\n" "gpg" printf -- "$(gettext " --skipchecksums Do not verify checksums of the source files")\n" @@ -1808,7 +1806,6 @@ while true; do --nosign) SIGNPKG='n' ;; -o|--nobuild) NOBUILD=1 ;; -p) shift; BUILDFILE=$1 ;; - --pkg) shift; IFS=, read -ra p <<<"$1"; PKGLIST+=("${p[@]}"); unset p ;; --packagelist) PACKAGELIST=1 IGNOREARCH=1;; --printsrcinfo) PRINTSRCINFO=1 ;; -r|--rmdeps) RMDEPS=1 ;; @@ -2060,11 +2057,6 @@ elif [[ $SPLITPKG -eq 0 ]] && have_function package_${pkgname}; then SPLITPKG=1 fi -if [[ -n "${PKGLIST[@]}" ]]; then - unset pkgname - pkgname=("${PKGLIST[@]}") -fi - # check if gpg signature is to be created and if signing key is valid if { [[ -z $SIGNPKG ]] && check_buildenv "sign" "y"; } || [[ $SIGNPKG == 'y' ]]; then SIGNPKG='y' -- 2.5.3
I might have missed something in the previous messages, but is there any rationale on this, beside debatable worthiness? On 15-09-23 00:04:23, Allan McRae wrote:
Signed-off-by: Allan McRae <allan@archlinux.org> --- scripts/makepkg.sh.in | 8 -------- 1 file changed, 8 deletions(-)
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 793d42c..6ededa3 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -76,7 +76,6 @@ NOBUILD=0 NODEPS=0 NOEXTRACT=0 PKGFUNC=0 -PKGLIST=() PKGVERFUNC=0 PREPAREFUNC=0 REPKG=0 @@ -1718,7 +1717,6 @@ usage() { printf -- "$(gettext " --noprepare Do not run the %s function in the %s")\n" "prepare()" "$BUILDSCRIPT" printf -- "$(gettext " --nosign Do not create a signature for the package")\n" printf -- "$(gettext " --packagelist Only list packages that would be produced, without PKGEXT")\n" - printf -- "$(gettext " --pkg <list> Only build listed packages from a split package")\n" printf -- "$(gettext " --printsrcinfo Print the generated SRCINFO and exit")\n" printf -- "$(gettext " --sign Sign the resulting package with %s")\n" "gpg" printf -- "$(gettext " --skipchecksums Do not verify checksums of the source files")\n" @@ -1808,7 +1806,6 @@ while true; do --nosign) SIGNPKG='n' ;; -o|--nobuild) NOBUILD=1 ;; -p) shift; BUILDFILE=$1 ;; - --pkg) shift; IFS=, read -ra p <<<"$1"; PKGLIST+=("${p[@]}"); unset p ;; --packagelist) PACKAGELIST=1 IGNOREARCH=1;; --printsrcinfo) PRINTSRCINFO=1 ;; -r|--rmdeps) RMDEPS=1 ;; @@ -2060,11 +2057,6 @@ elif [[ $SPLITPKG -eq 0 ]] && have_function package_${pkgname}; then SPLITPKG=1 fi
-if [[ -n "${PKGLIST[@]}" ]]; then - unset pkgname - pkgname=("${PKGLIST[@]}") -fi - # check if gpg signature is to be created and if signing key is valid if { [[ -z $SIGNPKG ]] && check_buildenv "sign" "y"; } || [[ $SIGNPKG == 'y' ]]; then SIGNPKG='y' -- 2.5.3
-- Pierre Neidhardt Q: Why was Stonehenge abandoned? A: It wasn't IBM compatible.
On 23/09/15 00:20, Pierre Neidhardt wrote:
I might have missed something in the previous messages, but is there any rationale on this, beside debatable worthiness?
Many packages break when using this. Some are because assumptions made on build() about the value of $pkgname which changes when --pkg was used. These should use $pkgbase anyway... Also, there are quite a few split packages that rely on the first first split-package being packaged for the rest of the package functions to work. This will become more prevalent when a way to do a "make install" followed by moving files into different packages becomes available (i.e. rpm packaging style - I am working on this). So... essentially, it is (debatably) broken and will become more broken in the future
In other words, rather than fix the packages to be safer and more logical, go ahead and let people write sloppy PKGBUILDs? For what it's worth, I think this is a bad idea. The changes needed to fix the packages are small, and this would reduce the ability of users to automate upgrading from ABS. On Tue, Sep 22, 2015 at 11:33 PM, Allan McRae <allan@archlinux.org> wrote:
On 23/09/15 00:20, Pierre Neidhardt wrote:
I might have missed something in the previous messages, but is there any rationale on this, beside debatable worthiness?
Many packages break when using this.
Some are because assumptions made on build() about the value of $pkgname which changes when --pkg was used. These should use $pkgbase anyway...
Also, there are quite a few split packages that rely on the first first split-package being packaged for the rest of the package functions to work. This will become more prevalent when a way to do a "make install" followed by moving files into different packages becomes available (i.e. rpm packaging style - I am working on this).
So... essentially, it is (debatably) broken and will become more broken in the future
On 23/09/15 00:40, Que Quotion wrote:
In other words, rather than fix the packages to be safer and more logical, go ahead and let people write sloppy PKGBUILDs?
No - quite the opposite. Not all issues with --pkg are due to sloppy packaging. Some are due to the way files are split across packages which requires all packaging functions to be run. Providing a better way to split packages like these that do not have nice "make install" targets for each subpackage will break --pkg completely.
For what it's worth, I think this is a bad idea.
The changes needed to fix the packages are small, and this would reduce the ability of users to automate upgrading from ABS.
If you are building everything from ABS, waiting for a couple of extra packages to compress will be trivial. Also, how does this reduce your ability to automate updating from ABS? You already need to map the package to its PKGBUILD, so then you build that and install only the packages you need. Allan
Case in point, I had some trouble pakaging several packages today. One was libsystemd, which I've already submitted a patch for. https://bugs.archlinux.org/task/46382 Another was libutil-lnux, which will need a little more help. https://bugs.archlinux.org/task/46383 In both cases $pkgname was used where $pkgbase should be (fixed in an earlier report for systemd) and then both packages use one package_something() function to put files in place for another package_somethingelse() function--both by moving files from $pkgdir into $srcdir. This seems like bad practice to me, isn't necessary, and could be done better: My proposal for systemd shortens the PKGBUILD by a few lines and doesn't touch $srcdir. Removing the "--pkg" feature of makepkg will only allow more bad practice that will be harder to undo should we change our minds down the line. On Tue, Sep 22, 2015 at 11:40 PM, Que Quotion <quequotion@gmail.com> wrote:
In other words, rather than fix the packages to be safer and more logical, go ahead and let people write sloppy PKGBUILDs?
For what it's worth, I think this is a bad idea.
The changes needed to fix the packages are small, and this would reduce the ability of users to automate upgrading from ABS.
On Tue, Sep 22, 2015 at 11:33 PM, Allan McRae <allan@archlinux.org> wrote:
On 23/09/15 00:20, Pierre Neidhardt wrote:
I might have missed something in the previous messages, but is there any rationale on this, beside debatable worthiness?
Many packages break when using this.
Some are because assumptions made on build() about the value of $pkgname which changes when --pkg was used. These should use $pkgbase anyway...
Also, there are quite a few split packages that rely on the first first split-package being packaged for the rest of the package functions to work. This will become more prevalent when a way to do a "make install" followed by moving files into different packages becomes available (i.e. rpm packaging style - I am working on this).
So... essentially, it is (debatably) broken and will become more broken in the future
On Tue, Sep 22, 2015 at 04:20:45PM +0200, Pierre Neidhardt wrote:
I might have missed something in the previous messages, but is there any rationale on this, beside debatable worthiness?
It's terribly broken as implemented (overwriting the pkgname array from the PKGBUILD), and it's a misfeature. We should not allow cherrypicking random packages out of a PKGBUILD. If you don't want to install all of them, that's fine. But we should force everything to be built. Not doing this means that there can silently exist package order dependencies between package functions. And really, what does this save you? The build is generally the longest step of any packaging task -- not the packaging itself.
On 15-09-23 00:04:23, Allan McRae wrote:
Signed-off-by: Allan McRae <allan@archlinux.org> --- scripts/makepkg.sh.in | 8 -------- 1 file changed, 8 deletions(-)
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 793d42c..6ededa3 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -76,7 +76,6 @@ NOBUILD=0 NODEPS=0 NOEXTRACT=0 PKGFUNC=0 -PKGLIST=() PKGVERFUNC=0 PREPAREFUNC=0 REPKG=0 @@ -1718,7 +1717,6 @@ usage() { printf -- "$(gettext " --noprepare Do not run the %s function in the %s")\n" "prepare()" "$BUILDSCRIPT" printf -- "$(gettext " --nosign Do not create a signature for the package")\n" printf -- "$(gettext " --packagelist Only list packages that would be produced, without PKGEXT")\n" - printf -- "$(gettext " --pkg <list> Only build listed packages from a split package")\n" printf -- "$(gettext " --printsrcinfo Print the generated SRCINFO and exit")\n" printf -- "$(gettext " --sign Sign the resulting package with %s")\n" "gpg" printf -- "$(gettext " --skipchecksums Do not verify checksums of the source files")\n" @@ -1808,7 +1806,6 @@ while true; do --nosign) SIGNPKG='n' ;; -o|--nobuild) NOBUILD=1 ;; -p) shift; BUILDFILE=$1 ;; - --pkg) shift; IFS=, read -ra p <<<"$1"; PKGLIST+=("${p[@]}"); unset p ;; --packagelist) PACKAGELIST=1 IGNOREARCH=1;; --printsrcinfo) PRINTSRCINFO=1 ;; -r|--rmdeps) RMDEPS=1 ;; @@ -2060,11 +2057,6 @@ elif [[ $SPLITPKG -eq 0 ]] && have_function package_${pkgname}; then SPLITPKG=1 fi
-if [[ -n "${PKGLIST[@]}" ]]; then - unset pkgname - pkgname=("${PKGLIST[@]}") -fi - # check if gpg signature is to be created and if signing key is valid if { [[ -z $SIGNPKG ]] && check_buildenv "sign" "y"; } || [[ $SIGNPKG == 'y' ]]; then SIGNPKG='y' -- 2.5.3
-- Pierre Neidhardt
Q: Why was Stonehenge abandoned? A: It wasn't IBM compatible.
participants (4)
-
Allan McRae
-
Dave Reisner
-
Pierre Neidhardt
-
Que Quotion