Re: [arch-dev-public] [PATCH 1/2] checkpkg: Use temporary working directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On 05/07/10 04:18, Eric Bélanger wrote:
Signed-off-by: Eric Bélanger<snowmaniscool@xxxxxxxxx>
---
  checkpkg |    8 ++++++++
  1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/checkpkg b/checkpkg
index 47fb672..7765d80 100755
--- a/checkpkg
+++ b/checkpkg
@@ -27,6 +27,12 @@ if [ "$arch" == 'any' ]; then
  	CARCH='any'
  fi

+TEMPDIR=$(mktemp /tmp/checkpkg-script.XXXX)
+rm $TEMPDIR
+mkdir -p $TEMPDIR

mktemp can be called with the -d switch and it will create a directory instead of a file. I believe that's the preferable way to go about it.

+
+cd $TEMPDIR
+
  for _pkgname in ${pkgname[@]}; do
  	pkgfile=${_pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}
  	oldstylepkgfile=${_pkgname}-${pkgver}-${pkgrel}${PKGEXT}
@@ -90,3 +96,5 @@ for _pkgname in ${pkgname[@]}; do
  		echo "No filename differences for $_pkgname."
  	fi
  done
+
+echo "Files saved to $TEMPDIR"



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux