[CVS] OpenPKG: openpkg-registry/ register.sh
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Thomas Lotterer Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 24-Aug-2007 14:02:45 Branch: HEAD Handle: 2007082413024500 Modified files: openpkg-registryregister.sh Log: remove legacy code which had the side effect of the REGISTRY_UUID file being touched hourly; update documentation Summary: RevisionChanges Path 1.65+1 -20 openpkg-registry/register.sh patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.64 -r1.65 register.sh --- openpkg-registry/register.sh 21 Mar 2007 10:02:32 - 1.64 +++ openpkg-registry/register.sh 24 Aug 2007 12:02:45 - 1.65 @@ -72,14 +72,6 @@ { [ .$REGISTRY_CONF = . ] return if [ -r $REGISTRY_CONF ]; then - -# upgrade safety for changed variable name -# please remove this code after 2007-06 snapshot -$PREFIX/lib/openpkg/shtool subst \ --e 's;^\( *REGISTRY_UUID *= *[^/].*\)$;#\1;' \ -$REGISTRY_CONF \ -/dev/null 21 || true - sanitycheck $REGISTRY_CONF . $REGISTRY_CONF fi } @@ -88,14 +80,6 @@ { [ .$REGISTRY_UUID = . ] return if [ -r $REGISTRY_UUID ]; then - -# upgrade safety for changed variable name -# please remove this code after 2007-06 snapshot -$PREFIX/lib/openpkg/shtool subst \ --e 's;^ *REGISTRY_UUID *=;REGISTRY_DBID=;' \ -$REGISTRY_UUID \ -/dev/null 21 || true - sanitycheck $REGISTRY_UUID . $REGISTRY_UUID fi } @@ -729,13 +713,10 @@ used by administrators to register an instance with the OpenPKG Registry for later association. -Automatic association is intentionally not possible and login to the web form -on http://registry.openpkg.org/ is required. - After association, Bopenpkg register can be used for repetitive reregistrations which update the heartbeat of the instance on the Registry server, avoiding premature depature from the database. It is assumed that -every instance will be reregistered every quarter of the year. Dormant +every instance will be reregistered daily. Dormant instances might be discarded from the Registry, revoking their access to additional resources. @@ . __ OpenPKG http://openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org
[CVS] OpenPKG: openpkg-registry/ register.sh
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Thomas Lotterer Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 21-Mar-2007 11:02:33 Branch: HEAD Handle: 2007032110023200 Modified files: openpkg-registryregister.sh Log: replace REGISTRY_DESC default of bash HOSTNAME with a local FQDN created by more portable shtool echo Summary: RevisionChanges Path 1.64+5 -4 openpkg-registry/register.sh patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.63 -r1.64 register.sh --- openpkg-registry/register.sh 2 Mar 2007 10:06:17 - 1.63 +++ openpkg-registry/register.sh 21 Mar 2007 10:02:32 - 1.64 @@ -29,8 +29,8 @@ # program name, version and date progname=register -progvers=1.1.1 -progdate=02-Mar-2007 +progvers=1.1.2 +progdate=21-Mar-2007 # determine path to OpenPKG instance PREFIX=@l_prefix@ @@ -113,6 +113,7 @@ ## # default parameters +FQDN=`$PREFIX/lib/openpkg/shtool echo -e '%h%d'` # primary operations op=automatic @@ -123,7 +124,7 @@ REGISTRY_ARGS=http://registry.openpkg.org/register; REGISTRY_USER= REGISTRY_LINK= -REGISTRY_DESC=openpkg://${HOSTNAME}${PREFIX} +REGISTRY_DESC=openpkg://${FQDN}${PREFIX} # advanced options # we are called from rpm URL rewrite wrapper, @@ -886,7 +887,7 @@ Indicates a human readable description of the instance. This information in submitted via the registry_desc attribute of the XML request. It appears in the description column on the association page of the web form and can be edited on the server side. -Defaults to openpkg://${HOSTNAME}${PREFIX} +Defaults to openpkg://${FQDN}${PREFIX} =back @@ . __ OpenPKG http://openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org
[CVS] OpenPKG: openpkg-registry/ register.sh
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Thomas Lotterer Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 02-Mar-2007 11:06:03 Branch: HEAD Handle: 2007030210060300 Modified files: openpkg-registryregister.sh Log: upgrade safety (compensate incorrect values in conf and util files that may occur on weird upgrade pathes) Summary: RevisionChanges Path 1.62+16 -0 openpkg-registry/register.sh patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.61 -r1.62 register.sh --- openpkg-registry/register.sh 20 Feb 2007 22:19:24 - 1.61 +++ openpkg-registry/register.sh 2 Mar 2007 10:06:03 - 1.62 @@ -72,6 +72,14 @@ { [ .$REGISTRY_CONF = . ] return if [ -r $REGISTRY_CONF ]; then + +# upgrade safety for changed variable name +# please remove this code after 2007-06 snapshot +$PREFIX/lib/openpkg/shtool subst \ +-e 's;^\( *REGISTRY_UUID *= *[^/].*\)$;#\1;' \ +$REGISTRY_CONF \ +/dev/null 21 || true + sanitycheck $REGISTRY_CONF . $REGISTRY_CONF fi } @@ -80,6 +88,14 @@ { [ .$REGISTRY_UUID = . ] return if [ -r $REGISTRY_UUID ]; then + +# upgrade safety for changed variable name +# please remove this code after 2007-06 snapshot +$PREFIX/lib/openpkg/shtool subst \ +-e 's;^ *REGISTRY_UUID *=;REGISTRY_DBID=;' \ +$REGISTRY_UUID \ +/dev/null 21 || true + sanitycheck $REGISTRY_UUID . $REGISTRY_UUID fi } @@ . __ OpenPKG http://openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org
[CVS] OpenPKG: openpkg-registry/ register.sh
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Thomas Lotterer Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 20-Feb-2007 23:19:24 Branch: HEAD Handle: 2007022022192400 Modified files: openpkg-registryregister.sh Log: make --mode=post the default; make --mode and --user optional and attempt to grab missing configuration from autoregister service; in automatic mode, do not run interaction stuff unless STDIN is tied to a terminal; log in UTC Summary: RevisionChanges Path 1.61+77 -17 openpkg-registry/register.sh patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.60 -r1.61 register.sh --- openpkg-registry/register.sh 20 Feb 2007 22:13:12 - 1.60 +++ openpkg-registry/register.sh 20 Feb 2007 22:19:24 - 1.61 @@ -29,8 +29,8 @@ # program name, version and date progname=register -progvers=1.0.1 -progdate=22-Oct-2006 +progvers=1.1.0 +progdate=20-Feb-2007 # determine path to OpenPKG instance PREFIX=@l_prefix@ @@ -102,7 +102,8 @@ op=automatic # standard options -REGISTRY_MODE= +REGISTRY_AUTO=http://openpkg.org/go/autoregister; +REGISTRY_MODE=post REGISTRY_ARGS=http://registry.openpkg.org/register; REGISTRY_USER= REGISTRY_LINK= @@ -248,8 +249,8 @@ if [ .$help != .Usage ]; then echo $progname:ERROR: $help 12 fi -echo Usage: $progname -m|--mode=fake|post|wipe [-a|--args=args] -echo-u|--user=user [-d|--desc=text] +echo Usage: $progname [-u|--user=user] [-l|--link=token] [-d|--desc=text] +echo[-m|--mode=fake|post|wipe] [-a|--args=args] echo[--plat=text] [--orel=text] [--uuid=file] echo[--conf=file] [--prep=file] [--tran=file] [--util=file] [--data=tag[,tag...]] echo[-P|--preparation] [-T|--transaction] [-U|--utilization] @@ -429,6 +430,34 @@ } ## +## Automatic registration data retrieval +## +autoregdata() +{ +if [ .$REGISTRY_AUTO != . ]; then +O= +if [ $verbose = no ]; then O=$O --silent; fi +response=`$curl \ +$O -L \ +--user-agent $useragent \ +--connect-timeout 8 \ +--max-time 16 \ +$REGISTRY_AUTO \ +| awk ' +BEGIN { registry=0 } +/registry/ { registry=1 } +/autoregister / { if (registry) { print $0 } } +/\/registry/ { registry=0 }' \ +| sed -e 's;^.*autoregister *;;' -e 's;[^]*/autoregister.*$;;' \ + -e 's;\([^=]*\)=\([^]*\) *;\1=\2\\ +;g' \ +| awk -F= '/=/ { print REGISTRY_toupper($1)=$2 }'` +if [ $verbose = yes ]; then echo autoregdata from $REGISTRY_AUTO; echo $response; fi +eval $response +fi +} + +## ## Primary operation Convenience ## convenience() @@ -441,6 +470,24 @@ fi preparation | transaction | utilization + +readutil || error problem reading util +if [ .$REGISTRY_DONE = .yes ]; then +echo #`TZ= date '+%Y-%m-%d %H:%M:%S'` UTC | tee $REGISTRY_CONF || return +( +echo REGISTRY_USER=\$REGISTRY_USER\ +echo REGISTRY_LINK=\$REGISTRY_LINK\ +echo REGISTRY_DESC=\$REGISTRY_DESC\ +echo REGISTRY_PLAT=\$REGISTRY_PLAT\ +echo REGISTRY_OREL=\$REGISTRY_OREL\ +echo REGISTRY_UUID=\$REGISTRY_UUID\ +echo REGISTRY_PREP=\$REGISTRY_PREP\ +echo REGISTRY_MODE=\$REGISTRY_MODE\ +echo REGISTRY_ARGS=\$REGISTRY_ARGS\ +echo REGISTRY_TRAN=\$REGISTRY_TRAN\ +echo REGISTRY_UTIL=\$REGISTRY_UTIL\ +) | tee -a $REGISTRY_CONF +fi } ## @@ -473,7 +520,7 @@ echo echo Step 1/3: Preparation echo Attempting to write to the configuration file \$REGISTRY_CONF\ -echo #`TZ= date '+%Y-%m-%d %H:%M:%S'` | tee -a $REGISTRY_CONF 2/dev/null \ +echo #`TZ= date '+%Y-%m-%d %H:%M:%S'` UTC | tee -a $REGISTRY_CONF 2/dev/null \ || error Configuration file not writable. Get more permissions and try again read -p [REGISTRY_USER=\$REGISTRY_USER\] username? ; [ .$REPLY != . ] REGISTRY_USER=$REPLY @@ -584,16 +631,10 @@ } ## -## automatically pick interaction or convenience +## check whether important configuration data is missing ## -automatic() +checkmissing() { -if [ .$REGISTRY_MODE
[CVS] OpenPKG: openpkg-registry/ register.sh
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Ralf S. Engelschall Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 22-Oct-2006 19:10:43 Branch: HEAD Handle: 2006102218104300 Modified files: openpkg-registryregister.sh Log: workaround shell expansion problems Summary: RevisionChanges Path 1.57+22 -6 openpkg-registry/register.sh patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.56 -r1.57 register.sh --- openpkg-registry/register.sh 16 Oct 2006 08:54:33 - 1.56 +++ openpkg-registry/register.sh 22 Oct 2006 17:10:43 - 1.57 @@ -29,8 +29,8 @@ # program name, version and date progname=register -progvers=1.0.0 -progdate=16-Oct-2006 +progvers=1.0.1 +progdate=2006-10-22 # determine path to OpenPKG instance PREFIX=@l_prefix@ @@ -270,7 +270,11 @@ preparation() { if [ .$REGISTRY_MODE = .wipe ]; then -[ .$REGISTRY_PREP != . -f $REGISTRY_PREP ] cat /dev/null $REGISTRY_PREP +if [ .$REGISTRY_PREP != . ]; then +if [ -f $REGISTRY_PREP ]; then +cat /dev/null $REGISTRY_PREP +fi +fi return fi @@ -338,7 +342,11 @@ transaction() { if [ .$REGISTRY_MODE = .wipe ]; then -[ .$REGISTRY_TRAN != . -f $REGISTRY_TRAN ] cat /dev/null $REGISTRY_TRAN +if [ .$REGISTRY_TRAN != . ]; then +if [ -f $REGISTRY_TRAN ]; then +cat /dev/null $REGISTRY_TRAN +fi +fi return fi @@ -385,7 +393,11 @@ utilization() { if [ .$REGISTRY_MODE = .wipe ]; then -[ .$REGISTRY_UTIL != . -f $REGISTRY_UTIL ] cat /dev/null $REGISTRY_UTIL +if [ .$REGISTRY_UTIL != . ]; then +if [ -f $REGISTRY_UTIL ]; then +cat /dev/null $REGISTRY_UTIL +fi +fi return fi @@ -435,7 +447,11 @@ interaction() { if [ .$REGISTRY_MODE = .wipe ]; then -[ .$REGISTRY_CONF != . -f $REGISTRY_CONF ] cat /dev/null $REGISTRY_CONF +if [ .$REGISTRY_CONF != . ]; then +if [ -f $REGISTRY_CONF ]; then +cat /dev/null $REGISTRY_CONF +fi +fi return fi @@ . __ The OpenPKG Projectwww.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org
[CVS] OpenPKG: openpkg-registry/ register.sh
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Thomas Lotterer Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 09-Aug-2006 13:26:41 Branch: HEAD Handle: 2006080912264100 Modified files: openpkg-registryregister.sh Log: output error messages to STDERR Summary: RevisionChanges Path 1.53+1 -1 openpkg-registry/register.sh patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.52 -r1.53 register.sh --- openpkg-registry/register.sh 8 Aug 2006 16:42:05 - 1.52 +++ openpkg-registry/register.sh 9 Aug 2006 11:26:41 - 1.53 @@ -48,7 +48,7 @@ error() { -echo $progname:ERROR: $@ +echo $progname:ERROR: $@ 12 exit 1 } @@ . __ The OpenPKG Projectwww.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org
[CVS] OpenPKG: openpkg-registry/ register.sh
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Thomas Lotterer Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 09-Aug-2006 13:30:17 Branch: HEAD Handle: 2006080912301700 Modified files: openpkg-registryregister.sh Log: try overwriting all affected regular files for wipe even when permissions are not sufficient. Producing an error messager is preferred over silent ignorance in this case. Summary: RevisionChanges Path 1.54+4 -4 openpkg-registry/register.sh patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.53 -r1.54 register.sh --- openpkg-registry/register.sh 9 Aug 2006 11:26:41 - 1.53 +++ openpkg-registry/register.sh 9 Aug 2006 11:30:17 - 1.54 @@ -270,7 +270,7 @@ preparation() { if [ .$REGISTRY_MODE = .wipe ]; then -[ .$REGISTRY_PREP != . -a -w $REGISTRY_PREP ] cat /dev/null $REGISTRY_PREP +[ .$REGISTRY_PREP != . -f $REGISTRY_PREP ] cat /dev/null $REGISTRY_PREP return fi @@ -338,7 +338,7 @@ transaction() { if [ .$REGISTRY_MODE = .wipe ]; then -[ .$REGISTRY_TRAN != . -a -w $REGISTRY_TRAN ] cat /dev/null $REGISTRY_TRAN +[ .$REGISTRY_TRAN != . -f $REGISTRY_TRAN ] cat /dev/null $REGISTRY_TRAN return fi @@ -385,7 +385,7 @@ utilization() { if [ .$REGISTRY_MODE = .wipe ]; then -[ .$REGISTRY_UTIL != . -a -w $REGISTRY_UTIL ] cat /dev/null $REGISTRY_UTIL +[ .$REGISTRY_UTIL != . -f $REGISTRY_UTIL ] cat /dev/null $REGISTRY_UTIL return fi @@ -435,7 +435,7 @@ interaction() { if [ .$REGISTRY_MODE = .wipe ]; then -[ .$REGISTRY_CONF != . -a -w $REGISTRY_CONF ] cat /dev/null $REGISTRY_CONF +[ .$REGISTRY_CONF != . -f $REGISTRY_CONF ] cat /dev/null $REGISTRY_CONF return fi @@ . __ The OpenPKG Projectwww.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org
[CVS] OpenPKG: openpkg-registry/ register.sh
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Thomas Lotterer Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 07-Aug-2006 17:14:06 Branch: HEAD Handle: 2006080716140500 Modified files: openpkg-registryregister.sh Log: fix error message printing wrong variable Summary: RevisionChanges Path 1.50+2 -2 openpkg-registry/register.sh patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.49 -r1.50 register.sh --- openpkg-registry/register.sh 3 Aug 2006 00:14:04 - 1.49 +++ openpkg-registry/register.sh 7 Aug 2006 15:14:05 - 1.50 @@ -271,7 +271,7 @@ [ .$REGISTRY_USER = . ] error missing information REGISTRY_USER [ .$REGISTRY_DESC = . ] error missing information REGISTRY_DESC [ .$REGISTRY_PLAT = . ] error missing information REGISTRY_PLAT -[ .$REGISTRY_OREL = . ] error missing information REGISTRY_PREP +[ .$REGISTRY_OREL = . ] error missing information REGISTRY_OREL [ .$REGISTRY_UUID = . ] error missing information REGISTRY_UUID [ .$REGISTRY_PREP = . ] error missing information REGISTRY_PREP @@ -461,7 +461,7 @@ [ .$REGISTRY_USER = . ] error missing information REGISTRY_USER [ .$REGISTRY_DESC = . ] error missing information REGISTRY_DESC [ .$REGISTRY_PLAT = . ] error missing information REGISTRY_PLAT -[ .$REGISTRY_OREL = . ] error missing information REGISTRY_PREP +[ .$REGISTRY_OREL = . ] error missing information REGISTRY_OREL [ .$REGISTRY_UUID = . ] error missing information REGISTRY_UUID [ .$REGISTRY_DATA = . ] error missing information REGISTRY_DATA [ .$REGISTRY_PREP = . ] error missing information REGISTRY_PREP @@ . __ The OpenPKG Projectwww.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org
[CVS] OpenPKG: openpkg-registry/ register.sh
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Thomas Lotterer Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 18-Jul-2006 20:17:05 Branch: HEAD Handle: 2006071819170500 Modified files: openpkg-registryregister.sh Log: remove gpg-pubkey and similar improper data from preparation step Summary: RevisionChanges Path 1.43+1 -1 openpkg-registry/register.sh patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.42 -r1.43 register.sh --- openpkg-registry/register.sh 14 Jul 2006 15:36:14 - 1.42 +++ openpkg-registry/register.sh 18 Jul 2006 18:17:05 - 1.43 @@ -314,7 +314,7 @@ else F=${F}/\n fi -D=${D}`$rpm --qf \${F}\ -qa`${N} +D=${D}`$rpm --qf \${F}\ -qa | sed '/package id=(none)/,/\/package/d'`${N} D=${D}/request${N} else D=${D}${I}/${N} @@ . __ The OpenPKG Projectwww.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org
[CVS] OpenPKG: openpkg-registry/ register.sh
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Thomas Lotterer Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 19-Jul-2006 00:18:56 Branch: HEAD Handle: 2006071823185500 Modified files: openpkg-registryregister.sh Log: fix broken URL rewriting code Summary: RevisionChanges Path 1.45+3 -3 openpkg-registry/register.sh patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.44 -r1.45 register.sh --- openpkg-registry/register.sh 18 Jul 2006 18:17:16 - 1.44 +++ openpkg-registry/register.sh 18 Jul 2006 22:18:55 - 1.45 @@ -544,9 +544,9 @@ # URL rewriting while [ .$1 != . ]; do printf '%s\n' $1 | \ -sed -e s;^\([^:/]*\)://\([^:/]*\.openpkg\.com\)/;\1://UUID_REGISTRY:[EMAIL PROTECTED]/; \ --e s;^\([^:/]*\)://\([^:/]*\.openpkg\.org\)/;\1://UUID_REGISTRY:[EMAIL PROTECTED]/; \ --e s;^\([^:/]*\)://\([^:/]*\.openpkg\.net\)/;\1://UUID_REGISTRY:[EMAIL PROTECTED]/; +sed -e s;^\([^:/]*\)://\([^:/]*\.openpkg\.com\)/;\1://$UUID_REGISTRY:[EMAIL PROTECTED]/; \ +-e s;^\([^:/]*\)://\([^:/]*\.openpkg\.org\)/;\1://$UUID_REGISTRY:[EMAIL PROTECTED]/; \ +-e s;^\([^:/]*\)://\([^:/]*\.openpkg\.net\)/;\1://$UUID_REGISTRY:[EMAIL PROTECTED]/; shift done return 0 @@ . __ The OpenPKG Projectwww.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org
[CVS] OpenPKG: openpkg-registry/ register.sh
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Thomas Lotterer Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 14-Jul-2006 16:25:06 Branch: HEAD Handle: 2006071415250500 Modified files: openpkg-registryregister.sh Log: rewrite URLs for all protocols, all hosts and all subdomains below the three well known OpenPKG second level domains Summary: RevisionChanges Path 1.39+3 -3 openpkg-registry/register.sh patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.38 -r1.39 register.sh --- openpkg-registry/register.sh 13 Jul 2006 08:11:33 - 1.38 +++ openpkg-registry/register.sh 14 Jul 2006 14:25:05 - 1.39 @@ -509,9 +509,9 @@ # URL rewriting while [ .$1 != . ]; do printf '%s\n' $1 | \ -sed -e s;^\(ftp\)://\(ftp.openpkg.com\)/;\1://$UUID_REGISTRY:[EMAIL PROTECTED]/; \ --e s;^\(ftp\)://\(ftp.openpkg.org\)/;\1://$UUID_REGISTRY:[EMAIL PROTECTED]/; \ --e s;^\(ftp\)://\(ftp.openpkg.net\)/;\1://$UUID_REGISTRY:[EMAIL PROTECTED]/; +sed -e s;^\([^:/]*\)://\([^:/]*\.openpkg\.com\)/;\1://UUID_REGISTRY:[EMAIL PROTECTED]/; \ +-e s;^\([^:/]*\)://\([^:/]*\.openpkg\.org\)/;\1://UUID_REGISTRY:[EMAIL PROTECTED]/; \ +-e s;^\([^:/]*\)://\([^:/]*\.openpkg\.net\)/;\1://UUID_REGISTRY:[EMAIL PROTECTED]/; shift done return 0 @@ . __ The OpenPKG Projectwww.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org
[CVS] OpenPKG: openpkg-registry/ register.sh
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Thomas Lotterer Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 14-Jul-2006 16:27:40 Branch: HEAD Handle: 2006071415274000 Modified files: openpkg-registryregister.sh Log: verbose controls progress bar Summary: RevisionChanges Path 1.40+7 -1 openpkg-registry/register.sh patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.39 -r1.40 register.sh --- openpkg-registry/register.sh 14 Jul 2006 14:25:05 - 1.39 +++ openpkg-registry/register.sh 14 Jul 2006 14:27:40 - 1.40 @@ -327,8 +327,10 @@ fi if [ .$REGISTRY_MODE = .post ]; then +O= +if [ $verbose = no ]; then O=$O --silent; fi $curl \ ---silent \ +$O \ --user-agent $useragent \ --form 'page=dropxml' \ --form 'data=-' \ @@ -610,6 +612,10 @@ Display brief usage message. +=item B-v, B--verbose + +Display progress information during data posting. + =item B-P, B--preparation Execute the primary operation preparation. @@ . __ The OpenPKG Projectwww.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org
[CVS] OpenPKG: openpkg-registry/ register.sh registry-db.pl registry-u...
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Thomas Lotterer Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 14-Jul-2006 16:48:28 Branch: HEAD Handle: 2006071415482701 Modified files: openpkg-registryregister.sh registry-db.pl registry-ui.pl Log: support capturing and storing data about every instances package and it's provides into the registry Summary: RevisionChanges Path 1.41+67 -19 openpkg-registry/register.sh 1.32+96 -3 openpkg-registry/registry-db.pl 1.77+174 -8 openpkg-registry/registry-ui.pl patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.40 -r1.41 register.sh --- openpkg-registry/register.sh 14 Jul 2006 14:27:40 - 1.40 +++ openpkg-registry/register.sh 14 Jul 2006 14:48:27 - 1.41 @@ -118,6 +118,9 @@ REGISTRY_TRAN=$PREFIX/etc/openpkg/register.tran REGISTRY_UTIL=$PREFIX/etc/openpkg/register.util +# amount of data being posted +REGISTRY_DATA=request,package,provides + # read baseline config early and allow options to override contents readconf @@ -206,6 +209,11 @@ if [ .$arg = . ]; then help=Missing argument to \$opt\; break; fi REGISTRY_UTIL=$arg ;; +--data ) +if [ .$arg = . ]; then shift; arg=$1; fi +if [ .$arg = . ]; then help=Missing argument to \$opt\; break; fi +REGISTRY_DATA=$arg +;; # debug options -v|--verbose ) verbose=yes ;; @@ -237,7 +245,7 @@ echo Usage: $progname -m|--mode=fake|post|wipe [-a|--args=args] echo-u|--user=user [-d|--desc=text] echo[--plat=text] [--orel=text] [--uuid=file] -echo[--conf=file] [--prep=file] [--tran=file] [--util=file] +echo[--conf=file] [--prep=file] [--tran=file] [--util=file] [--data=tag[,tag...]] echo[-P|--preparation] [-T|--transaction] [-U|--utilization] echo[-C|--convenience] [-I|--interaction] echo[-v|--verbose] [-h|--help] @@ -274,23 +282,46 @@ [ .$UUID_INSTANCE = . ] error missing information UUID_INSTANCE [ .$UUID_PLATFORM = . ] error missing information UUID_PLATFORM -( -echo ?xml version=\1.0\ encoding=\iso-8859-1\ standalone=\no\? -echo !DOCTYPE registry -echo PUBLIC \-//OpenPKG//DTD OpenPKG Registry 0.0.1//EN\ -echo \http://registry.openpkg.org/registry.dtd\; [] -echo registry -echo request id=\$UUID_REGISTRY\ -echo registry_user=\$REGISTRY_USER\ -echo registry_desc=\$REGISTRY_DESC\ -echo registry_plat=\$REGISTRY_PLAT\ -echo registry_orel=\$REGISTRY_OREL\ -echo uuid_registry=\$UUID_REGISTRY\ -echo uuid_instance=\$UUID_INSTANCE\ -echo uuid_platform=\$UUID_PLATFORM\ -echo / -echo /registry -) | tee $REGISTRY_PREP +# amount of data being posted +Q=''; I=; N=$'\n'; D= + +echo $REGISTRY_DATA | grep request /dev/null +if [ $? = 0 ]; then +D=${D}?xml version=${Q}1.0${Q} encoding=${Q}iso-8859-1${Q} standalone=${Q}no${Q}?${N} +D=${D}!DOCTYPE registry${N} +D=${D} PUBLIC ${Q}-//OpenPKG//DTD OpenPKG Registry 0.0.1//EN${Q}${N} +D=${D} ${Q}http://registry.openpkg.org/registry.dtd${Q} []${N} +D=${D}registry${N} +D=${D}${I}request id=${Q}$UUID_REGISTRY${Q}${N} +D=${D}${I}${I}registry_user=${Q}$REGISTRY_USER${Q}${N} +D=${D}${I}${I}registry_desc=${Q}$REGISTRY_DESC${Q}${N} +D=${D}${I}${I}registry_plat=${Q}$REGISTRY_PLAT${Q}${N} +D=${D}${I}${I}registry_orel=${Q}$REGISTRY_OREL${Q}${N} +D=${D}${I}${I}uuid_registry=${Q}$UUID_REGISTRY${Q}${N} +D=${D}${I}${I}uuid_instance=${Q}$UUID_INSTANCE${Q}${N} +D=${D}${I}${I}uuid_platform=${Q}$UUID_PLATFORM${Q}${N} + +echo $REGISTRY_DATA | grep package /dev/null +if [ $? = 0 ]; then +D=${D}${I}${N} +F= +F=${F}${I}${I}package id=${Q}%{PKGID}${Q} name=${Q}%{NAME}${Q} version=${Q}%{VERSION}${Q} release=${Q}%{RELEASE}${Q} +echo $REGISTRY_DATA | grep provides /dev/null +if [ $? = 0 ]; then +F=${F}\n +F=${F}[${I}${I}${I}provides name=${Q}%{PROVIDENAME}${Q}
[CVS] OpenPKG: openpkg-registry/ register.sh
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Thomas Lotterer Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 10-Jul-2006 17:18:14 Branch: HEAD Handle: 2006071016181300 Modified files: openpkg-registryregister.sh Log: openpkg man register Summary: RevisionChanges Path 1.36+331 -16openpkg-registry/register.sh patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.35 -r1.36 register.sh --- openpkg-registry/register.sh 10 Jul 2006 10:23:02 - 1.35 +++ openpkg-registry/register.sh 10 Jul 2006 15:18:13 - 1.36 @@ -253,11 +253,6 @@ ## ## Primary operation Preparation ## -## Creates registry data for one request and dumpes it stdout -## in XML format. That request can be filtered and piped into -## the --Tran phase or it can be copied and pasted into the -## XMLdump CGI facility manually. -## preparation() { if [ .$REGISTRY_MODE = .wipe ]; then @@ -301,13 +296,6 @@ ## ## Primary operation Transaction ## -## Reads registry data with one request from stdin, executes -## the transaction and writes registry data with one or more -## responses to stdout in XML format. Depending on the mode of -## operation, the transaction might be an actual transport to the -## XMLdump CGI facility or a fake activity which complements the -## manual preparation. -## transaction() { if [ .$REGISTRY_MODE = .wipe ]; then @@ -353,10 +341,6 @@ ## ## Primary operation Utilization ## -## Reads registry data with one response from stdin and updates -## the local registry information. Note that this step requires -## write accesss to the $REGISTRY_UTIL file. -## utilization() { if [ .$REGISTRY_MODE = .wipe ]; then @@ -572,4 +556,335 @@ ## primary operation switch ## eval $op \[EMAIL PROTECTED] +exit $? + +## +## MANUAL PAGE +## + +=pod + +=head1 NAME + +Bopenpkg register - OpenPKG Registry Command-Line Client + +=head1 SYNOPSIS + +Bregister -m|--mode=fake|post|wipe [I-a|--args=args] + -u|--user=user [I-d|--desc=text] + [I--plat=text] [I--orel=text] [I--uuid=file] + [I--conf=file] [I--prep=file] [I--tran=file] + [I--util=file] + [I-P|--preparation] [I-T|--transaction] + [I-U|--utilization] [I-C|--convenience] + [I-I|--interaction] + [I-v|--verbose] [I-h|--help] + +Bregister -S|--printstatus + +Bregister -R|--rewriteurls [Iurl ...] + +=head1 DESCRIPTION + +Bopenpkg register is the Command-Line Client the OpenPKG Registry. It is +used by administrators to register an instance with the OpenPKG Registry for +later association. + +Automatic association is intentionally not possible and login to the web form +on http://registry.openpkg.org/ is required. + +After association, Bopenpkg register can be used for repetitive +reregistrations which update the heartbeat of the instance on the Registry +server, avoiding premature depature from the database. It is assumed that +every instance will be reregistered every quarter of the year. Dormant +instances might be discarded from the Registry, revoking their access to +additional resources. + +=head1 PRIMARY OPERATIONS + +The following primary operations are available: + +=over 4 + +=item B-h, B--help + +Display brief usage message. + +=item B-P, B--preparation + +Execute the primary operation preparation. +Creates registry data for one request and dumps it stdout +in XML format. That request can be filtered and piped into +the transaction phase or it can be copied and pasted into the +XMLdump CGI facility manually. +A copy of the output of the last run is also saved to the C${REGISTRY_PREP} file. + +=item B-T, B--transaction + +Execute the primary operation transaction. +Reads registry data with one request from stdin, executes +the transaction and writes registry data with one or more +responses to stdout in XML format. +Depending on the mode of operation, the transaction might be an actual +transport to the XMLdump CGI facility or a fake activity which complements the +manual preparation. +A copy of the output of the last run is also saved to the C${REGISTRY_TRAN} file. + +=item B-U, B--utilization + +Execute the primary operation utilization. +Reads registry data with one response from stdin and updates the local +registry information. +Depending on
[CVS] OpenPKG: openpkg-registry/ register.sh
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Thomas Lotterer Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 12-May-2006 21:27:50 Branch: HEAD Handle: 2006051220274900 Modified files: openpkg-registryregister.sh Log: get rid of hashpling options bash does not like; in case registry comes embedded with bootstrap rpm calles registry which in turn must avoid calling rpm early to circumvent infinite loop problems Summary: RevisionChanges Path 1.32+12 -3 openpkg-registry/register.sh patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.31 -r1.32 register.sh --- openpkg-registry/register.sh 12 May 2006 14:20:35 - 1.31 +++ openpkg-registry/register.sh 12 May 2006 19:27:49 - 1.32 @@ -1,4 +1,4 @@ [EMAIL PROTECTED]@/lib/openpkg/bash --noprofile -x [EMAIL PROTECTED]@/lib/openpkg/bash ## ## register -- OpenPKG Registry Command-Line Client ## Copyright (c) 2000-2005 OpenPKG Foundation e.V. http://openpkg.net/ @@ -108,8 +108,10 @@ REGISTRY_DESC=openpkg://${HOSTNAME}${PREFIX} # advanced options -REGISTRY_PLAT=`$rpm --eval '%{l_platform -p}'` -REGISTRY_OREL=`$rpm --eval '%{l_openpkg_release}'` +# we are called from rpm URL rewrite wrapper, +# so defer PLAT and OREL lookup to avoid rpm loop +REGISTRY_PLAT= +REGISTRY_OREL= REGISTRY_UUID=$PREFIX/etc/openpkg/uuid REGISTRY_CONF=$PREFIX/etc/openpkg/register.conf REGISTRY_PREP=$PREFIX/etc/openpkg/register.prep @@ -220,6 +222,13 @@ set -- [EMAIL PROTECTED] unset i a +# advanced options, lookup PLAT and OREL default for all modes +# but those called from rpm URL rewrite mapper +if [ $op != printstatus -a $op != rewriteurls ]; then +[ .$REGISTRY_PLAT = . ] REGISTRY_PLAT=`$rpm --eval '%{l_platform -p}'` +[ .$REGISTRY_OREL = . ] REGISTRY_OREL=`$rpm --eval '%{l_openpkg_release}'` +fi + # display error or usage message if [ .$help != .no ]; then if [ .$help != .Usage ]; then @@ . __ The OpenPKG Projectwww.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org
[CVS] OpenPKG: openpkg-registry/ register.sh
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Thomas Lotterer Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 29-Nov-2005 12:12:29 Branch: HEAD Handle: 2005112911122800 Modified files: openpkg-registryregister.sh Log: long options should be lowercase only Summary: RevisionChanges Path 1.10+6 -6 openpkg-registry/register.sh patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.9 -r1.10 register.sh --- openpkg-registry/register.sh 28 Nov 2005 17:13:02 - 1.9 +++ openpkg-registry/register.sh 29 Nov 2005 11:12:28 - 1.10 @@ -117,11 +117,11 @@ esac case $opt in # Primary operations --P|--Preparation ) op=preparation ;; --T|--Transaction ) op=transaction ;; --U|--Utilization ) op=utilization ;; --C|--Convenience ) op=convenience ;; --I|--Interaction ) op=interaction ;; +-P|--preparation ) op=preparation ;; +-T|--transaction ) op=transaction ;; +-U|--utilization ) op=utilization ;; +-C|--convenience ) op=convenience ;; +-I|--interaction ) op=interaction ;; # Convenience options -p|--post ) REGISTRY_MODE=post ;; @@ -213,7 +213,7 @@ fi echo Usage: $progname : [-v|--verbose] [-h|--help] - [-P|--Preparation] [-T|--Transaction] [-U|--Utilization] [-C|--Convenience] [-I|--Interaction] + [-P|--preparation] [-T|--transaction] [-U|--utilization] [-C|--convenience] [-I|--interaction] [-p|--post] [-f|--fake] [-w|--wipe] [-c|--conf=file] [-m|--mode=mode] [-u|--user=user] [-d|--desc=text] [-a|--args=args] [--uuid=file] [--prep=file] [--tran=file] [--util=file] @@ . __ The OpenPKG Projectwww.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org
[CVS] OpenPKG: openpkg-registry/ register.sh
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Thomas Lotterer Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 29-Nov-2005 17:15:37 Branch: HEAD Handle: 2005112916153600 Modified files: openpkg-registryregister.sh Log: remove convenience options, it was reported they confuse the user Summary: RevisionChanges Path 1.11+1 -6 openpkg-registry/register.sh patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.10 -r1.11 register.sh --- openpkg-registry/register.sh 29 Nov 2005 11:12:28 - 1.10 +++ openpkg-registry/register.sh 29 Nov 2005 16:15:36 - 1.11 @@ -123,11 +123,6 @@ -C|--convenience ) op=convenience ;; -I|--interaction ) op=interaction ;; -# Convenience options --p|--post ) REGISTRY_MODE=post ;; --f|--fake ) REGISTRY_MODE=fake ;; --w|--wipe ) REGISTRY_MODE=wipe ;; - # Standard options -c|--conf ) if [ .$arg = . ]; then shift; arg=$1; fi @@ -214,7 +209,7 @@ echo Usage: $progname : [-v|--verbose] [-h|--help] [-P|--preparation] [-T|--transaction] [-U|--utilization] [-C|--convenience] [-I|--interaction] - [-p|--post] [-f|--fake] [-w|--wipe] [-c|--conf=file] + [-c|--conf=file] [-m|--mode=mode] [-u|--user=user] [-d|--desc=text] [-a|--args=args] [--uuid=file] [--prep=file] [--tran=file] [--util=file] [--plat=text] [--orel=text] @@ . __ The OpenPKG Projectwww.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org
[CVS] OpenPKG: openpkg-registry/ register.sh
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Thomas Lotterer Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 29-Nov-2005 17:19:27 Branch: HEAD Handle: 2005112916192700 Modified files: openpkg-registryregister.sh Log: remove optional positional args in favor of option enforcement, it was reported they confuse the user; this makes --user and --mode mandatory; --args belongs to --mode Summary: RevisionChanges Path 1.12+2 -16 openpkg-registry/register.sh patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.11 -r1.12 register.sh --- openpkg-registry/register.sh 29 Nov 2005 16:15:36 - 1.11 +++ openpkg-registry/register.sh 29 Nov 2005 16:19:27 - 1.12 @@ -102,10 +102,6 @@ verbose=no help=no -# Optional positional user and desc arguments -user= -desc= - # iterate over argument line while [ $# -gt 0 ]; do opt=$1 @@ -187,19 +183,9 @@ -h|--help) help=Usage ;; -* ) help=Invalid option \`$opt'; break ;; -# Optional positional user and desc arguments -*) - if [ .$user = . ]; then -user=$1 - elif [ .$desc = . ]; then -desc=$1 - fi - ;; esac shift done -[ .$user != . ] REGISTRY_USER=$user -[ .$desc != . ] REGISTRY_DESC=$desc # display error or usage message if [ .$help != .no ]; then @@ -210,10 +196,10 @@ [-v|--verbose] [-h|--help] [-P|--preparation] [-T|--transaction] [-U|--utilization] [-C|--convenience] [-I|--interaction] [-c|--conf=file] - [-m|--mode=mode] [-u|--user=user] [-d|--desc=text] [-a|--args=args] + -m|--mode=mode [-a|--args=args] -u|--user=user [-d|--desc=text] [--uuid=file] [--prep=file] [--tran=file] [--util=file] [--plat=text] [--orel=text] - [user [desc]] 12 + 12 if [ .$help != .Usage ]; then exit 1 @@ . __ The OpenPKG Projectwww.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org
[CVS] OpenPKG: openpkg-registry/ register.sh rpm.sh
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Thomas Lotterer Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 29-Nov-2005 17:35:18 Branch: HEAD Handle: 2005112916351800 Modified files: openpkg-registryregister.sh rpm.sh Log: move registration detection and URL rewrite logic from rpm.sh into rewrite.sh, making it available to other scripts Summary: RevisionChanges Path 1.13+72 -3 openpkg-registry/register.sh 1.5 +5 -46 openpkg-registry/rpm.sh patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.12 -r1.13 register.sh --- openpkg-registry/register.sh 29 Nov 2005 16:19:27 - 1.12 +++ openpkg-registry/register.sh 29 Nov 2005 16:35:18 - 1.13 @@ -66,12 +66,28 @@ readconf() { -[ .$conf = . ] error missing information conf +[ .$conf = . ] return if [ -r $conf ]; then sanitycheck $conf . $conf fi } +readuuid() +{ +[ .$REGISTRY_UUID = . ] return +if [ -r $REGISTRY_UUID ]; then + sanitycheck $REGISTRY_UUID . $REGISTRY_UUID +fi +} + +readutil() +{ +[ .$REGISTRY_UTIL = . ] return +if [ -r $REGISTRY_UTIL ]; then + sanitycheck $REGISTRY_UTIL . $REGISTRY_UTIL +fi +} + ## ## command line option parsing ## @@ -103,6 +119,8 @@ help=no # iterate over argument line +declare -a a +declare -i i=0 while [ $# -gt 0 ]; do opt=$1 case $opt in @@ -119,6 +137,10 @@ -C|--convenience ) op=convenience ;; -I|--interaction ) op=interaction ;; +# Additional features +-S|--printstatus ) op=printstatus ;; +-R|--rewriteurls ) op=rewriteurls ;; + # Standard options -c|--conf ) if [ .$arg = . ]; then shift; arg=$1; fi @@ -183,9 +205,14 @@ -h|--help) help=Usage ;; -* ) help=Invalid option \`$opt'; break ;; +# Optional arguments +* ) a[$i]=$opt +i=i+1 esac shift done +set -- [EMAIL PROTECTED] +unset i a # display error or usage message if [ .$help != .no ]; then @@ -196,9 +223,13 @@ [-v|--verbose] [-h|--help] [-P|--preparation] [-T|--transaction] [-U|--utilization] [-C|--convenience] [-I|--interaction] [-c|--conf=file] - -m|--mode=mode [-a|--args=args] -u|--user=user [-d|--desc=text] + -m|--mode=fake|post|wipe [-a|--args=args] -u|--user=user [-d|--desc=text] [--uuid=file] [--prep=file] [--tran=file] [--util=file] [--plat=text] [--orel=text] + Usage: $progname : + -S|--printstatus + Usage: $progname : + -R|--rewriteurls [[url]...]] 12 if [ .$help != .Usage ]; then @@ -454,6 +485,44 @@ } ## +## Additional feature printstatus +## +printstatus() +{ +rc=0 +readconf || error problem reading conf +readuuid || error problem reading uuid +readutil || error problem reading util +if [ .$REGISTRY_DONE = .yes ]; then +cat $REGISTRY_UTIL +return 0 +fi +return 1 +} + +## +## Additional feature rewriteurls +## +rewriteurls() +{ +readconf readuuid readutil || return $? +if [ .$REGISTRY_DONE = .yes ]; then +# URL rewriting +while [ .$1 != . ]; do +printf '%s\n' $1 | sed \ +-e s;^\(ftp\)://\(ftp.openpkg.com\)/;\1://$UUID_REGISTRY:[EMAIL PROTECTED]/; \ +-e s;^\(ftp\)://\(ftp.openpkg.org\)/;\1://$UUID_REGISTRY:[EMAIL PROTECTED]/; \ +-e s;^\(ftp\)://\(ftp.openpkg.net\)/;\1://$UUID_REGISTRY:[EMAIL PROTECTED]/; +shift +done +return 0 +else +# stealth mode +return 1 +fi +} + +## ## automatical pick interaction or convenience ## automatical() @@ -487,5 +556,5 @@ ## ## primary operation switch ## -eval $op +eval $op \[EMAIL PROTECTED] @@ . patch -p0 '@@ .' Index: openpkg-registry/rpm.sh $ cvs diff -u -r1.4 -r1.5 rpm.sh --- openpkg-registry/rpm.sh 28 Nov 2005 07:12:08 - 1.4 +++ openpkg-registry/rpm.sh 29 Nov 2005 16:35:18 - 1.5 @@ -34,59 +34,18 @@ oldnanewbin=$PREFIX/lib/openpkg/rpm # old n/a, new binary rpm if [ -x
[CVS] OpenPKG: openpkg-registry/ register.sh
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Thomas Lotterer Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 29-Nov-2005 17:37:55 Branch: HEAD Handle: 2005112916375500 Modified files: openpkg-registryregister.sh Log: slightly improve interactive dialog Summary: RevisionChanges Path 1.14+21 -12 openpkg-registry/register.sh patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.13 -r1.14 register.sh --- openpkg-registry/register.sh 29 Nov 2005 16:35:18 - 1.13 +++ openpkg-registry/register.sh 29 Nov 2005 16:37:55 - 1.14 @@ -408,16 +408,26 @@ return fi -echo Interactive step by step registration. You may abort at any time pressing CTRL-C sequence. -echo (*) marks an optional field where the empty string \\ is allowed +echo *** +echo ** Interactive step by step registration ** +echo *** +echo You may abort at any time pressing CTRL-C +echo +echo Registration is a three step process: +echo - +echo 1.) Preparation = create a configuration file and locally prepare a registration request +echo 2.) Transaction = run a transaction to submit the request to the registry +echo 3.) Utilization = memorize the response to activate URL rewriting +echo +echo - a (*) marks an optional field where the empty string \\ is allowed +echo - just press return to continue and/or keep the default setting +echo + +read -p Preparation [press RETURN to continue] +echo Attempting to write to the configuration file \$conf\ +echo #`TZ= date '+%Y-%m-%d %H:%M:%S'` | tee -a $conf 2/dev/null \ +|| error Configuration file not writable. Get more permissions and try again -touch $conf || error Configuration file \$conf\ not writable. Get more permissions and try again - -read -p Appending activity timestamp to configuration file \$conf\ [press RETURN to continue] -echo #`TZ= date '+%Y-%m-%d %H:%M:%S'` | tee -a $conf - -echo Preparation -echo Press return to keep default read -p [REGISTRY_USER=\$REGISTRY_USER\] username ; [ .$REPLY != . ] REGISTRY_USER=$REPLY read -p [REGISTRY_DESC=\$REGISTRY_DESC\] description (*);[ .$REPLY != . ] REGISTRY_DESC=$REPLY read -p [REGISTRY_PLAT=\$REGISTRY_PLAT\] platform (*); [ .$REPLY != . ] REGISTRY_DESC=$REPLY @@ -451,8 +461,7 @@ preparation -echo Transaction -echo Press return to keep default +read -p Transaction [press RETURN to continue] read -p [REGISTRY_MODE=\$REGISTRY_MODE\] mode (post or fake) ; [ .$REPLY != . ] REGISTRY_MODE=$REPLY read -p [REGISTRY_ARGS=\$REGISTRY_ARGS\] args ;[ .$REPLY != . ] REGISTRY_ARGS=$REPLY read -p [REGISTRY_TRAN=\$REGISTRY_TRAN\] tran dump file ; [ .$REPLY != . ] REGISTRY_TRAN=$REPLY @@ -470,7 +479,7 @@ transaction $REGISTRY_PREP -echo Utilization +read -p Utilization [press RETURN to continue] echo Press return to keep default read -p [REGISTRY_UTIL=\$REGISTRY_UTIL\] util dump file ; [ .$REPLY != . ] REGISTRY_UTIL=$REPLY @@ . __ The OpenPKG Projectwww.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org
[CVS] OpenPKG: openpkg-registry/ register.sh
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Thomas Lotterer Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 29-Nov-2005 18:01:46 Branch: HEAD Handle: 2005112917014600 Modified files: openpkg-registryregister.sh Log: handle --conf as much like the other advanced options as possible Summary: RevisionChanges Path 1.15+16 -15 openpkg-registry/register.sh patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.14 -r1.15 register.sh --- openpkg-registry/register.sh 29 Nov 2005 16:37:55 - 1.14 +++ openpkg-registry/register.sh 29 Nov 2005 17:01:46 - 1.15 @@ -66,9 +66,9 @@ readconf() { -[ .$conf = . ] return -if [ -r $conf ]; then - sanitycheck $conf . $conf +[ .$REGISTRY_CONF = . ] return +if [ -r $REGISTRY_CONF ]; then + sanitycheck $REGISTRY_CONF . $REGISTRY_CONF fi } @@ -107,12 +107,13 @@ REGISTRY_PLAT=`$PREFIX/bin/openpkg rpm --eval '%{l_platform -p}'` REGISTRY_OREL=`$PREFIX/bin/openpkg rpm --eval '%{l_openpkg_release}'` REGISTRY_UUID=$PREFIX/etc/openpkg/uuid +REGISTRY_CONF=$PREFIX/etc/openpkg/register.conf REGISTRY_PREP=$PREFIX/etc/openpkg/register.prep REGISTRY_TRAN=$PREFIX/etc/openpkg/register.tran REGISTRY_UTIL=$PREFIX/etc/openpkg/register.util -# Configuration file default and read attempt -conf=$PREFIX/etc/openpkg/register.conf; readconf +# Read baseline config early and allow options to override contents +readconf # Debug options verbose=no @@ -145,7 +146,7 @@ -c|--conf ) if [ .$arg = . ]; then shift; arg=$1; fi if [ .$arg = . ]; then help=Missing argument to \$opt\; break; fi - conf=$arg; readconf + REGISTRY_CONF=$arg; readconf ;; -m|--mode ) if [ .$arg = . ]; then shift; arg=$1; fi @@ -404,7 +405,7 @@ interaction() { if [ .$REGISTRY_MODE = .wipe ]; then -[ .$conf != . -a -w $conf ] cat /dev/null $conf +[ .$REGISTRY_CONF != . -a -w $REGISTRY_CONF ] cat /dev/null $REGISTRY_CONF return fi @@ -424,8 +425,8 @@ echo read -p Preparation [press RETURN to continue] -echo Attempting to write to the configuration file \$conf\ -echo #`TZ= date '+%Y-%m-%d %H:%M:%S'` | tee -a $conf 2/dev/null \ +echo Attempting to write to the configuration file \$REGISTRY_CONF\ +echo #`TZ= date '+%Y-%m-%d %H:%M:%S'` | tee -a $REGISTRY_CONF 2/dev/null \ || error Configuration file not writable. Get more permissions and try again read -p [REGISTRY_USER=\$REGISTRY_USER\] username ; [ .$REPLY != . ] REGISTRY_USER=$REPLY @@ -449,7 +450,7 @@ [ .$UUID_INSTANCE = . ] error missing information UUID_INSTANCE [ .$UUID_PLATFORM = . ] error missing information UUID_PLATFORM -echo Appending to configuration file \$conf\ +echo Appending to configuration file \$REGISTRY_CONF\ ( echo REGISTRY_USER=\$REGISTRY_USER\ echo REGISTRY_DESC=\$REGISTRY_DESC\ @@ -457,7 +458,7 @@ echo REGISTRY_OREL=\$REGISTRY_OREL\ echo REGISTRY_UUID=\$REGISTRY_UUID\ echo REGISTRY_PREP=\$REGISTRY_PREP\ -) | tee -a $conf +) | tee -a $REGISTRY_CONF preparation @@ -470,12 +471,12 @@ [ .$REGISTRY_ARGS = . ] error missing information REGISTRY_ARGS [ .$REGISTRY_TRAN = . ] error missing information REGISTRY_TRAN -echo Appending to configuration file \$conf\ +echo Appending to configuration file \$REGISTRY_CONF\ ( echo REGISTRY_MODE=\$REGISTRY_MODE\ echo REGISTRY_ARGS=\$REGISTRY_ARGS\ echo REGISTRY_TRAN=\$REGISTRY_TRAN\ -) | tee -a $conf +) | tee -a $REGISTRY_CONF transaction $REGISTRY_PREP @@ -485,10 +486,10 @@ [ .$REGISTRY_UTIL = . ] error missing information REGISTRY_UTIL -echo Appending to configuration file \$conf\ +echo Appending to configuration file \$REGISTRY_CONF\ ( echo REGISTRY_UTIL=\$REGISTRY_UTIL\ -) | tee -a $conf +) | tee -a $REGISTRY_CONF utilization $REGISTRY_TRAN } @@ . __ The OpenPKG Projectwww.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org
[CVS] OpenPKG: openpkg-registry/ register.sh
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Thomas Lotterer Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 29-Nov-2005 18:59:37 Branch: HEAD Handle: 2005112917593700 Modified files: openpkg-registryregister.sh Log: prevent rpm.sh/register.sh loop bypassing the openpkg wrapper Summary: RevisionChanges Path 1.17+7 -2 openpkg-registry/register.sh patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.16 -r1.17 register.sh --- openpkg-registry/register.sh 29 Nov 2005 17:04:49 - 1.16 +++ openpkg-registry/register.sh 29 Nov 2005 17:59:37 - 1.17 @@ -38,6 +38,11 @@ PREFIX=${OPENPKG_PREFIX} fi +# determine old binary-only vs. shell+binary situation +oldbinnewsh=$PREFIX/libexec/openpkg/rpm # old binary rpm, new embedded shell rpm +oldnanewbin=$PREFIX/lib/openpkg/rpm # old n/a, new binary rpm +if [ -x $oldbinnewsh -a -x $oldnanewbin ]; then exec $oldnanewbin $@; fi + # http post curl=$PREFIX/lib/openpkg/curl useragent=openpkg-$progname/$progvers @@ -104,8 +109,8 @@ REGISTRY_DESC=openpkg://${HOSTNAME}${PREFIX} # Advanced options -REGISTRY_PLAT=`$PREFIX/bin/openpkg rpm --eval '%{l_platform -p}'` -REGISTRY_OREL=`$PREFIX/bin/openpkg rpm --eval '%{l_openpkg_release}'` +REGISTRY_PLAT=`$oldbinnewsh --eval '%{l_platform -p}'` +REGISTRY_OREL=`$oldbinnewsh --eval '%{l_openpkg_release}'` REGISTRY_UUID=$PREFIX/etc/openpkg/uuid REGISTRY_CONF=$PREFIX/etc/openpkg/register.conf REGISTRY_PREP=$PREFIX/etc/openpkg/register.prep @@ . __ The OpenPKG Projectwww.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org
[CVS] OpenPKG: openpkg-registry/ register.sh
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Ralf S. Engelschall Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 29-Nov-2005 20:16:48 Branch: HEAD Handle: 2005112919164700 Modified files: openpkg-registryregister.sh Log: coding style cleanup (mainly consistent indentations) Summary: RevisionChanges Path 1.18+88 -96 openpkg-registry/register.sh patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.17 -r1.18 register.sh --- openpkg-registry/register.sh 29 Nov 2005 17:59:37 - 1.17 +++ openpkg-registry/register.sh 29 Nov 2005 19:16:47 - 1.18 @@ -73,7 +73,7 @@ { [ .$REGISTRY_CONF = . ] return if [ -r $REGISTRY_CONF ]; then - sanitycheck $REGISTRY_CONF . $REGISTRY_CONF +sanitycheck $REGISTRY_CONF . $REGISTRY_CONF fi } @@ -81,7 +81,7 @@ { [ .$REGISTRY_UUID = . ] return if [ -r $REGISTRY_UUID ]; then - sanitycheck $REGISTRY_UUID . $REGISTRY_UUID +sanitycheck $REGISTRY_UUID . $REGISTRY_UUID fi } @@ -89,7 +89,7 @@ { [ .$REGISTRY_UTIL = . ] return if [ -r $REGISTRY_UTIL ]; then - sanitycheck $REGISTRY_UTIL . $REGISTRY_UTIL +sanitycheck $REGISTRY_UTIL . $REGISTRY_UTIL fi } @@ -99,16 +99,16 @@ # default parameters -# Primary operations +# primary operations op=automatical -# Standard options +# standard options REGISTRY_MODE= REGISTRY_ARGS=http://registry.openpkg.org/register; REGISTRY_USER= REGISTRY_DESC=openpkg://${HOSTNAME}${PREFIX} -# Advanced options +# advanced options REGISTRY_PLAT=`$oldbinnewsh --eval '%{l_platform -p}'` REGISTRY_OREL=`$oldbinnewsh --eval '%{l_openpkg_release}'` REGISTRY_UUID=$PREFIX/etc/openpkg/uuid @@ -117,10 +117,10 @@ REGISTRY_TRAN=$PREFIX/etc/openpkg/register.tran REGISTRY_UTIL=$PREFIX/etc/openpkg/register.util -# Read baseline config early and allow options to override contents +# read baseline config early and allow options to override contents readconf -# Debug options +# debug options verbose=no help=no @@ -136,84 +136,85 @@ *) arg='' ;; esac case $opt in -# Primary operations +# primary operations -P|--preparation ) op=preparation ;; -T|--transaction ) op=transaction ;; -U|--utilization ) op=utilization ;; -C|--convenience ) op=convenience ;; -I|--interaction ) op=interaction ;; -# Additional features +# additional features -S|--printstatus ) op=printstatus ;; -R|--rewriteurls ) op=rewriteurls ;; -# Standard options +# standard options -m|--mode ) - if [ .$arg = . ]; then shift; arg=$1; fi - if [ .$arg = . ]; then help=Missing argument to \$opt\; break; fi - REGISTRY_MODE=$arg - ;; +if [ .$arg = . ]; then shift; arg=$1; fi +if [ .$arg = . ]; then help=Missing argument to \$opt\; break; fi +REGISTRY_MODE=$arg +;; -a|--args ) - if [ .$arg = . ]; then shift; arg=$1; fi - if [ .$arg = . ]; then help=Missing argument to \$opt\; break; fi - REGISTRY_ARGS=$arg - ;; +if [ .$arg = . ]; then shift; arg=$1; fi +if [ .$arg = . ]; then help=Missing argument to \$opt\; break; fi +REGISTRY_ARGS=$arg +;; -u|--user ) - if [ .$arg = . ]; then shift; arg=$1; fi - if [ .$arg = . ]; then help=Missing argument to \$opt\; break; fi - REGISTRY_USER=$arg - ;; +if [ .$arg = . ]; then shift; arg=$1; fi +if [ .$arg = . ]; then help=Missing argument to \$opt\; break; fi +REGISTRY_USER=$arg +;; -d|--desc ) - if [ .$arg = . ]; then shift; arg=$1; fi - if [ .$arg = . ]; then help=Missing argument to \$opt\; break; fi - REGISTRY_DESC=$arg - ;; +if [ .$arg = . ]; then shift; arg=$1; fi +if [ .$arg = . ]; then help=Missing argument to \$opt\; break; fi +REGISTRY_DESC=$arg +;; -# Advanced options +# advanced options --plat ) - if [ .$arg = . ]; then shift; arg=$1; fi - if [ .$arg = .
[CVS] OpenPKG: openpkg-registry/ register.sh
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Ralf S. Engelschall Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 29-Nov-2005 20:19:18 Branch: HEAD Handle: 2005112919191700 Modified files: openpkg-registryregister.sh Log: there is just 'automatic' and 'automatically' in English AFAIK Summary: RevisionChanges Path 1.20+3 -3 openpkg-registry/register.sh patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.19 -r1.20 register.sh --- openpkg-registry/register.sh 29 Nov 2005 19:18:02 - 1.19 +++ openpkg-registry/register.sh 29 Nov 2005 19:19:17 - 1.20 @@ -100,7 +100,7 @@ # default parameters # primary operations -op=automatical +op=automatic # standard options REGISTRY_MODE= @@ -530,9 +530,9 @@ } ## -## automatical pick interaction or convenience +## automatically pick interaction or convenience ## -automatical() +automatic() { if [ .$REGISTRY_MODE = .wipe ]; then convenience @@ . __ The OpenPKG Projectwww.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org
[CVS] OpenPKG: openpkg-registry/ register.sh
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Ralf S. Engelschall Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 29-Nov-2005 20:29:11 Branch: HEAD Handle: 2005112919291100 Modified files: openpkg-registryregister.sh Log: tell the user which step it performs Summary: RevisionChanges Path 1.22+3 -3 openpkg-registry/register.sh patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.21 -r1.22 register.sh --- openpkg-registry/register.sh 29 Nov 2005 19:28:16 - 1.21 +++ openpkg-registry/register.sh 29 Nov 2005 19:29:11 - 1.22 @@ -420,7 +420,7 @@ echo Just press RETURN to continue and/or keep a default setting. echo -read -p Preparation [press RETURN to continue] +read -p Step 1/3: Preparation [press RETURN to continue] echo Attempting to write to the configuration file \$REGISTRY_CONF\ echo #`TZ= date '+%Y-%m-%d %H:%M:%S'` | tee -a $REGISTRY_CONF 2/dev/null \ || error Configuration file not writable. Get more permissions and try again @@ -459,7 +459,7 @@ preparation echo -read -p Transaction [press RETURN to continue] +read -p Step 2/3: Transaction [press RETURN to continue] read -p [REGISTRY_MODE=\$REGISTRY_MODE\] mode (post or fake) ; [ .$REPLY != . ] REGISTRY_MODE=$REPLY read -p [REGISTRY_ARGS=\$REGISTRY_ARGS\] args ;[ .$REPLY != . ] REGISTRY_ARGS=$REPLY read -p [REGISTRY_TRAN=\$REGISTRY_TRAN\] tran dump file ; [ .$REPLY != . ] REGISTRY_TRAN=$REPLY @@ -478,7 +478,7 @@ transaction $REGISTRY_PREP echo -read -p Utilization [press RETURN to continue] +read -p Step 3/3: Utilization [press RETURN to continue] read -p [REGISTRY_UTIL=\$REGISTRY_UTIL\] util dump file ; [ .$REPLY != . ] REGISTRY_UTIL=$REPLY [ .$REGISTRY_UTIL = . ] error missing information REGISTRY_UTIL @@ . __ The OpenPKG Projectwww.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org
[CVS] OpenPKG: openpkg-registry/ register.sh
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Ralf S. Engelschall Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 29-Nov-2005 20:28:17 Branch: HEAD Handle: 2005112919281600 Modified files: openpkg-registryregister.sh Log: output cosmetics Summary: RevisionChanges Path 1.21+15 -15 openpkg-registry/register.sh patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.20 -r1.21 register.sh --- openpkg-registry/register.sh 29 Nov 2005 19:19:17 - 1.20 +++ openpkg-registry/register.sh 29 Nov 2005 19:28:16 - 1.21 @@ -333,7 +333,7 @@ if [ .$REGISTRY_MODE = .post ]; then $curl \ --silent \ ---user-agent $useragent \ +--user-agent $useragent \ --form 'page=dropxml' \ --form 'data=-' \ --form 'submit=DROPXML' \ @@ -406,29 +406,28 @@ return fi -echo *** -echo ** Interactive step by step registration ** -echo *** -echo You may abort at any time pressing CTRL-C +echo OpenPKG Registry Client ($useragent) echo -echo Registration is a three step process: -echo - -echo 1.) Preparation = create a configuration file and locally prepare a registration request -echo 2.) Transaction = run a transaction to submit the request to the registry -echo 3.) Utilization = memorize the response to activate URL rewriting +echo Interactive step-by-step registration procedure. +echo You can abort at any time by just pressing CTRL-C. echo -echo - a (*) marks an optional field where the empty string \\ is allowed -echo - just press return to continue and/or keep the default setting +echo Registration is a three step process: +echo 1. Preparation = create a configuration file and locally prepare a registration request +echo 2. Transaction = run a transaction to submit the request to the registry +echo 3. Utilization = memorize the response to activate local URL rewriting echo +echo A (*) marks an optional field where the empty string \\ is allowed. +echo Just press RETURN to continue and/or keep a default setting. +echo read -p Preparation [press RETURN to continue] echo Attempting to write to the configuration file \$REGISTRY_CONF\ echo #`TZ= date '+%Y-%m-%d %H:%M:%S'` | tee -a $REGISTRY_CONF 2/dev/null \ || error Configuration file not writable. Get more permissions and try again read -p [REGISTRY_USER=\$REGISTRY_USER\] username ; [ .$REPLY != . ] REGISTRY_USER=$REPLY -read -p [REGISTRY_DESC=\$REGISTRY_DESC\] description (*);[ .$REPLY != . ] REGISTRY_DESC=$REPLY -read -p [REGISTRY_PLAT=\$REGISTRY_PLAT\] platform (*); [ .$REPLY != . ] REGISTRY_DESC=$REPLY +read -p [REGISTRY_DESC=\$REGISTRY_DESC\] description (*) ; [ .$REPLY != . ] REGISTRY_DESC=$REPLY +read -p [REGISTRY_PLAT=\$REGISTRY_PLAT\] platform (*) ; [ .$REPLY != . ] REGISTRY_DESC=$REPLY read -p [REGISTRY_OREL=\$REGISTRY_OREL\] release (*) ; [ .$REPLY != . ] REGISTRY_DESC=$REPLY read -p [REGISTRY_UUID=\$REGISTRY_UUID\] uuid file to read ; [ .$REPLY != . ] REGISTRY_UUID=$REPLY read -p [REGISTRY_PREP=\$REGISTRY_PREP\] prep dump file ;[ .$REPLY != . ] REGISTRY_PREP=$REPLY @@ -459,6 +458,7 @@ preparation +echo read -p Transaction [press RETURN to continue] read -p [REGISTRY_MODE=\$REGISTRY_MODE\] mode (post or fake) ; [ .$REPLY != . ] REGISTRY_MODE=$REPLY read -p [REGISTRY_ARGS=\$REGISTRY_ARGS\] args ;[ .$REPLY != . ] REGISTRY_ARGS=$REPLY @@ -477,8 +477,8 @@ transaction $REGISTRY_PREP +echo read -p Utilization [press RETURN to continue] -echo Press return to keep default read -p [REGISTRY_UTIL=\$REGISTRY_UTIL\] util dump file ; [ .$REPLY != . ] REGISTRY_UTIL=$REPLY [ .$REGISTRY_UTIL = . ] error missing information REGISTRY_UTIL @@ . __ The OpenPKG Projectwww.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org
[CVS] OpenPKG: openpkg-registry/ register.sh
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Ralf S. Engelschall Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 29-Nov-2005 20:32:36 Branch: HEAD Handle: 2005112919323600 Modified files: openpkg-registryregister.sh Log: no need to prompt the user too often Summary: RevisionChanges Path 1.23+3 -3 openpkg-registry/register.sh patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.22 -r1.23 register.sh --- openpkg-registry/register.sh 29 Nov 2005 19:29:11 - 1.22 +++ openpkg-registry/register.sh 29 Nov 2005 19:32:36 - 1.23 @@ -420,7 +420,7 @@ echo Just press RETURN to continue and/or keep a default setting. echo -read -p Step 1/3: Preparation [press RETURN to continue] +echo Step 1/3: Preparation echo Attempting to write to the configuration file \$REGISTRY_CONF\ echo #`TZ= date '+%Y-%m-%d %H:%M:%S'` | tee -a $REGISTRY_CONF 2/dev/null \ || error Configuration file not writable. Get more permissions and try again @@ -459,7 +459,7 @@ preparation echo -read -p Step 2/3: Transaction [press RETURN to continue] +echo Step 2/3: Transaction read -p [REGISTRY_MODE=\$REGISTRY_MODE\] mode (post or fake) ; [ .$REPLY != . ] REGISTRY_MODE=$REPLY read -p [REGISTRY_ARGS=\$REGISTRY_ARGS\] args ;[ .$REPLY != . ] REGISTRY_ARGS=$REPLY read -p [REGISTRY_TRAN=\$REGISTRY_TRAN\] tran dump file ; [ .$REPLY != . ] REGISTRY_TRAN=$REPLY @@ -478,7 +478,7 @@ transaction $REGISTRY_PREP echo -read -p Step 3/3: Utilization [press RETURN to continue] +echo Step 3/3: Utilization read -p [REGISTRY_UTIL=\$REGISTRY_UTIL\] util dump file ; [ .$REPLY != . ] REGISTRY_UTIL=$REPLY [ .$REGISTRY_UTIL = . ] error missing information REGISTRY_UTIL @@ . __ The OpenPKG Projectwww.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org
[CVS] OpenPKG: openpkg-registry/ register.sh
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Ralf S. Engelschall Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 29-Nov-2005 21:12:36 Branch: HEAD Handle: 2005112920123600 Modified files: openpkg-registryregister.sh Log: simplify sanity check for portability reasons Summary: RevisionChanges Path 1.25+1 -1 openpkg-registry/register.sh patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.24 -r1.25 register.sh --- openpkg-registry/register.sh 29 Nov 2005 19:52:32 - 1.24 +++ openpkg-registry/register.sh 29 Nov 2005 20:12:36 - 1.25 @@ -63,7 +63,7 @@ if [ .$1 != . -a -r $1 ]; then cat $1 | awk ' BEGIN { rc=0 } -!/^([A-Z][A-Z0-9_]+[A-Z0-9]=[ !#$%(-_a-~]+)? *(#.*)?$/ { rc=1 } +!/^([A-Z][A-Z0-9_]+[A-Z0-9]=[^]*)? *(#.*)?$/ { rc=1 } END { exit rc }' return 0 fi return 1 @@ . __ The OpenPKG Projectwww.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org
[CVS] OpenPKG: openpkg-registry/ register.sh
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Thomas Lotterer Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 25-Nov-2005 19:56:03 Branch: HEAD Handle: 2005112518560300 Modified files: openpkg-registryregister.sh Log: translate to more awk dialects (failed on solaris ;-) Summary: RevisionChanges Path 1.5 +6 -6 openpkg-registry/register.sh patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.4 -r1.5 register.sh --- openpkg-registry/register.sh 24 Nov 2005 11:56:46 - 1.4 +++ openpkg-registry/register.sh 25 Nov 2005 18:56:03 - 1.5 @@ -29,8 +29,8 @@ # program name, version and date progname=register -progvers=0.0.24 -progdate=24-Nov-2005 +progvers=0.0.26 +progdate=25-Nov-2005 # determine path to OpenPKG instance PREFIX=@l_prefix@ @@ -57,8 +57,8 @@ { if [ .$1 != . -a -r $1 ]; then cat $1 | awk ' -BEGIN { rc=0 }; -!/^([A-Z][A-Z0-9_]+[A-Z0-9]=[ !#$%(-_a-~]+)? *(#.*)?$/ { rc=1 }; +BEGIN { rc=0 } +!/^([A-Z][A-Z0-9_]+[A-Z0-9]=[ !#$%(-_a-~]+)? *(#.*)?$/ { rc=1 } END { exit rc }' return 0 fi return 1 @@ -356,8 +356,8 @@ | sed -e 's;^.*response id=;;' -e 's; done=; ;' -e 's;; ;' -e 's;/response.*$;;'` if [ .$response = . ]; then error no response seen on stdin; fi -REGISTRY_UUID=`echo $response | awk '// { print $1 }'` -REGISTRY_DONE=`echo $response | awk '// { print $2 }'` +REGISTRY_UUID=`echo $response | awk '/./ { print $1 }'` +REGISTRY_DONE=`echo $response | awk '/./ { print $2 }'` REGISTRY_RESP=`echo $response | sed -e 's;^[^ ][^ ]* [^ ][^ ]* ;;'` [ .$REGISTRY_UUID = . ] error missing information REGISTRY_UUID @@ . __ The OpenPKG Projectwww.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org
[CVS] OpenPKG: openpkg-registry/ register.sh registry-ui.pl
OpenPKG CVS Repository http://cvs.openpkg.org/ Server: cvs.openpkg.org Name: Thomas Lotterer Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-registry Date: 24-Nov-2005 10:39:57 Branch: HEAD Handle: 2005112409395700 Modified files: openpkg-registryregister.sh registry-ui.pl Log: send DOCTYPE to server although DTD validation is not implemented, yet Summary: RevisionChanges Path 1.3 +8 -8 openpkg-registry/register.sh 1.4 +4 -0 openpkg-registry/registry-ui.pl patch -p0 '@@ .' Index: openpkg-registry/register.sh $ cvs diff -u -r1.2 -r1.3 register.sh --- openpkg-registry/register.sh 19 Nov 2005 22:13:07 - 1.2 +++ openpkg-registry/register.sh 24 Nov 2005 09:39:57 - 1.3 @@ -29,8 +29,8 @@ # program name, version and date progname=register -progvers=0.0.16 -progdate=19-Nov-2005 +progvers=0.0.23 +progdate=24-Nov-2005 # determine path to OpenPKG instance PREFIX=@l_prefix@ @@ -258,9 +258,9 @@ ( echo ?xml version=\1.0\ encoding=\iso-8859-1\ standalone=\no\? -#FIXME echo !DOCTYPE registry -#FIXME echo PUBLIC \-//OpenPKG//DTD OpenPKG Registry 0.0.1//EN\ -#FIXME echo \http://registry.openpkg.org/registry.dtd\; [] +echo !DOCTYPE registry +echo PUBLIC \-//OpenPKG//DTD OpenPKG Registry 0.0.1//EN\ +echo \http://registry.openpkg.org/registry.dtd\; [] echo registry echo request id=\$UUID_REGISTRY\ echo registry_user=\$REGISTRY_USER\ @@ -309,9 +309,9 @@ ( echo ?xml version=\1.0\ encoding=\iso-8859-1\ standalone=\no\? -#FIXME echo !DOCTYPE registry -#FIXME echo PUBLIC \-//OpenPKG//DTD OpenPKG Registry 0.0.1//EN\ -#FIXME echo \http://registry.openpkg.org/registry.dtd\; [] +echo !DOCTYPE registry +echo PUBLIC \-//OpenPKG//DTD OpenPKG Registry 0.0.1//EN\ +echo \http://registry.openpkg.org/registry.dtd\; [] echo registry echo response id=\$request\ done=\yes\fake/response echo /registry @@ . patch -p0 '@@ .' Index: openpkg-registry/registry-ui.pl $ cvs diff -u -r1.3 -r1.4 registry-ui.pl --- openpkg-registry/registry-ui.pl 22 Nov 2005 11:30:15 - 1.3 +++ openpkg-registry/registry-ui.pl 24 Nov 2005 09:39:57 - 1.4 @@ -1156,6 +1156,10 @@ return $html; } +# Check DTD +# FIXME currently we just drop it! +$data =~ s|!DOCTYPE registry[^]*||s; + my $ref = eval { local $SIG{__DIE__}; XMLin($data, ForceArray = 1) }; if ($@) { $msg = $@; @@ . __ The OpenPKG Projectwww.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org