[PC-BSD Commits] r7343 - pcbsd-projects/pbi-manager
svn at pcbsd.org
svn at pcbsd.org
Wed Aug 4 06:25:47 PDT 2010
Author: kris
Date: 2010-08-04 06:25:46 -0700 (Wed, 04 Aug 2010)
New Revision: 7343
Modified:
pcbsd-projects/pbi-manager/pbi-manager
Log:
Added ability to display progress of hashdir merging with PBI_VERBOSE set to YES
Modified: pcbsd-projects/pbi-manager/pbi-manager
===================================================================
--- pcbsd-projects/pbi-manager/pbi-manager 2010-08-04 01:45:15 UTC (rev 7342)
+++ pcbsd-projects/pbi-manager/pbi-manager 2010-08-04 13:25:46 UTC (rev 7343)
@@ -1043,8 +1043,13 @@
if [ ! -e "${PBI_PROGDIRPATH}/${PBI_HASHLIST}" ] ; then return 0; fi
mk_required_dirs
- echo -e "Merging with hashdir...\c"
+ if [ "$PBI_VERBOSE" = "YES" ] ; then
+ echo "HASHCOUNT: `wc -l ${PBI_PROGDIRPATH}/${PBI_HASHLIST} | tr -d ' ' | cut -d "/" -f 1`"
+ else
+ echo -e "Merging with hashdir...\c"
+ fi
+
# Read the hashfile, and start making links to identical files
while read hl
do
@@ -1061,7 +1066,12 @@
mv_ln_hashfile "${tfile}" "$file" "$hash"
fi
done < ${PBI_PROGDIRPATH}/${PBI_HASHLIST}
- echo -e "Done!"
+
+ if [ "$PBI_VERBOSE" = "YES" ] ; then
+ echo "HASHDONE"
+ else
+ echo -e "Done!"
+ fi
}
# Use an existing hashfile
@@ -1076,15 +1086,11 @@
# Confirm that the files are the same
diff "${PBI_PROGDIRPATH}/${file}" "${PBI_HASHDIR}/${tfile}" >/dev/null 2>/dev/null
if [ "$?" = "0" ] ; then
- if [ "$PBI_VERBOSE" = "YES" ] ; then
- echo -e ".\c"
- fi
+ if [ "$PBI_VERBOSE" = "YES" ] ; then echo "." ; fi
ln -f "${PBI_HASHDIR}/${tfile}" "${PBI_PROGDIRPATH}/${file}"
if [ "$?" != "0" ] ; then exit_err "Critical failure, exiting..."; fi
else
- if [ "$PBI_VERBOSE" = "YES" ] ; then
- echo -e "X\c"
- fi
+ if [ "$PBI_VERBOSE" = "YES" ] ; then echo "X" ; fi
# OK, have two files with same hashes, but still differ
# Lets keep the pbi included in the new installed file
fi
@@ -1105,6 +1111,7 @@
if [ "$?" != "0" ] ; then exit_err "Critical failure, exiting..."; fi
ln -f "${PBI_HASHDIR}/${tfile}" "${PBI_PROGDIRPATH}/${file}"
if [ "$?" != "0" ] ; then exit_err "Critical failure, exiting..."; fi
+ if [ "$PBI_VERBOSE" = "YES" ] ; then echo "L" ; fi
}
# Return the dbdir for this PBI
More information about the Commits
mailing list