OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Ralf S. Engelschall
  Root:   /e/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   22-Jan-2004 22:23:36
  Branch: HEAD                             Handle: 2004012221233500

  Modified files:
    openpkg-src/openpkg     HISTORY aux.wrapsrc.sh openpkg.boot openpkg.spec
                            rpmmacros rpmpopt

  Log:
    add "rpm --tag <string>" support for tagging binary RPMs with
    arbitrary strings

  Summary:
    Revision    Changes     Path
    1.112       +1  -0      openpkg-src/openpkg/HISTORY
    1.12        +1  -1      openpkg-src/openpkg/aux.wrapsrc.sh
    1.42        +14 -16     openpkg-src/openpkg/openpkg.boot
    1.270       +5  -9      openpkg-src/openpkg/openpkg.spec
    1.49        +26 -7      openpkg-src/openpkg/rpmmacros
    1.10        +5  -0      openpkg-src/openpkg/rpmpopt
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/openpkg/HISTORY
  ============================================================================
  $ cvs diff -u -r1.111 -r1.112 HISTORY
  --- openpkg-src/openpkg/HISTORY       22 Jan 2004 08:39:43 -0000      1.111
  +++ openpkg-src/openpkg/HISTORY       22 Jan 2004 21:23:35 -0000      1.112
  @@ -2,6 +2,7 @@
   2004
   ====
   
  +20040122 add "rpm --tag <string>" support for tagging binary RPMs with arbitrary 
strings
   20040122 upgrade to latest GNU shtool snapshot for better RHL/RHEL detection and 
naming
   20040121 cleanup openpkg.spec by sorting SourceX headers
   20040120 add OSSP uuid and companion uuid.sh frontend to provide new 
<prefix>/etc/openpkg/uuid
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/openpkg/aux.wrapsrc.sh
  ============================================================================
  $ cvs diff -u -r1.11 -r1.12 aux.wrapsrc.sh
  --- openpkg-src/openpkg/aux.wrapsrc.sh        31 Oct 2003 16:29:37 -0000      1.11
  +++ openpkg-src/openpkg/aux.wrapsrc.sh        22 Jan 2004 21:23:35 -0000      1.12
  @@ -56,7 +56,7 @@
   fi
   if [ ".$o_help" = .yes ]; then
       echo "Usage: sh $l_me --prefix=<prefix>" 2>&1
  -    echo "       [--user=<usr>] [--group=<grp>]" 2>&1
  +    echo "       [--user=<usr>] [--group=<grp>] [--tag=<str>]" 2>&1
       echo "       [--{s,m,r,n}usr=<usr>] [--{s,m,r,n}grp=<grp>]" 2>&1
       echo "       [--{s,m,r,n}uid=<uid>] [--{s,m,r,n}gid=<gid>]" 2>&1
       echo "       [-h|--help] [-v|--version]" 2>&1
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/openpkg/openpkg.boot
  ============================================================================
  $ cvs diff -u -r1.41 -r1.42 openpkg.boot
  --- openpkg-src/openpkg/openpkg.boot  20 Jan 2004 16:56:12 -0000      1.41
  +++ openpkg-src/openpkg/openpkg.boot  22 Jan 2004 21:23:35 -0000      1.42
  @@ -47,6 +47,7 @@
   help=0
   verbose=''
   prefix=''
  +tag=''
   usr='';  grp=''
   susr=''; sgrp=''
   musr=''; mgrp=''
  @@ -69,6 +70,7 @@
           -h | --help          ) help=1      ;;
           -v | --verbose       ) verbose=v   ;;
           --prefix=*           ) prefix=$arg ;;
  +        --tag=*              ) tag=$arg    ;;
           --usr=* | --user=*   ) usr=$arg    ;;
           --grp=* | --group=*  ) grp=$arg    ;;
           --susr=*             ) susr=$arg   ;;
  @@ -96,7 +98,7 @@
   fi
   if [ ".$help" = .1 ]; then
       echo "Usage: sh $me [-h|--help] [-v|--verbose]" 2>&1
  -    echo "       --prefix=<prefix> [--user=<usr>] [--group=<grp>]" 2>&1
  +    echo "       --prefix=<prefix> [--user=<usr>] [--group=<grp>] [--tag=<str>]" 
2>&1
       echo "       [--{s,m,r,n}usr=<usr>] [--{s,m,r,n}grp=<grp>]" 2>&1
       exit 1
   fi
  @@ -113,6 +115,14 @@
         --ruid="$ruid" --rgid="$rgid" \
         --nuid="$nuid" --ngid="$ngid"`
   
  +#   canonicalize prefix
  +prefix=`echo "$prefix" | sed -e 's;//*;/;g' -e 's;/$;;'`
  +
  +#   provide default package tag
  +if [ ".$tag" = . ]; then
  +    tag="<loc>"
  +fi
  +
   ##
   ##  determine package information
   ##
  @@ -205,18 +215,6 @@
   fi
   
   ##
  -##  calculate location id
  -##
  -
  -prefix=`echo "$prefix" | sed -e 's;//*;/;g' -e 's;/$;;'`
  -if [ ".`expr $prefix : '/[^/][^/]*$'`" != .0 ]; then
  -    loc=`echo $prefix | cut -c2-4`
  -else
  -    loc=`echo $prefix | sed -e 's;/\(.\)[^/]*;\1;g' | cut -c1-3`
  -fi
  -echo "++ location id: $loc"
  -
  -##
   ##  determine distribution directory
   ##
   
  @@ -316,7 +314,7 @@
     echo "_tmppath=$tmpdir" 
     echo "_builddir=$tmpdir" 
     echo "l_prefix=$prefix"
  -  echo "l_location=$loc"
  +  echo "l_tag_fmt=\"$tag\""
     echo "l_buildroot=$tmpdir/$name-$version-root"
     echo "l_susr=$susr"
     echo "l_sgrp=$sgrp"
  @@ -440,7 +438,7 @@
       -e "s;@RGRP@;$rgrp;" \
       -e "s;@NUSR@;$nusr;" \
       -e "s;@NGRP@;$ngrp;" \
  -    -e "s;@LOC@;$loc;" \
  +    -e "s;@TAG@;$tag;" \
       -e "s;^\\(%l_root_install *\\)@l_prefix@;\\1 $prefix;" \
       -e "s;^\\(%l_root_rpm *\\)@l_prefix@;\\1 $RPM_BUILD_ROOT$prefix;" \
       -e "s;@l_prefix@;$RPM_BUILD_ROOT$prefix;" \
  @@ -507,7 +505,7 @@
   ##  permanent location.
   
   v="$version-$release"
  -t="`$tmpdir/rpm --eval '%{l_platform -p}'`-$loc"
  +t="`$tmpdir/rpm --eval '%{l_platform -p}-%{l_tag}'`"
   
   #   find a reasonable destination directory for packages
   if [ -d ../PKG/BIN ]; then
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/openpkg/openpkg.spec
  ============================================================================
  $ cvs diff -u -r1.269 -r1.270 openpkg.spec
  --- openpkg-src/openpkg/openpkg.spec  22 Jan 2004 08:39:43 -0000      1.269
  +++ openpkg-src/openpkg/openpkg.spec  22 Jan 2004 21:23:35 -0000      1.270
  @@ -307,16 +307,12 @@
       set +x; VERBOSE "PREPARATION: Determine OpenPKG Instance Environment"
   
       #   determine installation location id
  -    if [ ".%{?l_location:set}" = .set ]; then
  -        loc="%{l_location}"
  +    if [ ".%{?l_tag_fmt:set}" = .set ]; then
  +        tag="%{l_tag_fmt}"
       else
  -        if [ ".`expr %{l_prefix} : '/[^/][^/]*$'`" != .0 ]; then
  -            loc=`echo %{l_prefix} | cut -c2-4`
  -        else
  -            loc=`echo %{l_prefix} | sed -e 's;/\(.\)[^/]*;\1;g' | cut -c1-3`
  -        fi
  +        tag="<loc>"
       fi
  -    echo "loc=\"$loc\"; export loc" >>.buildenv
  +    echo "tag=\"$tag\"; export tag" >>.buildenv
   
       #   determine platform id
       s=`(uname -s) 2>/dev/null` || s='Unknown'
  @@ -931,7 +927,7 @@
           -e "s;@l_build_path@;$l_build_path;g" \
           -e "s;@l_build_ldlp@;$l_build_ldlp;g" \
           -e "s;@l_build_ulim@;$l_build_ulim;g" \
  -        -e "s:@LOC@:$loc:g" \
  +        -e "s:@TAG@:$tag:g" \
           -e "s:@SUSR@:$susr:g" \
           -e "s:@SGRP@:$sgrp:g" \
           -e "s:@MUSR@:$musr:g" \
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/openpkg/rpmmacros
  ============================================================================
  $ cvs diff -u -r1.48 -r1.49 rpmmacros
  --- openpkg-src/openpkg/rpmmacros     2 Jan 2004 15:53:00 -0000       1.48
  +++ openpkg-src/openpkg/rpmmacros     22 Jan 2004 21:23:35 -0000      1.49
  @@ -29,8 +29,26 @@
   #   the OpenPKG release identification (for the current package or as a fallback 
for the bootstrap package)
   %l_openpkg_release(F:)   %(echo "%{?release}%{!?release:%(@l_prefix@/bin/rpm -q 
--qf '%{release}' openpkg)}" | sed -e 's;^;X;' -e 
's;^X\\([0-9][0-9]*\\.[0-9][0-9]*\\).*$;\\1;' -e 
's;^X\\([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\\)$;CURRENT;' -e 's;^X.*$;UNKNOWN;' | 
awk '{ printf(%{?-F:%{-F*}}%{!?-F:"OpenPKG-%s"}, $0); }')
   
  -#   the OpenPKG instance location
  -%l_location              @LOC@
  +#   the OpenPKG OIDs (root is officially registered at IANA)
  +%l_openpkg_oid           1.3.6.1.4.1.18749
  +%l_openpkg_oid_bootstrap %{l_openpkg_oid}.4.1
  +%l_openpkg_oid_instance  %{l_openpkg_oid_bootstrap}.1
  +%l_openpkg_oid_platform  %{l_openpkg_oid_bootstrap}.2
  +%l_openpkg_oid_tagfmtopt %{l_openpkg_oid_bootstrap}.3
  +
  +#   the OpenPKG package tagging
  +%l_tag_fmt               @TAG@
  +%l_tag_fmt_loc           %(echo "%{l_prefix}" | sed -e 
's;^/\\([^/]\\)[^/]*/\\([^/]\\)[^/]*/\\([^/]\\).*;\\1\\2\\3;' -e 
's;^/\\([^/]\\)[^/]*/\\([^/][^/]\\).*;\\1\\2;' -e 
's;^/\\([^/][^/]\\)[^/]*/\\([^/]\\).*;\\1\\2;' -e 
's;^/\\([^/]\\)[^/]*/\\([^/]\\).*;\\1\\2;' -e 's;^/\\([^/][^/][^/]\\).*;\\1;' -e 
's;^/\\([^/][^/]\\).*;\\1;' -e 's;^/\\([^/]\\).*;\\1;')
  +%l_tag_fmt_opt           %(uuid_ns="`%{l_uuid} -v3 ns:OID 
%{l_openpkg_oid_tagfmtopt}`"; %{l_uuid} -v3 $uuid_ns '%{?_options}')
  +%l_tag_fmt_uuid          %(%{l_uuid} -v1)
  +%l_tag_fmt_time          %(date '+%%Y%%m%%d%%H%%M%%S')
  +%l_tag_fmt_user          %(%{l_shtool} echo -e '%u')
  +%l_tag_fmt_host          %(%{l_shtool} echo -e '%h%d')
  +%l_tag_gen               %{expand:%(echo '%{l_tag_fmt}' | sed -e 
's/<\\([a-zA-Z][_a-zA-Z0-9]*\\)>/%%{l_tag_fmt_\\1}/g')}
  +%l_tag                   %(echo "%{l_tag_gen}" | sed -e 's;-;;g')
  +
  +#   the OpenPKG instance location (backward compatibility only)
  +%l_location              %{l_tag}
   
   #   standard RPM host platform identification
   #   (defaults via "shtool platform" and uname(3); used internally)
  @@ -217,6 +235,7 @@
   %l_shtool                %{l_prefix}/lib/openpkg/shtool
   %l_curl                  %{l_prefix}/lib/openpkg/curl
   %l_bash                  %{l_prefix}/lib/openpkg/bash
  +%l_uuid                  %{l_prefix}/lib/openpkg/uuid
   
   #   provide smart paths to tools
   %l_tool_locate()         %(if [ ".%{expand:%%{?use_%1}}" != . ]; then 
tool="%{expand:%%{use_%1}}"; elif [ -f "%{l_bindir}/%2" ]; then tool="%{l_bindir}/%2"; 
elif [ -f "%{l_prefix}/lib/openpkg/%2" ]; then tool="%{l_prefix}/lib/openpkg/%2"; else 
tool="%2"; fi; echo $tool)
  @@ -269,10 +288,10 @@
   %_install_script_path    
@l_prefix@/bin:@l_prefix@/sbin:/bin:/sbin:/usr/bin:/usr/sbin
   
   #   override the name scheme for RPM files
  -%_rpmfilename            [EMAIL PROTECTED]@.rpm
  -%_build_name_fmt         [EMAIL PROTECTED]@.rpm
  -%_repackage_name_fmt     [EMAIL PROTECTED]@.rpm
  -%_solve_name_fmt         %{_solve_pkgsdir}/[EMAIL PROTECTED]@.rpm
  +%_rpmfilename            
%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}-%%{OS}-%{l_tag}.rpm
  +%_build_name_fmt         
%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}-%%{OS}-%{l_tag}.rpm
  +%_repackage_name_fmt     
%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}-%%{OS}-%{l_tag}.rpm
  +%_solve_name_fmt         
%{_solve_pkgsdir}/%%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}-%%{OS}-%{l_tag}.rpm
   
   #   override the payload compression for the CPIO parts of an RPM 
   #   (we use the equivalent of "bzip2 -9")
  @@ -289,7 +308,7 @@
   %ifndef()                %if %{expand:%%{?%{1}:0}%%{!?%{1}:1}}
   
   #   macro for package option configuration
  -%option()                %{expand:%%{!?%{1}:%%global %*}} \
  +%option()                %{expand:%%{!?%{1}:%%global %*}} %{expand:%%global 
_options %{?_options:%{_options}:}%{1}=%%%{1}} \
   Provides: %{name}::%{1} = %(echo '%{expand:%%{%{1}}}' | sed -e 's;%%;%%%%;g' -e 's; 
;%%20;g' -e 's;  ;%%09;g')
   
   #   macros for NoSource/NoPatch (distribution restriction) integrity handling
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/openpkg/rpmpopt
  ============================================================================
  $ cvs diff -u -r1.9 -r1.10 rpmpopt
  --- openpkg-src/openpkg/rpmpopt       20 Oct 2003 15:26:26 -0000      1.9
  +++ openpkg-src/openpkg/rpmpopt       22 Jan 2004 21:23:35 -0000      1.10
  @@ -57,6 +57,11 @@
       --POPTdesc=$"set '%option <name> <value>'" \
       --POPTargs=$"<name> <value>"
   
  +#   RPM extension: "rpm --tag <string>"
  +rpm alias --tag --define "l_tag_fmt !#:+" \
  +    --POPTdesc=$"set binary package filename tag'" \
  +    --POPTargs=$"<string>"
  +
   #   RPM extension: "rpm --db-{build,rebuild,cleanup,fixate}"
   rpm exec --db-build   rpmdb --build \
       --POPTdesc=$"RPM database administration: build new database (destructive 
operation; you have to know what you are doing)"
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to