From 0468a1159b6a8349389f2300d8b3648f80283bed Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 7 Aug 2014 13:01:43 -0400 Subject: [PATCH] RF: nd-aptenable -> nd-configurerepo per our discussion --- debian/TODO | 2 +- debian/neurodebian-repository.config | 10 +++++----- debian/neurodebian-repository.install | 2 +- debian/neurodebian-repository.postinst | 4 ++-- tools/{nd-aptenable => nd-configurerepo} | 12 ++++++------ 5 files changed, 15 insertions(+), 15 deletions(-) rename tools/{nd-aptenable => nd-configurerepo} (98%) diff --git a/debian/TODO b/debian/TODO index c1c3f9c..33dfa55 100644 --- a/debian/TODO +++ b/debian/TODO @@ -50,4 +50,4 @@ apt-cache policy | grep o=NeuroDebian,.*,n=$release echo "I: success" -*** ~/bin/docker-debians-run /bin/bash -c "apt-get -y update >/dev/null; apt-get install -y wget >/dev/null; bash <(wget -q --no-check-certificate -O- https://raw.githubusercontent.com/yarikoptic/neurodebian/enh/neurodebian-installer/tools/nd-aptenable) --overwrite --install --mirror=us-nh" +*** ~/bin/docker-debians-run /bin/bash -c "apt-get -y update >/dev/null; apt-get install -y wget >/dev/null; bash <(wget -q --no-check-certificate -O- https://raw.githubusercontent.com/yarikoptic/neurodebian/enh/neurodebian-installer/tools/nd-configurerepo) --overwrite --install --mirror=us-nh" diff --git a/debian/neurodebian-repository.config b/debian/neurodebian-repository.config index 0f3776c..4d9ee97 100755 --- a/debian/neurodebian-repository.config +++ b/debian/neurodebian-repository.config @@ -13,10 +13,10 @@ debug() db_settitle neurodebian-repository/title if [ "$1" = "configure" ]; then - # Must have been called in preinst state, so no nd-aptenable + # Must have been called in preinst state, so no nd-configurerepo # tool is yet installed, thus delay asking questions to # whenever will be called in postinst state - which nd-aptenable 1>/dev/null 2>&1 || exit 0 + which nd-configurerepo 1>/dev/null 2>&1 || exit 0 fi # Create temporary directory which will be reused @@ -31,13 +31,13 @@ STATE=1 while [ "$STATE" != 0 -a "$STATE" != 8 ]; do case $STATE in 1) - export neurodebian_releases="$(ND_IFS=', ' nd-aptenable --print-releases)" + export neurodebian_releases="$(ND_IFS=', ' nd-configurerepo --print-releases)" debug "releases: $neurodebian_releases" db_subst neurodebian-repository/release releases "$neurodebian_releases" db_input medium neurodebian-repository/release || true ;; 2) - export neurodebian_mirrors="$(ND_IFS=', ' nd-aptenable --print-mirrors)" + export neurodebian_mirrors="$(ND_IFS=', ' nd-configurerepo --print-mirrors)" debug "mirrors: $neurodebian_mirrors" db_subst neurodebian-repository/mirror mirrors "$neurodebian_mirrors" db_input medium neurodebian-repository/mirror || true @@ -55,7 +55,7 @@ while [ "$STATE" != 0 -a "$STATE" != 8 ]; do # Ubuntus managed to remove netselect "to accompany apt-netselect" # https://bugs.launchpad.net/ubuntu/+source/netselect/+bug/337377 # So for now remove this mandatory demanding of netselect for "best", and -# rely on logic in nd-aptenable to select default mirror (currently origin) +# rely on logic in nd-configurerepo to select default mirror (currently origin) # as the 'best' # # case $STATE in diff --git a/debian/neurodebian-repository.install b/debian/neurodebian-repository.install index 8760a43..93aa380 100644 --- a/debian/neurodebian-repository.install +++ b/debian/neurodebian-repository.install @@ -1 +1 @@ -tools/nd-aptenable usr/bin +tools/nd-configurerepo usr/bin diff --git a/debian/neurodebian-repository.postinst b/debian/neurodebian-repository.postinst index 49dda25..dcae7cc 100755 --- a/debian/neurodebian-repository.postinst +++ b/debian/neurodebian-repository.postinst @@ -7,7 +7,7 @@ set -e case "$1" in configure) - # obtain all the options and call nd-aptenable + # obtain all the options and call nd-configurerepo opts="--do-not-update" db_get neurodebian-repository/release; [ "$RET" = "auto" ] || opts+=" -r '$RET'" db_get neurodebian-repository/mirror; nd_mirror="${RET##* }" # get just a url if it came together with alias @@ -17,7 +17,7 @@ case "$1" in db_get neurodebian-repository/overwrite; [ "$RET" = "true" ] && opts+=" --overwrite" || : db_get neurodebian-repository/suffix; [ "$RET" = "" ] || opts+=" --suffix='$RET'" || : - eval nd-aptenable -m "$nd_mirror" -c "$nd_components" $opts + eval nd-configurerepo -m "$nd_mirror" -c "$nd_components" $opts ;; abort-upgrade|abort-remove|abort-deconfigure) # nothing to do diff --git a/tools/nd-aptenable b/tools/nd-configurerepo similarity index 98% rename from tools/nd-aptenable rename to tools/nd-configurerepo index d2c2c9d..72993d4 100755 --- a/tools/nd-aptenable +++ b/tools/nd-configurerepo @@ -74,7 +74,7 @@ error() print_version() { cat << EOT -nd-aptenable $nd_aptenable_version +nd-configurerepo $nd_aptenable_version Copyright (C) 2014 Yaroslav Halchenko @@ -104,7 +104,7 @@ print_help() { cat << EOT -Usage: nd-aptenable [options] +Usage: nd-configurerepo [options] Enables NeuroDebian repository for the current Debian or Ubuntu release. @@ -181,16 +181,16 @@ Examples: - Enable software and data components from the optimal (according to netselect) mirror. Some information about progress will be printed - nd-aptenable + nd-configurerepo - Quietly enable -devel repository for the current release, and place apt configuration into /etc/apt/sources.list.d/neurodebian.sources-devel.list - nd-aptenable -q --suffix=-devel -c devel + nd-configurerepo -q --suffix=-devel -c devel - Force sid distribution, all the components, from the Japan mirror: - nd-aptenable -q --suffix=-de-sid-full -c software,data,devel -m jp + nd-configurerepo -q --suffix=-de-sid-full -c software,data,devel -m jp EOT } @@ -362,7 +362,7 @@ assure_command_from_package() # Note that we use `"$@"' to let each command-line parameter expand to a # separate word. The quotes around `$@' are essential! # We need CLOPTS as the `eval set --' would nuke the return value of getopt. -CLOPTS=`getopt -o h,r:,m:,f:,c:,q,v,n --long help,version,quiet,verbose,mirror:,release:,flavor:,components:,suffix:,overwrite,sources,no-sources,install,dry-run,do-not-update,print-releases,print-mirrors,print-best-mirror -n 'nd-aptenable' -- "$@"` +CLOPTS=`getopt -o h,r:,m:,f:,c:,q,v,n --long help,version,quiet,verbose,mirror:,release:,flavor:,components:,suffix:,overwrite,sources,no-sources,install,dry-run,do-not-update,print-releases,print-mirrors,print-best-mirror -n 'nd-configurerepo' -- "$@"` if [ $? != 0 ] ; then error 2 "Problem with parsing cmdline. Terminating..." -- 2.39.2