[pacman-dev] [PATCH] makepkg: Add EXTRAVERSION field to package filenames
From 92f67cdcff4cbec3c5c9d6b0ca17a6f71fdf87b9 Mon Sep 17 00:00:00 2001 From: Anders Bergh <anders1@gmail.com> Date: Fri, 23 Oct 2009 00:11:05 +0200 Subject: [PATCH] makepkg: Add EXTRAVERSION field to package filenames. This is intended for packages compiled to run on another operating system than Linux, such as cygwin or Darwin. It is set using --with-pkg-extra-version.
The package filename format is as follows: {name}-{version}-{rel}-{extraversion}{arch}{ext} Signed-off-by: Anders Bergh <anders1@gmail.com> --- configure.ac | 6 ++++++ etc/makepkg.conf.in | 1 + scripts/makepkg.sh.in | 24 ++++++++++++------------ 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index dada0dd..30c25fb 100644 --- a/configure.ac +++ b/configure.ac @@ -88,6 +88,11 @@ AC_ARG_WITH(db-ext, AS_HELP_STRING([--with-db-ext=ext], [set the file extension used by the database]), [DBEXT=$withval], [DBEXT=.db.tar.gz]) +# Help line for extra version field +AC_ARG_WITH(pkg-extra-version, + AS_HELP_STRING([--with-pkg-extra-version=ver], [add extra version field to package filenames]), + [EXTRAVERSION=$withval], [EXTRAVERSION=]) + # Help line for buildscript filename AC_ARG_WITH(buildscript, AS_HELP_STRING([--with-buildscript=name], [set the build script name used by makepkg]), @@ -378,6 +383,7 @@ ${PACKAGE_NAME}: source pkg extension : ${SRCEXT} database extension : ${DBEXT} build script name : ${BUILDSCRIPT} + extra version : ${EXTRAVERSION} Compilation options: Run make in doc/ dir : ${wantdoc} diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in index 3a3a415..a16f71e 100644 --- a/etc/makepkg.conf.in +++ b/etc/makepkg.conf.in @@ -103,5 +103,6 @@ PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod) # PKGEXT='@PKGEXT@' SRCEXT='@SRCEXT@' +EXTRAVERSION='@EXTRAVERSION@' # vim: set ft=sh ts=2 sw=2 et: diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 40367ae..219d59e 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -158,12 +158,12 @@ clean_up() { rm -rf "$pkgdir" "$srcdir" if [ -n "$pkgname" ]; then # Can't do this unless the BUILDSCRIPT has been sourced. - rm -f "${pkgbase}-${pkgver}-${pkgrel}-${CARCH}-build.log"* + rm -f "${pkgbase}-${pkgver}-${pkgrel}-${EXTRAVERSION}${CARCH}-build.log"* if [ "$PKGFUNC" -eq 1 ]; then - rm -f "${pkgbase}-${pkgver}-${pkgrel}-${CARCH}-package.log"* + rm -f "${pkgbase}-${pkgver}-${pkgrel}-${EXTRAVERSION}${CARCH}-package.log"* elif [ "$SPLITPKG" -eq 1 ]; then for pkg in ${pkgname[@]}; do - rm -f "${pkg}-${pkgver}-${pkgrel}-${CARCH}-package.log"* + rm -f "${pkg}-${pkgver}-${pkgrel}-${EXTRAVERSION}${CARCH}-package.log"* done fi fi @@ -730,7 +730,7 @@ run_function() { local ret=0 if [ "$LOGGING" -eq 1 ]; then - BUILDLOG="${startdir}/${pkgname}-${pkgver}-${pkgrel}-${CARCH}-$pkgfunc.log" + BUILDLOG="${startdir}/${pkgname}-${pkgver}-${pkgrel}-${EXTRAVERSION}${CARCH}-$pkgfunc.log" if [ -f "$BUILDLOG" ]; then local i=1 while true; do @@ -1015,7 +1015,7 @@ create_package() { *) warning "$(gettext "'%s' is not a valid archive extension.")" \ "$PKGEXT" ; EXT=$PKGEXT ;; esac - local pkg_file="$PKGDEST/${nameofpkg}-${pkgver}-${pkgrel}-${PKGARCH}${EXT}" + local pkg_file="$PKGDEST/${nameofpkg}-${pkgver}-${pkgrel}-${EXTRAVERSION}${PKGARCH}${EXT}" local ret=0 @@ -1121,10 +1121,10 @@ install_package() { local pkglist for pkg in ${pkgname[@]}; do - if [ -f $PKGDEST/${pkg}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT} ]; then - pkglist="${pkglist} $PKGDEST/${pkg}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}" + if [ -f $PKGDEST/${pkg}-${pkgver}-${pkgrel}-${EXTRAVERSION}${CARCH}${PKGEXT} ]; then + pkglist="${pkglist} $PKGDEST/${pkg}-${pkgver}-${pkgrel}-${EXTRAVERSION}${CARCH}${PKGEXT}" else - pkglist="${pkglist} $PKGDEST/${pkg}-${pkgver}-${pkgrel}-any${PKGEXT}" + pkglist="${pkglist} $PKGDEST/${pkg}-${pkgver}-${pkgrel}-${EXTRAVERSION}any${PKGEXT}" fi done @@ -1721,8 +1721,8 @@ fi pkgbase=${pkgbase:-${pkgname[0]}} if [ "$SPLITPKG" -eq 0 ]; then - if [ \( -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}" \ - -o -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-any${PKGEXT}" \) \ + if [ \( -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${EXTRAVERSION}${CARCH}${PKGEXT}" \ + -o -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${EXTRAVERSION}any${PKGEXT}" \) \ -a "$FORCE" -eq 0 -a "$SOURCEONLY" -eq 0 -a "$NOBUILD" -eq 0 ]; then if [ "$INSTALL" -eq 1 ]; then warning "$(gettext "A package has already been built, installing existing package...")" @@ -1737,8 +1737,8 @@ else allpkgbuilt=1 somepkgbuilt=0 for pkg in ${pkgname[@]}; do - if [ \( -f "$PKGDEST/${pkg}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}" \ - -o -f "$PKGDEST/${pkg}-${pkgver}-${pkgrel}-any${PKGEXT}" \) ]; then + if [ \( -f "$PKGDEST/${pkg}-${pkgver}-${pkgrel}-${EXTRAVERSION}${CARCH}${PKGEXT}" \ + -o -f "$PKGDEST/${pkg}-${pkgver}-${pkgrel}-${EXTRAVERSION}any${PKGEXT}" \) ]; then somepkgbuilt=1 else allpkgbuilt=0 -- 1.6.5.1
Anders Bergh wrote:
From 92f67cdcff4cbec3c5c9d6b0ca17a6f71fdf87b9 Mon Sep 17 00:00:00 2001 From: Anders Bergh <anders1@gmail.com> Date: Fri, 23 Oct 2009 00:11:05 +0200 Subject: [PATCH] makepkg: Add EXTRAVERSION field to package filenames. This is intended for packages compiled to run on another operating system than Linux, such as cygwin or Darwin. It is set using --with-pkg-extra-version.
The package filename format is as follows:
{name}-{version}-{rel}-{extraversion}{arch}{ext}
Signed-off-by: Anders Bergh <anders1@gmail.com> ---
I'm not sure why this is needed and will need more explanation... is this so foo-1-1-i686.pkg.tar.gz does not have the same file name on (e.g.) windows and linux? Surely they would be in different repos and the name conflict will never arrive. Allan
On Fri, Oct 23, 2009 at 02:37, Allan McRae <allan@archlinux.org> wrote:
Anders Bergh wrote:
From 92f67cdcff4cbec3c5c9d6b0ca17a6f71fdf87b9 Mon Sep 17 00:00:00 2001 From: Anders Bergh <anders1@gmail.com> Date: Fri, 23 Oct 2009 00:11:05 +0200 Subject: [PATCH] makepkg: Add EXTRAVERSION field to package filenames. This is intended for packages compiled to run on another operating system than Linux, such as cygwin or Darwin. It is set using --with-pkg-extra-version.
The package filename format is as follows:
{name}-{version}-{rel}-{extraversion}{arch}{ext}
Signed-off-by: Anders Bergh <anders1@gmail.com> ---
I'm not sure why this is needed and will need more explanation... is this so foo-1-1-i686.pkg.tar.gz does not have the same file name on (e.g.) windows and linux? Surely they would be in different repos and the name conflict will never arrive.
Allan
I am working on a basic port of Arch to another kernel, and I thought it would be nice to have those packages make it obvious they're not going to work on Linux. For instance, if someone were to Google the package filenames and find my repository they might not be able to tell that it's not going to work on their system. But I do agree it's not strictly necessary. -- Anders Bergh
Anders Bergh wrote:
On Fri, Oct 23, 2009 at 02:37, Allan McRae <allan@archlinux.org> wrote:
Anders Bergh wrote:
From 92f67cdcff4cbec3c5c9d6b0ca17a6f71fdf87b9 Mon Sep 17 00:00:00 2001 From: Anders Bergh <anders1@gmail.com> Date: Fri, 23 Oct 2009 00:11:05 +0200 Subject: [PATCH] makepkg: Add EXTRAVERSION field to package filenames. This is intended for packages compiled to run on another operating system than Linux, such as cygwin or Darwin. It is set using --with-pkg-extra-version.
The package filename format is as follows:
{name}-{version}-{rel}-{extraversion}{arch}{ext}
Signed-off-by: Anders Bergh <anders1@gmail.com> ---
I'm not sure why this is needed and will need more explanation... is this so foo-1-1-i686.pkg.tar.gz does not have the same file name on (e.g.) windows and linux? Surely they would be in different repos and the name conflict will never arrive.
Allan
I am working on a basic port of Arch to another kernel, and I thought it would be nice to have those packages make it obvious they're not going to work on Linux. For instance, if someone were to Google the package filenames and find my repository they might not be able to tell that it's not going to work on their system.
But I do agree it's not strictly necessary.
I have actually been thinking about this as I have a (somewhat working) i686-pc-kfreebsd-gnu cross-compuler and wondered how I would distinguish the i686's. I also made and i686-pc-mingw32 compiler for yet another i686... Then I realized that you can always make CARCH="i686-bsd".However, if you I provide a repo, and people are downloading packages, they should know whether they are good for their install before trying to install them. tl;dr: I see the issue but do not know if it is necessary to solve. Any other opinions? Allan
participants (2)
-
Allan McRae
-
Anders Bergh