[PC-BSD Commits] r8026 - pcbsd/current/src-sh/pbi-manager
svn at pcbsd.org
svn at pcbsd.org
Sat Nov 13 17:02:41 PST 2010
Author: kris
Date: 2010-11-13 17:02:41 -0800 (Sat, 13 Nov 2010)
New Revision: 8026
Modified:
pcbsd/current/src-sh/pbi-manager/pbi-manager
Log:
Simplify the archive function for old PBI versions
Modified: pcbsd/current/src-sh/pbi-manager/pbi-manager
===================================================================
--- pcbsd/current/src-sh/pbi-manager/pbi-manager 2010-11-13 14:34:33 UTC (rev 8025)
+++ pcbsd/current/src-sh/pbi-manager/pbi-manager 2010-11-14 01:02:41 UTC (rev 8026)
@@ -3517,7 +3517,6 @@
echo "pbi_makeport ${_flags} ${_mp}"
if [ ! -d "${_od}" ] ; then mkdir -p "${_od}" ; fi
- oldpbi="`ls ${_od}/*.pbi 2>/dev/null`"
# Clean old log files
if [ -e "${_od}/build.log" ] ; then
@@ -3530,10 +3529,9 @@
# Move old PBIs to archived folder
get_pbi_progversion
oldVersion=`cat ${PBI_AB_OUTDIR}/${_cd}/pbi-version`
- if [ "$oldVersion" != "$PBI_PROGVERSION" -a ! -z "`ls ${_od}/*.pbi 2>/dev/null`" ]; then
+ if [ "$oldVersion" != "$PBI_PROGVERSION" ]; then
echo "Archiving old PBIs..."
- oldpbi="`ls ${_od}/*.pbi 2>/dev/null`"
- archive_old_pbis "$_od" "$oldpbi" "$PBI_AB_ARCHIVENUM"
+ archive_old_pbis "$_od" "$PBI_AB_ARCHIVENUM"
fi
# Add some header info to log file
@@ -3928,21 +3926,13 @@
archive_old_pbis()
{
_od="$1"
- _oldpbifiles="$2"
- _keepnum="$3"
+ _keepnum="$2"
# Make sure the archived dir exists
if [ ! -d "${_od}/archived" ] ; then mkdir "${_od}/archived"; fi
- # mv the old PBIs into the dir
- for _oldPBI in $_oldpbifiles
- do
- echo "Moving ${_od}/${_oldPBI} to archive"
- mv "${_od}/${_oldPBI}" "${_od}/archived/"
- if [ -e "${_od}/${_oldPBI}.sha256" ] ; then
- mv "${_od}/${_oldPBI}.sha256" "${_od}/archived/"
- fi
- done
+ mv "${_od}/*.pbi" "${_od}/archived"
+ mv "${_od}/*.sha256" "${_od}/archived"
# Prune anything beyond the _keepnum
oCount="0"
More information about the Commits
mailing list