[pacman-dev] [PATCH] makepkg: Add used options to PKGINFO file
Adds defined options to the PKGINFO file in the form of "makepkgopt =". It may be useful to be able to add these to the pacman DB at some point as that would allow (e.g.) checking which packages have had their docs striped (FS#7092). Signed-off-by: Allan McRae <allan@archlinux.org> --- scripts/makepkg.sh.in | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 379e9d8..5bed00e 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -823,6 +823,16 @@ create_package() { for it in "${backup[@]}"; do echo "backup = $it" >>.PKGINFO done + for it in "${known_options[@]}"; do + local ret="$(check_option $it)" + if [ "$ret" != "?" ]; then + if [ "$ret" = "y" ]; then + echo "makepkgopt = $it" >>.PKGINFO + else + echo "makepkgopt = !$it" >>.PKGINFO + fi + fi + done # TODO maybe remove this at some point # warn if license array is not present or empty -- 1.5.6.4
Allan McRae wrote:
Adds defined options to the PKGINFO file in the form of "makepkgopt =". It may be useful to be able to add these to the pacman DB at some point as that would allow (e.g.) checking which packages have had their docs striped (FS#7092).
This is more of a "might be a good idea" patch being put out there to gather opinions. Allan
On Thu, Jul 24, 2008 at 2:41 PM, Allan McRae <allan@archlinux.org> wrote:
Allan McRae wrote:
Adds defined options to the PKGINFO file in the form of "makepkgopt =". It may be useful to be able to add these to the pacman DB at some point as that would allow (e.g.) checking which packages have had their docs striped (FS#7092).
This is more of a "might be a good idea" patch being put out there to gather opinions.
This might be a good idea :) But apparently known options regroup both BUILDENV and OPTIONS array. In my opinion, only OPTIONS is interesting. And then, we might want to just include enabled options, for the sake of being concise.
Xavier wrote:
On Thu, Jul 24, 2008 at 2:41 PM, Allan McRae <allan@archlinux.org> wrote:
Allan McRae wrote:
Adds defined options to the PKGINFO file in the form of "makepkgopt =". It may be useful to be able to add these to the pacman DB at some point as that would allow (e.g.) checking which packages have had their docs striped (FS#7092).
This is more of a "might be a good idea" patch being put out there to gather opinions.
This might be a good idea :) But apparently known options regroup both BUILDENV and OPTIONS array. In my opinion, only OPTIONS is interesting. And then, we might want to just include enabled options, for the sake of being concise.
Good point about the build options being useless. But I think all other options should go in so if/when we add further options we would know they are not used in the package. Dan: My git-foo was weak and I noticed this was on my working branch that you pulled in. Do you want to remove it or I can patch the patch? Allan
On Thu, Jul 24, 2008 at 8:08 PM, Allan McRae <allan@archlinux.org> wrote:
Xavier wrote:
On Thu, Jul 24, 2008 at 2:41 PM, Allan McRae <allan@archlinux.org> wrote:
Allan McRae wrote:
Adds defined options to the PKGINFO file in the form of "makepkgopt =". It may be useful to be able to add these to the pacman DB at some point as that would allow (e.g.) checking which packages have had their docs striped (FS#7092).
This is more of a "might be a good idea" patch being put out there to gather opinions.
This might be a good idea :) But apparently known options regroup both BUILDENV and OPTIONS array. In my opinion, only OPTIONS is interesting. And then, we might want to just include enabled options, for the sake of being concise.
Good point about the build options being useless. But I think all other options should go in so if/when we add further options we would know they are not used in the package.
Dan: My git-foo was weak and I noticed this was on my working branch that you pulled in. Do you want to remove it or I can patch the patch?
Hmm? I definitely haven't pulled it yet. -Dan
Dan McGee wrote:
On Thu, Jul 24, 2008 at 8:08 PM, Allan McRae <allan@archlinux.org> wrote:
Xavier wrote:
On Thu, Jul 24, 2008 at 2:41 PM, Allan McRae <allan@archlinux.org> wrote:
Allan McRae wrote:
Adds defined options to the PKGINFO file in the form of "makepkgopt =". It may be useful to be able to add these to the pacman DB at some point as that would allow (e.g.) checking which packages have had their docs striped (FS#7092).
This is more of a "might be a good idea" patch being put out there to gather opinions.
This might be a good idea :) But apparently known options regroup both BUILDENV and OPTIONS array. In my opinion, only OPTIONS is interesting. And then, we might want to just include enabled options, for the sake of being concise.
Good point about the build options being useless. But I think all other options should go in so if/when we add further options we would know they are not used in the package.
Dan: My git-foo was weak and I noticed this was on my working branch that you pulled in. Do you want to remove it or I can patch the patch?
Hmm? I definitely haven't pulled it yet.
Doh! I must of clicked the wrong bookmark when looking at (obviously not) your gitweb page... :facepalm: And the day is only just begun... what other mistakes can Allan make today? Allan
On Fri, Jul 25, 2008 at 3:08 AM, Allan McRae <allan@archlinux.org> wrote:
Good point about the build options being useless. But I think all other options should go in so if/when we add further options we would know they are not used in the package.
If we always put all (and only) enabled options, it should be fine. If not, do you have an example to illustrate the problem?
Xavier wrote:
On Fri, Jul 25, 2008 at 3:08 AM, Allan McRae <allan@archlinux.org> wrote:
Good point about the build options being useless. But I think all other options should go in so if/when we add further options we would know they are not used in the package.
If we always put all (and only) enabled options, it should be fine. If not, do you have an example to illustrate the problem?
For example, consider packages that were built before the new zipman option. Old packages are build with the equivalent of the zipman option being enabled. With only including enabled options, a first look at a package built prior to this option would indicate that man pages were not zipped which is wrong. Including both enabled and disabled options would tell us that the option just didn't exist at the time. Allan
On Fri, Jul 25, 2008 at 1:37 PM, Allan McRae <allan@archlinux.org> wrote:
For example, consider packages that were built before the new zipman option. Old packages are build with the equivalent of the zipman option being enabled. With only including enabled options, a first look at a package built prior to this option would indicate that man pages were not zipped which is wrong. Including both enabled and disabled options would tell us that the option just didn't exist at the time.
Yep, that is right, nevermind :)
participants (3)
-
Allan McRae
-
Dan McGee
-
Xavier