Skip to content

Commit

Permalink
added show-no-keep (from orgrim), fire up 0.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
imilh committed Oct 2, 2012
1 parent fff5e53 commit 860db20
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 29 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ Baptiste Daroussin <[email protected]> - FreeBSD port + patches
Gautam B.T. <[email protected]> - MINIX port
Thomas Adam <[email protected]> - patches
Sylvain "solevis" Mora <[email protected]> - padawan
Nicolas Thauvin <[email protected]> - intensive tests + patches
22 changes: 21 additions & 1 deletion autoremove.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $Id: autoremove.c,v 1.20 2012/07/15 17:36:34 imilh Exp $ */
/* $Id: autoremove.c,v 1.21 2012/10/02 10:20:24 imilh Exp $ */

/*
* Copyright (c) 2009, 2010, 2011 The NetBSD Foundation, Inc.
Expand Down Expand Up @@ -150,6 +150,26 @@ show_pkg_keep(void)
free(plisthead);
}

void
show_pkg_nokeep(void)
{
Plistnumbered *plisthead;
Pkglist *pkglist;

plisthead = rec_pkglist(NOKEEP_LOCAL_PKGS);

if (plisthead == NULL) {
printf("%s\n", MSG_EMPTY_NOKEEP_LIST);
return;
}

SLIST_FOREACH(pkglist, plisthead->P_Plisthead, next)
printf(MSG_MARK_PKG_NOKEEP, pkglist->full);

free_pkglist(&plisthead->P_Plisthead, LIST);
free(plisthead);
}

/**
* \brief flag packages in pkgargs as non or autoremovable
*/
Expand Down
4 changes: 3 additions & 1 deletion cmd.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $Id: cmd.h,v 1.14 2012/05/28 10:56:27 imilh Exp $ */
/* $Id: cmd.h,v 1.15 2012/10/02 10:20:24 imilh Exp $ */

/*
* Copyright (c) 2009, 2010, 2011 The NetBSD Foundation, Inc.
Expand Down Expand Up @@ -68,6 +68,8 @@ static struct command {
PKG_UNKEEP_CMD },
{ "show-keep", "sk", "Display \"non auto-removable\" packages.",
PKG_SHKP_CMD },
{ "show-no-keep", "snk", "Display \"auto-removable\" packages.",
PKG_SHNOKP_CMD },
{ "search", "se", "Search for a package.",
PKG_SRCH_CMD },
{ "clean", "cl", "Clean packages cache.",
Expand Down
18 changes: 9 additions & 9 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for pkgin 0.6.2.2.
# Generated by GNU Autoconf 2.69 for pkgin 0.6.3.
#
# Report bugs to <[email protected]>.
#
Expand Down Expand Up @@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='pkgin'
PACKAGE_TARNAME='pkgin'
PACKAGE_VERSION='0.6.2.2'
PACKAGE_STRING='pkgin 0.6.2.2'
PACKAGE_VERSION='0.6.3'
PACKAGE_STRING='pkgin 0.6.3'
PACKAGE_BUGREPORT='[email protected]'
PACKAGE_URL=''

Expand Down Expand Up @@ -1241,7 +1241,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures pkgin 0.6.2.2 to adapt to many kinds of systems.
\`configure' configures pkgin 0.6.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1306,7 +1306,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of pkgin 0.6.2.2:";;
short | recursive ) echo "Configuration of pkgin 0.6.3:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1394,7 +1394,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
pkgin configure 0.6.2.2
pkgin configure 0.6.3
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -1947,7 +1947,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by pkgin $as_me 0.6.2.2, which was
It was created by pkgin $as_me 0.6.3, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
Expand Down Expand Up @@ -4878,7 +4878,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by pkgin $as_me 0.6.2.2, which was
This file was extended by pkgin $as_me 0.6.3, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -4940,7 +4940,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
pkgin config.status 0.6.2.2
pkgin config.status 0.6.3
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# $Id: configure.ac,v 1.19 2012/08/01 11:21:47 imilh Exp $
# $Id: configure.ac,v 1.20 2012/10/02 10:20:24 imilh Exp $

AC_PREREQ([2.61])
AC_INIT([pkgin], [0.6.2.2], [[email protected]])
AC_INIT([pkgin], [0.6.3], [[email protected]])
AC_CONFIG_SRCDIR([actions.c])
AC_CONFIG_HEADERS([config.h])

Expand Down
5 changes: 4 additions & 1 deletion main.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $Id: main.c,v 1.31 2012/07/29 10:49:45 imilh Exp $ */
/* $Id: main.c,v 1.32 2012/10/02 10:20:24 imilh Exp $ */

/*
* Copyright (c) 2009, 2010, 2011, 2012 The NetBSD Foundation, Inc.
Expand Down Expand Up @@ -227,6 +227,9 @@ main(int argc, char *argv[])
case PKG_SHKP_CMD: /* show keep packages */
show_pkg_keep();
break;
case PKG_SHNOKP_CMD: /* show keep packages */
show_pkg_nokeep();
break;
case PKG_SRCH_CMD: /* search for package */
missing_param(argc, 2, MSG_MISSING_SRCH);
search_pkg(argv[1]);
Expand Down
4 changes: 3 additions & 1 deletion messages.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $Id: messages.h,v 1.30 2012/08/04 14:23:46 imilh Exp $ */
/* $Id: messages.h,v 1.31 2012/10/02 10:20:24 imilh Exp $ */

/*
* Copyright (c) 2009, 2010 The NetBSD Foundation, Inc.
Expand Down Expand Up @@ -86,6 +86,7 @@
#define MSG_PKGS_TO_DELETE "%d packages to delete: %s\n"
#define MSG_NO_PKGS_TO_DELETE "no packages to delete\n"
#define MSG_EMPTY_KEEP_LIST "empty non-autoremovable package list"
#define MSG_EMPTY_NOKEEP_LIST "empty autoremovable package list"
#define MSG_EMPTY_AVAIL_PKGLIST "empty available packages list"
#define MSG_UPGRADE_NEED_REMOVE "this upgrade needs package removal\n"
#define MSG_PKG_INSTALL_LOGGING_TO "pkg_install error log can be found in %s\n"
Expand All @@ -110,6 +111,7 @@ in order to remove packages from the autoremove list, flag those with the `keep'
#define MSG_ALL_KEEP_PKGS "all packages are marked as \"keepable\"\n."
#define MSG_AUTOREMOVE_PKGS "%d packages to be autoremoved: %s\n"
#define MSG_MARK_PKG_KEEP "%s is marked as non-autoremovable\n"
#define MSG_MARK_PKG_NOKEEP "%s is marked as autoremovable\n"
#define MSG_MARKING_PKG_KEEP "marking %s as non auto-removable\n"
#define MSG_UNMARKING_PKG_KEEP "marking %s as auto-removable\n"
#define MSG_NO_ORPHAN_DEPS "no orphan dependencies found.\n"
Expand Down
2 changes: 2 additions & 0 deletions pkgin.1
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ Show
category.
.It Cm show-keep
Display "non auto-removable" packages.
.It Cm show-no-keep
Display "auto-removable" packages.
.It Cm unkeep Ar package Ar ...
Marks
.Ar package
Expand Down
30 changes: 16 additions & 14 deletions pkgin.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $Id: pkgin.h,v 1.39 2012/08/04 14:23:46 imilh Exp $ */
/* $Id: pkgin.h,v 1.40 2012/10/02 10:20:24 imilh Exp $ */

/*
* Copyright (c) 2009, 2010, 2011, 2012 The NetBSD Foundation, Inc.
Expand Down Expand Up @@ -100,19 +100,20 @@
#define PKG_KEEP_CMD 10
#define PKG_UNKEEP_CMD 11
#define PKG_SHKP_CMD 12
#define PKG_SRCH_CMD 13
#define PKG_CLEAN_CMD 14
#define PKG_AUTORM_CMD 15
#define PKG_EXPORT_CMD 16
#define PKG_IMPORT_CMD 17
#define PKG_SHPROV_CMD 18
#define PKG_SHREQ_CMD 19
#define PKG_SHPKGCONT_CMD 20
#define PKG_SHPKGDESC_CMD 21
#define PKG_SHPKGBDEFS_CMD 22
#define PKG_SHCAT_CMD 23
#define PKG_SHPCAT_CMD 24
#define PKG_SHALLCAT_CMD 25
#define PKG_SHNOKP_CMD 13
#define PKG_SRCH_CMD 14
#define PKG_CLEAN_CMD 15
#define PKG_AUTORM_CMD 16
#define PKG_EXPORT_CMD 17
#define PKG_IMPORT_CMD 18
#define PKG_SHPROV_CMD 19
#define PKG_SHREQ_CMD 20
#define PKG_SHPKGCONT_CMD 21
#define PKG_SHPKGDESC_CMD 22
#define PKG_SHPKGBDEFS_CMD 23
#define PKG_SHCAT_CMD 24
#define PKG_SHPCAT_CMD 25
#define PKG_SHALLCAT_CMD 26
#define PKG_GINTO_CMD 255

#define PKG_EQUAL '='
Expand Down Expand Up @@ -254,6 +255,7 @@ Plisthead *pkg_impact(char **);
/* autoremove.c */
void pkgin_autoremove(void);
void show_pkg_keep(void);
void show_pkg_nokeep(void);
int pkg_is_kept(Pkglist *);
void pkg_keep(int, char **);
/* fsops.c */
Expand Down

0 comments on commit 860db20

Please sign in to comment.