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

Error message tweak in cross-install



  Hello,

  In my never-ending quest to advertise the download capabilities of
cross-install, I've made a minor tweak: the script as I modified it suggests
the use of --download if a required file is missing and --download was not
given. It also tries to exit more cleanly if a download entirely fails, and
cleans up the formatting of
"Missing packages will be downloaded from ${download}" (there were no leading
spaces, so it was squished up against the previous sentence, and a trailing
period was missing.  Call me picky, but..)

  Daniel (reinstalling the Hurd again, it's easier than trying to get my
          network card and dselect to work right in it :) )
-- 
There is something in the pang of change
More than the heart can bear,
Unhappiness remembering happiness.
                -- Euripides
--- cross-install.old	Sun Sep 19 21:38:20 1999
+++ cross-install	Sun Sep 19 21:45:45 1999
@@ -224,7 +224,7 @@
 echo -n "scratch."
 
 if [ "x${download}" != x ] ; then
-	echo "Missing packages will be downloaded from ${download}"
+	echo "  Missing packages will be downloaded from ${download}."
 else
 	echo
 fi
@@ -249,8 +249,11 @@
 			mkdir -p ${repository}/partial
 			wget --retr-symlinks -cqP ${repository}/partial ftp://${download}/debian/dists/unstable/main/binary-hurd-i386/${pname}_\*.deb
 			mkdir -p ${repository}/`dirname ${pname}`
-			mv ${repository}/partial/`basename ${pname}`_*.deb ${repository}/`dirname ${pname}`
-			package=`ls -1 ${repository}/${pname}_*.deb 2> /dev/null | tail -n 1`
+			mv ${repository}/partial/`basename ${pname}`_*.deb ${repository}/`dirname ${pname}` 2> /dev/null || 
+
+			echo - Download failed for ${pname}
+
+                        package=`ls -1 ${repository}/${pname}_*.deb 2> /dev/null | tail -n 1`
 			matches=`ls -1 ${repository}/${pname}_*.deb 2> /dev/null | wc -l`
 		fi
 	fi
@@ -259,6 +262,7 @@
 
 	if [ ${matches} = 0 ] ; then
 		echo - ${pname} could not be found, but it is needed.
+		! [ -z "$download" ] || echo \ \ Perhaps you want to try the --download option? \(see --help for more info\)
 		exit 1
 	else
 		if [ ${matches} != 1 ] ; then
@@ -287,7 +291,10 @@
 			mkdir -p ${repository}/partial
 			wget --retr-symlinks -cqP ${repository}/partial ftp://${download}/debian/dists/unstable/main/binary-hurd-i386/${pname}_\*.deb
 			mkdir -p ${repository}/`dirname ${pname}`
-			mv ${repository}/partial/`basename ${pname}`_*.deb ${repository}/`dirname ${pname}`
+			
+			mv ${repository}/partial/`basename ${pname}`_*.deb ${repository}/`dirname ${pname}` ||
+			echo - Download failed for ${pname}
+			
 			package=`ls -1 ${repository}/${pname}_*.deb 2> /dev/null | tail -n 1`
 			matches=`ls -1 ${repository}/${pname}_*.deb 2> /dev/null | wc -l`
 		fi

Reply to: