ALT Linux Team development discussions
 help / color / mirror / Atom feed
* [devel] APT unified command line interface
@ 2003-10-14  4:15 Mikhail Yakshin
  2003-10-14 17:20 ` Andrey Rahmatullin
  0 siblings, 1 reply; 2+ messages in thread
From: Mikhail Yakshin @ 2003-10-14  4:15 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 914 bytes --]

Приветствую всех!

Я тут поначитался статьи под названием "Why Debian is not my favourite 
operating system", и под ее влияением сел и написал вот это вот. Потому 
как точно так же, как и автор вышеупомянутой статьи, я окончательно 
замучался набирать для простой установки пакеты строчки по 20 символов 
(особенно без zsh) и объяснять новичкам, в чем сакральная истина отличий 
apt-cache и apt-get.

То, что приложено - очень простенький sh-скрипт, торжественно и, видимо, 
очень неправильно идеологически называющийся просто "apt". У меня - 
работает. Все команды apt-get и apt-cache понимает. Какие-то опции им 
передавать умеет. Usage message тоже вроде бы имеется, хотя надо бы его 
через gettext (или еще проще - просто из файла отдельного брать). Может 
кому еще пригодится, кроме меня? А может вообще, ее, того, опакетить?..

P.S. Если кто не читал -
http://www.miketaylor.org.uk/tech/wxinmfpl/debian.html

[-- Attachment #2: apt --]
[-- Type: text/plain, Size: 3224 bytes --]

#!/bin/sh

msg_usage()
{
	self=$0
	apt-get -v|head -n1
	cat <<EOF
Usage: $self [options] command
       $self [options] install|remove pkg1 [pkg2 ...]
       $self [options] source pkg1 [pkg2 ...]
       $self [options] add file1 [file2 ...]
       $self [options] showpkg pkg1 [pkg2 ...]
       $self [options] showsrc pkg1 [pkg2 ...]

apt is a unified command line interface tool for all apt utilities,
including apt-get, apt-cache and apt-cdrom. Basically, it understands
all the command these utilities use and redirect them to appropriate
one.

Commands:
   update - Retrieve new lists of packages
   upgrade - Perform an upgrade
   install - Install new packages (pkg is libc6 not libc6.rpm)
   remove - Remove packages
   source - Download source archives
   build-dep - Configure build-dependencies for source packages
   dist-upgrade - Distribution upgrade, see apt-get(8)
   clean - Erase downloaded archive files
   autoclean - Erase old downloaded archive files
   check - Verify that there are no broken dependencies
   add - Add a package file to the source cache
   gencaches - Build both the package and source cache
   showpkg - Show some general information for a single package
   showsrc - Show source records
   stats - Show some basic statistics
   dump - Show the entire file in a terse form
   dumpavail - Print an available file to stdout
   unmet - Show unmet dependencies
   search - Search the package list for a regex pattern
   show - Show a readable record for the package
   depends - Show raw dependency information for a package
   whatdepends - Show raw dependency information on a package
   pkgnames - List the names of all packages
   dotty - Generate package graphs for GraphVis
   policy - Show policy settings

Options:
  -h   This help text.
  -q   Loggable output - no progress indicator
  -qq  No output except for errors
  -d   Download only - do NOT install or unpack archives
  -s   No-act. Perform ordering simulation
  -y   Assume Yes to all queries and do not prompt
  -f   Attempt to continue if the integrity check fails
  -m   Attempt to continue if archives are unlocatable
  -u   Show a list of upgraded packages as well
  -b   Build the source package after fetching it
  -D   When removing packages, remove dependencies as possible
  -p=? The package cache.
  -s=? The source cache.
  -i   Show only important deps for the unmet command.
  -c=? Read this configuration file
  -o=? Set an arbitary configuration option, eg -o dir::cache=/tmp

See the apt-get(8) and apt-cache(8) manual pages for more information.
EOF
}

while getopts ":hq:dsyfmubDip:s:c:o:" option
do
	case $option in
	h)
		msg_usage
		exit 1
		;;
	d | s | y | f | m | u | b | D | i)
		opts="$opts -$option"
		;;
	q | p | s | c | o)
		opts="$opts -$option$OPTARG"
		;;
	h | *)
		msg_usage
		exit 1
	esac
done

shift $(($OPTIND - 1))

cmd=$1
shift
case "$cmd" in
	update | upgrade | install | remove | source | build-dep | dist-upgrade | clean | autoclean | check)
		apt-get $opts $cmd $@
		;;
	add | gencaches | showpkg | showsrc | stats | dump | dumpavail | unmet | search | show | depends | whatdepends | pkgnames | dotty | policy)
		apt-cache $opts $cmd $@
		;;
	*)
		msg_usage
		exit 1
		;;
esac

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-10-14 17:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-14  4:15 [devel] APT unified command line interface Mikhail Yakshin
2003-10-14 17:20 ` Andrey Rahmatullin

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git