diff --git a/build-utils/rpmsign.exp b/build-utils/rpmsign.exp index cf2291696..a0cd89ca6 100755 --- a/build-utils/rpmsign.exp +++ b/build-utils/rpmsign.exp @@ -3,7 +3,7 @@ # Sign an RPM. This must be run as root, and root must have already set up the key. # I think the key needs to come from /root/.gnupg -set env(HOME) /root +#set env(HOME) /root # # This Expect script was generated by autoexpect on Fri Jun 27 10:45:23 2008 diff --git a/buildcore.sh b/buildcore.sh index 479efd084..a0ae1169a 100755 --- a/buildcore.sh +++ b/buildcore.sh @@ -80,14 +80,16 @@ OSNAME=$(uname) if [ "$OSNAME" != "AIX" ]; then GSA=http://pokgsa.ibm.com/projects/x/xcat/build/linux - # Get a lock, so can not do 2 builds at once - exec 8>/var/lock/xcatbld-$REL.lock - if ! flock -n 8; then - echo "Can't get lock /var/lock/xcatbld-$REL.lock. Someone else must be doing a build right now. Exiting...." - exit 1 - fi - # This is so rpm and gpg will know home, even in sudo - export HOME=/root + if [ "$(id -u)" == "0" ]; then + # Get a lock, so can not do 2 builds at once + exec 8>/var/lock/xcatbld-$REL.lock + if ! flock -n 8; then + echo "Can't get lock /var/lock/xcatbld-$REL.lock. Someone else must be doing a build right now. Exiting...." + exit 1 + fi + # This is so rpm and gpg will know home, even in sudo + export HOME=/root + fi fi # for the git case, query the current branch and set REL (changing master to devel if necessary) @@ -131,9 +133,11 @@ fi XCATCORE="xcat-core" # core-snap is a sym link to xcat-core if [ "$GIT" = "1" ]; then # using git - need to include REL in the path where we put the built rpms - DESTDIR=../../$REL$EMBEDDIR/$XCATCORE + #DESTDIR=../../$REL$EMBEDDIR/$XCATCORE + DESTDIR=$HOME/xcatbuild/$REL$EMBEDDIR/$XCATCORE else - DESTDIR=../..$EMBEDDIR/$XCATCORE + #DESTDIR=../..$EMBEDDIR/$XCATCORE + DESTDIR=$HOME/xcatbuild/..$EMBEDDIR/$XCATCORE fi SRCD=core-snap-srpms @@ -143,7 +147,7 @@ if [ "$OSNAME" = "AIX" ]; then SYSGRP=system else NOARCH=noarch - SYSGRP=root + SYSGRP=$(id -g) fi function setversionvars { @@ -453,7 +457,7 @@ if [ -n "$VERBOSEMODE" ]; then else verboseflag="" fi -echo "Creating $TARNAME ..." +echo "Creating $(dirname $DESTDIR)/$TARNAME ..." if [[ -e $TARNAME ]]; then mkdir -p previous mv -f $TARNAME previous diff --git a/perl-xCAT/db2man b/perl-xCAT/db2man index 43190a9d6..172763521 100755 --- a/perl-xCAT/db2man +++ b/perl-xCAT/db2man @@ -19,7 +19,8 @@ use Pod::Html; my $poddir = 'pods'; my $mandir = 'share/man'; my $htmldir = 'share/doc'; -my $cachedir = '/tmp'; +my $cachedir = "$ENV{'HOME'}/tmp"; +if (system("mkdir -p $cachedir")) { die "Error: could not create $cachedir.\n"; } my $isaix = ($^O =~ /^aix/i); my $skiponaix = 'route|group'; diff --git a/xCAT-SoftLayer/xpod2man b/xCAT-SoftLayer/xpod2man index 02c930fbc..1ae1f36c3 100755 --- a/xCAT-SoftLayer/xpod2man +++ b/xCAT-SoftLayer/xpod2man @@ -15,7 +15,8 @@ use Pod::Html; my $poddir = 'pods'; my $mandir = 'share/man'; my $htmldir = 'share/doc'; -my $cachedir = '/tmp'; +my $cachedir = "$ENV{'HOME'}/tmp"; +if (system("mkdir -p $cachedir")) { die "Error: could not create $cachedir.\n"; } my @pods = getPodList($poddir); #foreach (@pods) { print "$_\n"; } exit; diff --git a/xCAT-client/xpod2man b/xCAT-client/xpod2man index 1c883146e..a3db53f2b 100755 --- a/xCAT-client/xpod2man +++ b/xCAT-client/xpod2man @@ -15,7 +15,8 @@ use Pod::Html; my $poddir = 'pods'; my $mandir = 'share/man'; my $htmldir = 'share/doc'; -my $cachedir = '/tmp'; +my $cachedir = "$ENV{'HOME'}/tmp"; +if (system("mkdir -p $cachedir")) { die "Error: could not create $cachedir.\n"; } my @pods = getPodList($poddir); #foreach (@pods) { print "$_\n"; } exit; diff --git a/xCAT-vlan/xpod2man b/xCAT-vlan/xpod2man index 851a1853f..19d43d399 100755 --- a/xCAT-vlan/xpod2man +++ b/xCAT-vlan/xpod2man @@ -15,7 +15,8 @@ use Pod::Html; my $poddir = 'pods'; my $mandir = 'share/man'; my $htmldir = 'share/doc'; -my $cachedir = '/tmp'; +my $cachedir = "$ENV{'HOME'}/tmp"; +if (system("mkdir -p $cachedir")) { die "Error: could not create $cachedir.\n"; } my @pods = getPodList($poddir); #foreach (@pods) { print "$_\n"; } exit;