X-Git-Url: https://git.archive.openwrt.org/?p=openwrt.git;a=blobdiff_plain;f=scripts%2Fipkg;h=57fe9dde84e7fe77bbb966d21c2b5d2d1369ca60;hp=d798bcac720cab6d1d64d62f149efabf20b73735;hb=b82c3dff26130a2b5fed86bbfee8e7913ccc3d40;hpb=e0a41f62852d25ee05696c85e6541ec2c9e93072 diff --git a/scripts/ipkg b/scripts/ipkg index d798bcac72..57fe9dde84 100755 --- a/scripts/ipkg +++ b/scripts/ipkg @@ -238,7 +238,7 @@ ipkg_download() { case "$src" in http://* | ftp://*) if ! wget --passive-ftp $proxyoption $proxyuser $proxypassword -P $IPKG_TMP $src; then - echo "ipkg_download: ERROR: Failed to retrieve $src, returning $err" + echo "ipkg_download: ERROR: Failed to retrieve $src, returning $err" >&2 return 1 fi mv $IPKG_TMP/$src_file $dest_dir/$dest_file 2>/dev/null @@ -595,8 +595,8 @@ ipkg_depends() { all_deps="$all_deps $new_pkgs" local new_deps= for pkg in $new_pkgs; do - if echo $pkg | grep -q '[^a-z0-9.+-]'; then - echo "ipkg_depends: ERROR: Package name $pkg contains illegal characters (should be [a-z0-9.+-])" >&2 + if echo $pkg | grep -q '[^A-Za-z0-9.+-]'; then + echo "ipkg_depends: ERROR: Package name $pkg contains illegal characters (should be [A-Za-z0-9.+-])" >&2 return 1 fi # TODO: Fix this. For now I am ignoring versions and alternations in dependencies. @@ -685,8 +685,8 @@ Status: install ok not-installed" | ipkg_status_update_sd $sd $pkg done if [ -z "$filename" ]; then - echo "ipkg_get_install: ERROR: Cannot find package $pkg in $IPKG_LISTS_DIR" - echo "ipkg_get_install: Check the spelling and maybe run \`ipkg update'." + echo "ipkg_get_install: ERROR: Cannot find package $pkg in $IPKG_LISTS_DIR" >&2 + echo "ipkg_get_install: Check the spelling and maybe run \`ipkg update'." >&2 ipkg_status_remove_sd $sd $pkg return 1; fi @@ -698,8 +698,8 @@ Status: install ok not-installed" | ipkg_status_update_sd $sd $pkg fi if ! ipkg_install_file_dest $dest $tmp_pkg_file; then - echo "ipkg_get_install: ERROR: Failed to install $tmp_pkg_file" - echo "ipkg_get_install: I'll leave it there for you to try a manual installation" + echo "ipkg_get_install: ERROR: Failed to install $tmp_pkg_file" >&2 + echo "ipkg_get_install: I'll leave it there for you to try a manual installation" >&2 return 1 fi @@ -731,7 +731,7 @@ ipkg_install_file_dest() { local info_dir=$sd/info if [ ! -f "$filename" ]; then - echo "ipkg_install_file: ERROR: File $filename not found" + echo "ipkg_install_file: ERROR: File $filename not found" >&2 return 1 fi @@ -743,7 +743,7 @@ ipkg_install_file_dest() { elif [ "$ext" = "deb" ]; then pkg_extract_stdout="ar p" else - echo "ipkg_install_file: ERROR: File $filename has unknown extension $ext (not .ipk or .deb)" + echo "ipkg_install_file: ERROR: File $filename has unknown extension $ext (not .ipk or .deb)" >&2 return 1 fi @@ -760,11 +760,11 @@ ipkg_install_file_dest() { if [ ! -z "$missing_deps" ]; then if [ -n "$FORCE_DEPENDS" ]; then - echo "ipkg_install_file: Warning: $pkg depends on the following uninstalled programs: $missing_deps" + echo "ipkg_install_file: Warning: $pkg depends on the following uninstalled programs: $missing_deps" >&2 else echo "ipkg_install_file: ERROR: $pkg depends on the following uninstalled programs: - $missing_deps" - echo "ipkg_install_file: You may want to use \`ipkg install' to install these." + $missing_deps" >&2 + echo "ipkg_install_file: You may want to use \`ipkg install' to install these." >&2 return 1 fi fi @@ -773,15 +773,15 @@ ipkg_install_file_dest() { mkdir -p $IPKG_TMP/$pkg/data mkdir -p $info_dir - if ! $pkg_extract_stdout $filename ./control.tar.gz | (cd $IPKG_TMP/$pkg/control; tar -xzf - ) ; then - echo "ipkg_install_file: ERROR unpacking control.tar.gz from $filename" + if ! $pkg_extract_stdout $filename ./control.tar.gz | (cd $IPKG_TMP/$pkg/control; zcat | tar -xf - ) ; then + echo "ipkg_install_file: ERROR unpacking control.tar.gz from $filename" >&2 return 1 fi if [ -n "$IPKG_OFFLINE_ROOT" ]; then if grep -q '^InstallsOffline:[[:space:]]*no' $IPKG_TMP/$pkg/control/control; then - echo "*** Warning: Package $pkg may not be installed in offline mode" - echo "*** Warning: Scheduling $filename for pending installation (installing into $IPKG_PENDING_DIR)" + echo "*** Warning: Package $pkg may not be installed in offline mode" >&2 + echo "*** Warning: Scheduling $filename for pending installation (installing into $IPKG_PENDING_DIR)" >&2 echo "Package: $pkg Status: install ok pending" | ipkg_status_update_sd $sd $pkg mkdir -p $IPKG_PENDING_DIR @@ -794,7 +794,7 @@ Status: install ok pending" | ipkg_status_update_sd $sd $pkg fi - echo -n "Unpacking $pkg..." + printf "Unpacking $pkg..." set +o noglob for file in $IPKG_TMP/$pkg/control/*; do local base_file="`ipkg_file_part $file`" @@ -803,13 +803,13 @@ Status: install ok pending" | ipkg_status_update_sd $sd $pkg set -o noglob rm -r $IPKG_TMP/$pkg/control - if ! $pkg_extract_stdout $filename ./data.tar.gz | (cd $IPKG_TMP/$pkg/data; tar -xzf - ) ; then - echo "ipkg_install_file: ERROR unpacking data.tar.gz from $filename" + if ! $pkg_extract_stdout $filename ./data.tar.gz | (cd $IPKG_TMP/$pkg/data; zcat | tar -xf - ) ; then + echo "ipkg_install_file: ERROR unpacking data.tar.gz from $filename" >&2 return 1 fi echo "Done." - echo -n "Configuring $pkg..." + printf "Configuring $pkg..." export PKG_ROOT=$dest if [ -x "$info_dir/$pkg.preinst" ]; then if ! $info_dir/$pkg.preinst install; then @@ -828,7 +828,7 @@ Status: install ok pending" | ipkg_status_update_sd $sd $pkg local use_maintainers_conffile= if [ -z "$FORCE_DEFAULTS" ]; then while true; do - echo -n "Configuration file \`$conffile' + printf "Configuration file \`$conffile' ==> File on system created by you or by a script. ==> File also in package provided by package maintainer. What would you like to do about it ? Your options are: @@ -875,7 +875,7 @@ diff -u $dest/$conffile $IPKG_TMP/$pkg/data/$conffile" rm -rf $IPKG_TMP/$pkg/data rmdir $IPKG_TMP/$pkg rm -f $info_dir/$pkg.list - $pkg_extract_stdout $filename ./data.tar.gz | tar tzf - | sed -e 's/^\.//' > $info_dir/$pkg.list + $pkg_extract_stdout $filename ./data.tar.gz | zcat | tar tf - | sed -e '/\/$/d; s/^\.//' > $info_dir/$pkg.list if [ -x "$info_dir/$pkg.postinst" ]; then $info_dir/$pkg.postinst configure @@ -960,7 +960,7 @@ ipkg_install_wanted() { if [ -n "$FORCE_DEFAULTS" ]; then echo "Installing them now." else - echo -n "Install them now [Y/n] ? " + printf "Install them now [Y/n] ? " read response case "$response" in [Nn] | [Nn][Oo]) @@ -1161,10 +1161,10 @@ case "$cmd" in update|upgrade|list|info|status|install_pending) ;; install|depends|remove|files|search) - [ $# -lt 1 ] && ipkg_usage "ERROR: the \`\`$cmd'' command requires an argument" + [ $# -lt 1 ] && ipkg_usage "ERROR: the \`\`$cmd'' command requires an argument" >&2 ;; *) - echo "ERROR: unknown sub-command \`$cmd'" + echo "ERROR: unknown sub-command \`$cmd'" >&2 ipkg_usage ;; esac