[Cupt-devel] Bug#695870: Bug#695870: cupt: Change "The following packages..." to "The following _n_ packages"

A. Costa agcosta at gis.net
Mon Dec 17 02:55:52 UTC 2012


On Sat, 15 Dec 2012 11:47:31 +0200
"Eugene V. Lyubimkin" <jackyf at debian.org> wrote:

> I removed numbers from 'package lists' on purpose since numbers
> naturally belongs to summary, and sometimes those lists are so big
> that don't event fit to the one page.

That's true.  Still, users can do a 'shift pageup' to see what's
scrolled off the terminal.  OTOH, your next suggestion (quoted right
below this) would be fine.

> ...Something like
> 
> | 5 (1 manually installed and 4 automatically installed) packages
> | will be installed

Logically satisfactory, but redundant (3x"installed").  
Attempt at reducing:

	5 packages will be installed, 1 manually and 4 automatically.
 
> > Optional finesse: handle singular & plural cases correctly, as above
> > for plural, and as follows for singular (just one package):
> > 
> >     The following 1 package will be installed:
> 
> Yep, placed into long-term TODO.

How I do that for typos, (shell script snippet, the details aren't
relevant, but the simple structure of it might be of interest):

        # check if there's more than one typo, plural or singular?
        TYPONUM=`grep --count "^\+[^+].*" $DIFFNAME`    # for 'diff -u'
        tylist="`cat ${TMPFILE}wirdlist`"
        case $TYPONUM in
                1)      TYPLURAL=
                        TYARTICLE=a
                        tylist="${tylist%, }"   # cut off last two chars
                        ;;
                2)      TYPLURAL=s
                        TYARTICLE="a few"
                        tylist="$(echo ${tylist%, } | sed 's/,/ and/')"
                        ;;
                [34])
                        TYPLURAL=s
                        TYARTICLE="some"
                        tylist="$(echo ${tylist%, } | sed 's/,\( "[^,]*$\)/ and\1/')"
                        ;;
                *)      TYPLURAL=s
                        TYARTICLE=some
                        tylist="${tylist} etc."
                        ;;
        esac
        SugSubj="'man $MP' typo$TYPLURAL: $tylist"
        whiptail  --inputbox "Edit subject line..."  6 75 "$SugSubj" 2> ${TMPFILE}sbjl
        case $? in
                0) SugSubj="`cat ${TMPFILE}sbjl`" ;;
                *) ;;
        esac
        echo "Suggested Subject:  $SugSubj" > ${TMPFILE}blah
        echo "Suggested body:" >> ${TMPFILE}blah
        echo "Found $TYARTICLE typo$TYPLURAL in '$MANPAGELONGNAME', see attached '.diff'.

Perhaps the above code should be abstracted for more general use and
spun off into its own text util.  Later such a util might be abstracted
further and made language independent.

HTH...



More information about the Cupt-devel mailing list