debian/0000755000000000000000000000000012273541617007176 5ustar debian/compat0000644000000000000000000000000211721761326010372 0ustar 7 debian/rc.postinst0000644000000000000000000000015311721761326011404 0ustar #!/bin/sh set -e if [ "$1" = "configure" ] && [ -z "$2" ]; then add-shell /usr/bin/rc fi #DEBHELPER# debian/rc.menu0000644000000000000000000000013711721761326010467 0ustar ?package(rc):needs="text" section="Applications/Shells" \ title="rc" command="/usr/bin/rc" debian/control0000644000000000000000000000150712273012643010574 0ustar Source: rc Section: shells Priority: optional Maintainer: Jakub Wilk Standards-Version: 3.9.5 Build-Depends: debhelper (>= 7), dh-buildinfo, dpkg-dev (>= 1.15.7), autoconf, automake, byacc, libncurses5-dev, libreadline-dev, procps XS-Testsuite: autopkgtest Package: rc Architecture: any Depends: ${misc:Depends}, ${shlibs:Depends} Description: implementation of the AT&T Plan 9 shell rc is a command interpreter and programming language similar to sh(1). It is based on the AT&T Plan 9 shell of the same name. The shell offers a C-like syntax (much more so than the C shell), and a powerful mechanism for manipulating variables. It is reasonably small and reasonably fast, especially when compared to contemporary shells. Its use is intended to be interactive, but the language lends itself well to scripts. debian/patches/0000755000000000000000000000000012273541353010622 5ustar debian/patches/which-error-handling.diff0000644000000000000000000000065212271733130015464 0ustar Description: improve error handling in the which() function Author: Jakub Wilk Forwarded: no Last-Update: 2014-01-28 --- a/which.c +++ b/which.c @@ -95,7 +95,11 @@ #endif if (ngroups) { gidset = ealloc(ngroups * sizeof(GETGROUPS_T)); - getgroups(ngroups, gidset); + ngroups = getgroups(ngroups, gidset); + if (ngroups < 0) { + uerror("getgroups"); + rc_exit(1); + } } #endif } debian/patches/trip-secure-tmp.diff0000644000000000000000000002225112273540660014516 0ustar Description: fix insecure use of /tmp Author: Jakub Wilk Bug-Debian: http://bugs.debian.org/737125 Forwared: no Last-Update: 2014-01-28 --- a/trip.rc +++ b/trip.rc @@ -4,9 +4,10 @@ rc=$0 echo tripping $rc $version +tmpdir='' fn fail { echo >[1=2] trip took a wrong turn: $* - rm -f $tmp + rm -rf $tmpdir fn sigexit exit 1 } @@ -23,8 +24,8 @@ fn sigexit { echo trip complete } -tmp=/tmp/trip.$pid -rm -f $tmp +tmpdir=`{ mktemp -t -d rc-trip.XXXXXX } +tmp=$tmpdir/tmp nl=' ' @@ -111,7 +112,7 @@ # heredocs and herestrings # -bigfile=/tmp/big.$pid +bigfile=$tmpdir/big.$pid od $rc | sed 5000q > $bigfile abc=(this is a) x=() @@ -155,19 +156,19 @@ $rc $tmp rm -f $tmp -echo here_is_a_really_long_word.It_has_got_to_be_longer_than_1000_characters_for_the_lexical_analyzers_buffer_to_overflow_but_that_should_not_be_too_difficult_to_do.Let_me_start_writing_some_Lewis_Carroll.Twas_brillig_and_the_slithy_toves,Did_gyre_and_gimble_in_the_wabe.All_mimsy_were_the_borogoves,And_the_mome-raths_outgrabe.Beware_the_Jabberwock_my_son,The_jaws_that_bite,the_claws_that_catch.Beware_the_Jub-jub_bird,and_shun_The_frumious_Bandersnatch.He_took_his_vorpal_sword_in_hand,Long_time_the_manxome_foe_he_sought,So_rested_he_by_the_Tumtum_tree,And_stood_awhile_in_thought.And_as_in_uffish_thought_he_stood,The_Jabberwock,with_eyes_of_flame,Came_whiffling_through_the_tulgey_wood,And_burbled_as_it_came.One_two,one_two.And_through_and_through_The_vorpal_blade_went_snicker-snack.He_left_it_dead_and_with_its_head,He_went_galumphing_back.And_hast_thou_slain_the_Jabberwock?Come_to_my_arms,my_beamish_boy,Oh_frabjous_day.Callooh_callay.He_chortled_in_his_joy.Twas_brillig,and_the_slithy_toves,Did_gyre_and_gimble_in_the_wabe,All_mimsy_were_the_borogoves,And_the_mome-raths_outgrabe. > /tmp/$pid.lw +echo here_is_a_really_long_word.It_has_got_to_be_longer_than_1000_characters_for_the_lexical_analyzers_buffer_to_overflow_but_that_should_not_be_too_difficult_to_do.Let_me_start_writing_some_Lewis_Carroll.Twas_brillig_and_the_slithy_toves,Did_gyre_and_gimble_in_the_wabe.All_mimsy_were_the_borogoves,And_the_mome-raths_outgrabe.Beware_the_Jabberwock_my_son,The_jaws_that_bite,the_claws_that_catch.Beware_the_Jub-jub_bird,and_shun_The_frumious_Bandersnatch.He_took_his_vorpal_sword_in_hand,Long_time_the_manxome_foe_he_sought,So_rested_he_by_the_Tumtum_tree,And_stood_awhile_in_thought.And_as_in_uffish_thought_he_stood,The_Jabberwock,with_eyes_of_flame,Came_whiffling_through_the_tulgey_wood,And_burbled_as_it_came.One_two,one_two.And_through_and_through_The_vorpal_blade_went_snicker-snack.He_left_it_dead_and_with_its_head,He_went_galumphing_back.And_hast_thou_slain_the_Jabberwock?Come_to_my_arms,my_beamish_boy,Oh_frabjous_day.Callooh_callay.He_chortled_in_his_joy.Twas_brillig,and_the_slithy_toves,Did_gyre_and_gimble_in_the_wabe,All_mimsy_were_the_borogoves,And_the_mome-raths_outgrabe. > $tmpdir/$pid.lw -echo 'here_is_a_really_long_word.It_has_got_to_be_longer_than_1000_characters_for_the_lexical_analyzers_buffer_to_overflow_but_that_should_not_be_too_difficult_to_do.Let_me_start_writing_some_Lewis_Carroll.Twas_brillig_and_the_slithy_toves,Did_gyre_and_gimble_in_the_wabe.All_mimsy_were_the_borogoves,And_the_mome-raths_outgrabe.Beware_the_Jabberwock_my_son,The_jaws_that_bite,the_claws_that_catch.Beware_the_Jub-jub_bird,and_shun_The_frumious_Bandersnatch.He_took_his_vorpal_sword_in_hand,Long_time_the_manxome_foe_he_sought,So_rested_he_by_the_Tumtum_tree,And_stood_awhile_in_thought.And_as_in_uffish_thought_he_stood,The_Jabberwock,with_eyes_of_flame,Came_whiffling_through_the_tulgey_wood,And_burbled_as_it_came.One_two,one_two.And_through_and_through_The_vorpal_blade_went_snicker-snack.He_left_it_dead_and_with_its_head,He_went_galumphing_back.And_hast_thou_slain_the_Jabberwock?Come_to_my_arms,my_beamish_boy,Oh_frabjous_day.Callooh_callay.He_chortled_in_his_joy.Twas_brillig,and_the_slithy_toves,Did_gyre_and_gimble_in_the_wabe,All_mimsy_were_the_borogoves,And_the_mome-raths_outgrabe.' > /tmp/$pid.lq +echo 'here_is_a_really_long_word.It_has_got_to_be_longer_than_1000_characters_for_the_lexical_analyzers_buffer_to_overflow_but_that_should_not_be_too_difficult_to_do.Let_me_start_writing_some_Lewis_Carroll.Twas_brillig_and_the_slithy_toves,Did_gyre_and_gimble_in_the_wabe.All_mimsy_were_the_borogoves,And_the_mome-raths_outgrabe.Beware_the_Jabberwock_my_son,The_jaws_that_bite,the_claws_that_catch.Beware_the_Jub-jub_bird,and_shun_The_frumious_Bandersnatch.He_took_his_vorpal_sword_in_hand,Long_time_the_manxome_foe_he_sought,So_rested_he_by_the_Tumtum_tree,And_stood_awhile_in_thought.And_as_in_uffish_thought_he_stood,The_Jabberwock,with_eyes_of_flame,Came_whiffling_through_the_tulgey_wood,And_burbled_as_it_came.One_two,one_two.And_through_and_through_The_vorpal_blade_went_snicker-snack.He_left_it_dead_and_with_its_head,He_went_galumphing_back.And_hast_thou_slain_the_Jabberwock?Come_to_my_arms,my_beamish_boy,Oh_frabjous_day.Callooh_callay.He_chortled_in_his_joy.Twas_brillig,and_the_slithy_toves,Did_gyre_and_gimble_in_the_wabe,All_mimsy_were_the_borogoves,And_the_mome-raths_outgrabe.' > $tmpdir/$pid.lq -if (!~ ``(){cat /tmp/$pid.lw} ``(){cat /tmp/$pid.lq}) +if (!~ ``(){cat $tmpdir/$pid.lw} ``(){cat $tmpdir/$pid.lq}) fail expected long string and long word to be identical -if (! x=`{wc -c /tmp/$pid.lw} ~ $x(1) 1088) +if (! x=`{wc -c $tmpdir/$pid.lw} ~ $x(1) 1088) fail expected long word to be 1088 bytes -if (! x=`{wc -c /tmp/$pid.lq} ~ $x(1) 1088) +if (! x=`{wc -c $tmpdir/$pid.lq} ~ $x(1) 1088) fail expected long quote to be 1088 bytes -rm /tmp/$pid.lw -rm /tmp/$pid.lq +rm $tmpdir/$pid.lw +rm $tmpdir/$pid.lq submatch 'echo hi |[2' 'expected ''='' or '']'' after digit' 'scan error' submatch 'echo hi |[92=]' 'expected digit after ''=''' 'scan error' @@ -329,9 +330,9 @@ # # matching # -touch /tmp/abc.$pid /tmp/bbc.$pid -mkdir /tmp/dir.$pid /tmp/dip.$pid -touch /tmp/dir.$pid/^(a b c) /tmp/dip.$pid/^(a b c) +touch $tmpdir/abc.$pid $tmpdir/bbc.$pid +mkdir $tmpdir/dir.$pid $tmpdir/dip.$pid +touch $tmpdir/dir.$pid/^(a b c) $tmpdir/dip.$pid/^(a b c) if (!~ 123 [~x]?[0-9]) fail match @@ -352,18 +353,18 @@ if (~ x x?) fail too many characters in pattern -sh -c 'test -f /////tmp//////a?c.'^$pid || fail glob with many slashes -if (!~ /////tmp//////a*.$pid /////tmp//////a?c.$pid) +sh -c 'test -f /////$tmpdir//////a?c.'^$pid || fail glob with many slashes +if (!~ /////$tmpdir//////a*.$pid /////$tmpdir//////a?c.$pid) fail glob with many slashes -if (!~ ////tmp////di?.$pid////* ////tmp////dir.$pid////*b*) +if (!~ ////$tmpdir////di?.$pid////* ////$tmpdir////dir.$pid////*b*) fail glob with more slashes -if (! @{cd /; ~ */a*.$pid tmp/a*}) +if (! @{cd $tmpdir; ~ *.$pid/a d*/*}) fail glob in current directory -if (!~ /tmp/?bc.$pid /tmp/bbc.$pid) +if (!~ $tmpdir/?bc.$pid $tmpdir/bbc.$pid) fail match of bbc.$pid against '('abc.$pid bbc.$pid')' -rm /tmp/abc.$pid /tmp/bbc.$pid -rm -rf /tmp/dir.$pid /tmp/dip.$pid +rm $tmpdir/abc.$pid $tmpdir/bbc.$pid +rm -rf $tmpdir/dir.$pid $tmpdir/dip.$pid # # signals @@ -377,10 +378,10 @@ # $rc -c /frobnatz >[2]/dev/null && fail 'search error' -touch /tmp/noexec.$pid -chmod a-x /tmp/noexec.$pid -$rc -c /tmp/noexec.$pid >[2]/dev/null && fail /tmp/noexec.$pid is found!? -rm /tmp/noexec.$pid +touch $tmpdir/noexec.$pid +chmod a-x $tmpdir/noexec.$pid +$rc -c $tmpdir/noexec.$pid >[2]/dev/null && fail $tmpdir/noexec.$pid is found!? +rm $tmpdir/noexec.$pid submatch 'path='''' frobnatz' 'frobnatz not found' 'search error' @@ -409,15 +410,15 @@ if (~ `` '' {. -i} ?*) fail null dot -i -cat > /tmp/dot.$pid << eof +cat > $tmpdir/dot.$pid << eof echo hi eof -prompt=';' if (!~ `` '' {. -i /tmp/dot.$pid>[2=1]} ';hi'^$nl';') +prompt=';' if (!~ `` '' {. -i $tmpdir/dot.$pid>[2=1]} ';hi'^$nl';') fail dot -i -submatch .' '/tmp/dot.$pid hi dot +submatch .' '$tmpdir/dot.$pid hi dot -rm /tmp/dot.$pid +rm $tmpdir/dot.$pid $rc -c '. /frobnatz' >[2]/dev/null && fail 'dot of a nonexistent file' @@ -522,19 +523,19 @@ # # history # -history=/tmp/hist.$pid prompt='' echo 'history=()' | $rc -i +history=$tmpdir/hist.$pid prompt='' echo 'history=()' | $rc -i -if (!~ `{cat /tmp/hist.$pid} 'history=()') +if (!~ `{cat $tmpdir/hist.$pid} 'history=()') fail output to history file -history=/tmp/hist.$pid prompt='' echo 'history=()' | $rc -i +history=$tmpdir/hist.$pid prompt='' echo 'history=()' | $rc -i -if (!~ `` () {cat /tmp/hist.$pid} 'history=() +if (!~ `` () {cat $tmpdir/hist.$pid} 'history=() history=() ') fail append to history file -rm /tmp/hist.$pid +rm $tmpdir/hist.$pid if (!~ `{history=/frobnatz/foo prompt='' echo eval | $rc -i >[2=1]} ?*) fail accessing bad history file @@ -588,9 +589,11 @@ ' || fail sneaky parens bug # before rc-1.7.1, certain glob patterns could fail on broken symlinks -mkdir $tmp.qux -ln -s /frobnatz $tmp.qux/foo -x=$tmp.qux/foo* -~ $x $tmp.qux/foo || { rm -rf $tmp.qux; fail broken symlink globbing } -x=$tmp.qux*/foo -~ $x $tmp.qux/foo || { rm -rf $tmp.qux; fail broken symlink globbing } +mkdir $tmpdir/qux +ln -s /frobnatz $tmpdir/qux/foo +x=$tmpdir/qux/foo* +~ $x $tmpdir/qux/foo || { rm -rf $tmpdir/qux; fail broken symlink globbing } +x=$tmpdir/qux*/foo +~ $x $tmpdir/qux/foo || { rm -rf $tmpdir/qux; fail broken symlink globbing } + +rm -rf $tmpdir debian/patches/series0000644000000000000000000000030612272240274012033 0ustar aclocal-quoting.diff configure-modernize-ac-init-automake.diff which-error-handling.diff panic-attribute-noreturn.diff trip-secure-tmp.diff trip-hide-envvars.diff typos.diff manpage-typography.diff debian/patches/aclocal-quoting.diff0000644000000000000000000000555012271736732014550 0ustar Description: fix underquoted calls to AC_DEFUN in acinclude.m4 Starting with Automake 1.8, aclocal warns about all underquoted calls to AC_DEFUN. This patches fixes the warnings. Author: Jakub Wilk Forwarded: no Last-Update: 2014-01-28 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1,6 +1,6 @@ dnl This macro sets HAVE_POSIX_GETGROUPS if the dnl getgroups() function accepts a zero first argument. -AC_DEFUN(RC_FUNC_GETGROUPS, [ +AC_DEFUN([RC_FUNC_GETGROUPS], [ AC_CACHE_CHECK(for POSIX getgroups, rc_cv_func_posix_getgroups, AC_TRY_RUN([ #include #include @@ -16,7 +16,7 @@ dnl We can't use AC_CHECK_FUNCS for sigsetjmp(), since it's a macro in dnl some places. -AC_DEFUN(RC_FUNC_SIGSETJMP, [ +AC_DEFUN([RC_FUNC_SIGSETJMP], [ AC_CACHE_CHECK(for sigsetjmp, rc_cv_sigsetjmp, AC_TRY_LINK([ #include @@ -30,7 +30,7 @@ ]) dnl Similarly, AC_CHECK_FUNCS doesn't find strerror() on NetBSD. -AC_DEFUN(RC_FUNC_STRERROR, [ +AC_DEFUN([RC_FUNC_STRERROR], [ AC_CACHE_CHECK(for strerror, rc_cv_strerror, AC_TRY_LINK([ #include @@ -43,7 +43,7 @@ ]) dnl HPUX needs _KERNEL defined to pick up RLIMIT_foo defines. (Why?) -AC_DEFUN(RC_NEED_KERNEL, [ +AC_DEFUN([RC_NEED_KERNEL], [ AC_CACHE_CHECK(if _KERNEL is required for RLIMIT defines, rc_cv_kernel_rlimit, AC_TRY_COMPILE([ #include @@ -66,7 +66,7 @@ ]) dnl Look for rlim_t in sys/types.h and sys/resource.h -AC_DEFUN(RC_TYPE_RLIM_T, [ +AC_DEFUN([RC_TYPE_RLIM_T], [ AC_CACHE_CHECK(for rlim_t, rc_cv_have_rlim_t, AC_EGREP_CPP(rlim_t, [ #include @@ -118,7 +118,7 @@ dnl Check type of sig_atomic_t. -AC_DEFUN(RC_TYPE_SIG_ATOMIC_T, [ +AC_DEFUN([RC_TYPE_SIG_ATOMIC_T], [ AC_CACHE_CHECK(for sig_atomic_t, rc_cv_sig_atomic_t, AC_EGREP_HEADER(sig_atomic_t, signal.h, rc_cv_sig_atomic_t=yes, rc_cv_sig_atomic_t=no)) @@ -135,7 +135,7 @@ dnl exit(), wait() returns with the PID of the child as normal. (Real dnl SysV waits for all children to exit, then returns with ECHILD.) dnl Anyway, this is why the `sleep(1)' is there. -AC_DEFUN(RC_SYS_V_SIGCLD, [ +AC_DEFUN([RC_SYS_V_SIGCLD], [ AC_CACHE_CHECK(for SysV SIGCLD semantics, rc_cv_sysv_sigcld, AC_TRY_RUN([ #include @@ -165,7 +165,7 @@ dnl Do we have /dev/fd or /proc/self/fd? -AC_DEFUN(RC_SYS_DEV_FD, [ +AC_DEFUN([RC_SYS_DEV_FD], [ AC_CACHE_CHECK(for /dev/fd, rc_cv_sys_dev_fd, if test -d /dev/fd && test -r /dev/fd/0; then rc_cv_sys_dev_fd=yes @@ -179,7 +179,7 @@ dnl Can mknod make FIFOs? -AC_DEFUN(RC_SYS_MKNOD_FIFO, [ +AC_DEFUN([RC_SYS_MKNOD_FIFO], [ AC_CACHE_CHECK(for mknod FIFOs, rc_cv_sys_fifo, AC_TRY_RUN([ #include @@ -196,7 +196,7 @@ ]) dnl Where is tgetent()? -AC_DEFUN(RC_LIB_TGETENT, [ +AC_DEFUN([RC_LIB_TGETENT], [ AC_CHECK_LIB(termcap, tgetent, rc_lib_tgetent=-ltermcap, AC_CHECK_LIB(ncurses, tgetent, debian/patches/trip-hide-envvars.diff0000644000000000000000000000072712271732656015037 0ustar Description: hide environment variables from the test suite output It might not be desirable to expose environment variables in the build log. Hide them from the test suite output. Author: Jakub Wilk Forwarded: not-needed Last-Update: 2014-01-28 --- a/trip.rc +++ b/trip.rc @@ -287,7 +287,7 @@ whatis -s expect list of variables and functions -whatis +whatis > /dev/null submatch 'whatis -x' 'whatis: bad option: -x' 'bad option to whatis' debian/patches/typos.diff0000644000000000000000000000347412271732655012647 0ustar Description: fix a few spelling errors Author: Jakub Wilk Forwarded: no Last-Update: 2014-01-28 --- a/rc.h +++ b/rc.h @@ -128,7 +128,7 @@ /* for the formatting routines */ va_list args; long flags, f1, f2; - /* for the buffer maintainence routines */ + /* for the buffer maintenance routines */ char *buf, *bufbegin, *bufend; int flushed; void (*grow)(Format *, size_t); --- a/which.c +++ b/which.c @@ -1,7 +1,7 @@ /* which.c: check to see if a file is executable. This function was originally written with Maarten Litmaath's which.c as - a template, but was changed in order to accomodate the possibility of + a template, but was changed in order to accommodate the possibility of rc's running setuid or the possibility of executing files not in the primary group. Much of this file has been re-vamped by Paul Haahr. I re-re-vamped the functions that Paul supplied to correct minor bugs --- a/input.c +++ b/input.c @@ -229,7 +229,7 @@ save_lineno = istack->saved; } -/* flush input characters upto newline. Used by scanerror() */ +/* flush input characters up to newline. Used by scanerror() */ extern void flushu() { int c; --- a/glob.c +++ b/glob.c @@ -143,7 +143,7 @@ } /* - lglob() globs a pattern agains a list of directory roots. e.g., (/tmp /usr /bin) "*" + lglob() globs a pattern against a list of directory roots. e.g., (/tmp /usr /bin) "*" will return a list with all the files in /tmp, /usr, and /bin. NULL on no match. slashcount indicates the number of slashes to stick between the directory and the matched name. e.g., for matching ////tmp/////foo* --- a/lex.c +++ b/lex.c @@ -333,7 +333,7 @@ } extern void scanerror(char *s) { - flushu(); /* flush upto newline */ + flushu(); /* flush up to newline */ yyerror(s); errset = prerror = TRUE; } debian/patches/configure-modernize-ac-init-automake.diff0000644000000000000000000000124112271737011020547 0ustar Description: modernize the AM_INIT_AUTOMAKE call in the configure script Author: Jakub Wilk Forwarded: no Last-Update: 2014-01-28 --- a/configure.ac +++ b/configure.ac @@ -1,15 +1,12 @@ -dnl Get things going... -AC_INIT(rc.h) +dnl Automake stuff. +AC_INIT([rc], [1.7.1]) +AC_CONFIG_SRCDIR([rc.h]) +AM_INIT_AUTOMAKE + RELDATE=`cat $srcdir/RELDATE` AC_DEFINE_UNQUOTED(RELDATE, "$RELDATE", [Release date]) -dnl Automake stuff. -dnl Use this one for snapshots... -dnl AM_INIT_AUTOMAKE(rc, 1.7s`echo $RELDATE |sed 's/-//g'`) -dnl ...and this one for releases -AM_INIT_AUTOMAKE(rc, 1.7.1) - AM_CONFIG_HEADER(config.h) dnl Find a standard C compiler debian/patches/manpage-typography.diff0000644000000000000000000002453412273541352015277 0ustar Description: improve typography in the manual page Author: Jakub Wilk Date: 2014-01-29 Forwarded: no Last-Update: 2014-01-29 --- a/rc.1 +++ b/rc.1 @@ -194,7 +194,7 @@ .Cr $* . Thus: .Ds -.Cr "rc -c 'echo $*' 1 2 3" +.Cr "rc \-c \(aqecho $*\(aq 1 2 3" .De .TP \& @@ -393,28 +393,28 @@ automatically terminate words. The following characters are special: .Ds -.Cr "# ; & | ^ $ = \` ' { } ( ) < >" +.Cr "# ; & | ^ $ = \` \(aq { } ( ) < >" .De .PP The single quote -.Rc ( ' ) +.Rc ( \(aq ) prevents special treatment of any character other than itself. All characters, including control characters, newlines, and backslashes between two quote characters are treated as an uninterpreted string. A quote character itself may be quoted by placing two quotes in a row. The minimal sequence needed to enter the quote character is -.Cr '''' . +.Cr \(aq\(aq\(aq\(aq . The empty string is represented by -.Cr '' . +.Cr \(aq\(aq . Thus: .Ds -.Cr "echo 'What''s the plan, Stan?'" +.Cr "echo \(aqWhat\(aq\(aqs the plan, Stan?\(aq" .De .PP prints out .Ds -.Cr "What's the plan, Stan?" +.Cr "What\(aqs the plan, Stan?" .De .PP The number sign @@ -427,9 +427,9 @@ the backslash is ignored along with everything else. .SS Grouping Zero or more commands may be grouped within braces -.Rc (`` { '' +.Rc (\(lq { \(rq and -.Rc `` } ''), +.Rc \(lq } \(rq), and are then treated as one command. Braces do not otherwise define scope; they are used only for command grouping. @@ -532,11 +532,11 @@ .PP If the file does not exist, then it is created. .PP -``Here documents'' are supported as in +\(lqHere documents\(rq are supported as in .I sh with the use of .Ds -.Cr "command << 'eof-marker'" +.Cr "command << \(aqeof-marker\(aq" .De .PP Subsequent lines form the standard input of @@ -567,11 +567,11 @@ .PP Additionally, .I rc -supports ``here strings'', which are like here documents, +supports \(lqhere strings\(rq, which are like here documents, except that input is taken directly from a string on the command line. Their use is illustrated here: .Ds -.Cr "cat <<< 'this is a here string' | wc" +.Cr "cat <<< \(aqthis is a here string\(aq | wc" .De .PP (This feature enables @@ -643,7 +643,7 @@ .IR tee (1) and the output version of this notation: .Ds -.Cr "echo hi there | tee >{sed 's/^/p1 /'} >{sed 's/^/p2 /'}" +.Cr "echo hi there | tee >{sed \(aqs/^/p1 /\(aq} >{sed \(aqs/^/p2 /\(aq}" .De .SH "CONTROL STRUCTURES" The following may be used for control flow in @@ -693,8 +693,8 @@ (which may contain variables and backquote substitutions) and runs .IR cmd . If -.Rc `` in -.IR list '' +.Rc \(lq in +.IR list \(rq is omitted, then .I rc will set @@ -703,7 +703,7 @@ .Cr $* . For example: .Ds -.Cr "for (i in \`{ls -F | grep '\e*$' | sed 's/\e*$//'}) { commands }" +.Cr "for (i in \`{ls \-F | grep \(aq\e*$\(aq | sed \(aqs/\e*$//\(aq}) { commands }" .De .TP \& @@ -747,13 +747,13 @@ .De .PP executes the first command and then executes the second command if and only if -the first command exits with a zero exit status (``true'' in Unix). +the first command exits with a zero exit status (\(lqtrue\(rq in Unix). .Ds .Cr "command || command" .De .PP executes the first command and then executes the second command if and only if -the first command exits with a nonzero exit status (``false'' in Unix). +the first command exits with a nonzero exit status (\(lqfalse\(rq in Unix). .Ds .Cr "! command" .De @@ -783,7 +783,7 @@ literally in the input. Thus, .Ds -.Cr "foo='*'" +.Cr "foo=\(aq*\(aq" .Cr "echo $foo" .De .PP @@ -907,14 +907,14 @@ .De .PP Note that the null string, -.Cr "''" , +.Cr "\(aq\(aq" , and the null list, .Cr "()" , are two very different things. Assigning the null string to a variable is a valid operation, but it does not remove its definition. .Ds -.Cr "null = '' empty = () echo $#null $#empty" +.Cr "null = \(aq\(aq empty = () echo $#null $#empty" .De .PP produces the output @@ -968,7 +968,7 @@ .PP .I rc takes care to insert a free-caret between the -.Rc `` \- '' +.Rc \(lq \- \(rq and .Cr "$opts" , as well @@ -1031,7 +1031,7 @@ .Ic var =() .De .PP -For ``free careting'' to work correctly, +For \(lqfree careting\(rq to work correctly, .I rc must make certain assumptions about what characters may appear in a variable name. @@ -1045,7 +1045,7 @@ characters in its name, quote the variable name. Thus: .Ds -.Cr "echo $'we$Ird:Variab!le'" +.Cr "echo $\(aqwe$Ird:Variab!le\(aq" .De .SS "Local Variables" Any number of variable assignments may be made local to a single @@ -1112,7 +1112,7 @@ .IR rc 's list operations: .Ds -.Cr "$var(\`{awk 'BEGIN{for(i=1;i<=10;i++)print i;exit; }'})" +.Cr "$var(\`{awk \(aqBEGIN{for(i=1;i<=10;i++)print i;exit; }\(aq})" .De .PP returns the first 10 elements of @@ -1201,13 +1201,13 @@ Several variables are known to .I rc and are treated specially. -In the following list, ``default'' indicates that +In the following list, \(lqdefault\(rq indicates that .I rc -gives the variable a default value on startup; ``no-export'' indicates -that the variable is never exported; and ``read-only'' indicates that +gives the variable a default value on startup; \(lqno-export\(rq indicates +that the variable is never exported; and \(lqread-only\(rq indicates that an attempt to set the variable will silently have no effect. .PP -Also, ``alias'' means that the variable is aliased to the same name in +Also, \(lqalias\(rq means that the variable is aliased to the same name in capitals. For example, an assignment to .Cr $cdpath @@ -1293,7 +1293,7 @@ \& whereas .Ds -.Cr "x=`{echo foo |grep bar}; whatis bqstatus" +.Cr "x=\`{echo foo |grep bar}; whatis bqstatus" .De .TP \& @@ -1380,7 +1380,7 @@ sets .Cr $prompt to -.Cr "('; ' '')" +.Cr "(\(aq; \(aq \(aq\(aq)" by default. The reason for this is that it enables an .I rc @@ -1413,7 +1413,7 @@ If the command exited with a numeric value, that number is the status. If the command died with a signal, the status is the name of that signal; if a core file was created, the string -.Rc `` +core '' +.Rc \(lq +core \(rq is appended. The value of .Cr $status @@ -1474,12 +1474,12 @@ .IR ls (1), could be: .Ds -.Cr "fn l { ls -FC $* }" +.Cr "fn l { ls \-FC $* }" .De .PP but not .Ds -.Cr "fn l { ls -FC } # WRONG" +.Cr "fn l { ls \-FC } # WRONG" .De .SH "INTERRUPTS AND SIGNALS" .I rc @@ -1568,7 +1568,7 @@ .De .TP \& -does the ``right thing''. +does the \(lqright thing\(rq. .TP .B break Breaks from the innermost @@ -1592,7 +1592,7 @@ same names as builtins to use the underlying builtin or binary. For example: .Ds -.Cr "fn ls { builtin ls -FC $* }" +.Cr "fn ls { builtin ls \-FC $* }" .De .TP \& @@ -1600,7 +1600,7 @@ .Cr ls (1), whereas .Ds -.Cr "fn ls { ls -FC $* } # WRONG" +.Cr "fn ls { ls \-FC $* } # WRONG" .De .TP \& @@ -1701,7 +1701,7 @@ disables core dumps. To set a soft limit equal to the hard limit: .Ds -.Cr "limit `{limit -h datasize}" +.Cr "limit \`{limit \-h datasize}" .De .TP .B newpgrp @@ -1787,7 +1787,7 @@ Without arguments, .Cr whatis is equivalent to -.Cr "whatis -fv" , +.Cr "whatis \-fv" , and prints the values of all shell variables and functions. .TP \& @@ -1803,7 +1803,7 @@ .Cr . command. Another note: -.Cr "whatis -s > file" +.Cr "whatis \-s > file" cannot be used to store the state of .IR rc 's signal handlers in a file, because builtins with redirections @@ -1859,9 +1859,9 @@ .Cr "fn lflat {" .Cr " lflat=$*; *=$$1" .Cr " while () {" -.Cr " echo -n $1; shift" +.Cr " echo \-n $1; shift" .Cr " ~ $#* 0 && break" -.Cr " echo -n $lflat(2)" +.Cr " echo \-n $lflat(2)" .Cr "}" .De .PP @@ -1900,11 +1900,11 @@ %term ANDAND BACKBACK BANG CASE COUNT DUP ELSE END FLAT FN FOR IF IN %term OROR PIPE REDIR SUB SUBSHELL SWITCH TWIDDLE WHILE WORD HUH -%left WHILE ')' ELSE -%left ANDAND OROR '\en' +%left WHILE \(aq)\(aq ELSE +%left ANDAND OROR \(aq\en\(aq %left BANG SUBSHELL %left PIPE -%right '$' +%right \(aq$\(aq %left SUB %start rc @@ -1914,27 +1914,27 @@ rc: line end | error end -end: END /* EOF */ | '\en' +end: END /* EOF */ | \(aq\en\(aq -cmdsa: cmd ';' | cmd '&' +cmdsa: cmd \(aq;\(aq | cmd \(aq&\(aq line: cmd | cmdsa line body: cmd | cmdsan body -cmdsan: cmdsa | cmd '\en' +cmdsan: cmdsa | cmd \(aq\en\(aq -brace: '{' body '}' +brace: \(aq{\(aq body \(aq}\(aq -paren: '(' body ')' +paren: \(aq(\(aq body \(aq)\(aq -assign: first '=' word +assign: first \(aq=\(aq word epilog: /* empty */ | redir epilog redir: DUP | REDIR word -case: CASE words ';' | CASE words '\en' +case: CASE words \(aq;\(aq | CASE words \(aq\en\(aq cbody: cmd | case cbody | cmdsan cbody @@ -1945,10 +1945,10 @@ | simple | brace epilog | IF paren optnl iftail - | FOR '(' word IN words ')' optnl cmd - | FOR '(' word ')' optnl cmd + | FOR \(aq(\(aq word IN words \(aq)\(aq optnl cmd + | FOR \(aq(\(aq word \(aq)\(aq optnl cmd | WHILE paren optnl cmd - | SWITCH '(' word ')' optnl '{' cbody '}' + | SWITCH \(aq(\(aq word \(aq)\(aq optnl \(aq{\(aq cbody \(aq}\(aq | TWIDDLE optcaret word words | cmd ANDAND optnl cmd | cmd OROR optnl cmd @@ -1960,24 +1960,24 @@ | FN words brace | FN words -optcaret: /* empty */ | '^' +optcaret: /* empty */ | \(aq^\(aq simple: first | simple word | simple redir -first: comword | first '^' sword +first: comword | first \(aq^\(aq sword sword: comword | keyword -word: sword | word '^' sword +word: sword | word \(aq^\(aq sword -comword: '$' sword - | '$' sword SUB words ')' +comword: \(aq$\(aq sword + | \(aq$\(aq sword SUB words \(aq)\(aq | COUNT sword | FLAT sword - | '`' sword - | '`' brace + | \(aq\`\(aq sword + | \(aq\`\(aq brace | BACKBACK word brace | BACKBACK word sword - | '(' words ')' + | \(aq(\(aq words \(aq)\(aq | REDIR brace | WORD @@ -1986,7 +1986,7 @@ words: /* empty */ | words word -optnl: /* empty */ | optnl '\en' +optnl: /* empty */ | optnl \(aq\en\(aq .ft R .De .SH FILES @@ -2045,7 +2045,7 @@ expression are a syntax error. Thus, this code is illegal. .Ds -.Cr "while ((~ $1 -*) && (! ~ $1 --)) { ..." +.Cr "while ((~ $1 \-*) && (! ~ $1 \-\-)) { ..." .De .TP The redundant inner parentheses must be omitted. @@ -2138,7 +2138,7 @@ to the name of a function being executed/file being sourced. .SH "SEE ALSO" -``rc \(em A Shell for Plan 9 and UNIX Systems'', +\(lqrc \(em A Shell for Plan 9 and UNIX Systems\(rq, Unix Research System, Tenth Edition, Volume 2. (Saunders College Publishing) debian/patches/panic-attribute-noreturn.diff0000644000000000000000000000116612273541352016424 0ustar Description: mark panic() with attribute noreturn Mark the panic() function with attribute noreturn. . This is to avoid false-positive warning: ../open.c:24:13: warning: array subscript is above array bounds [-Warray-bounds] Author: Jakub Wilk Forwarded: not-needed Last-Update: 2012-06-09 --- a/rc.h +++ b/rc.h @@ -428,7 +428,11 @@ extern int mvfd(int, int); extern int starstrcmp(const void *, const void *); extern void pr_error(char *, int); -extern void panic(char *); +extern void panic(char *) +#ifdef __GNUC__ +__attribute__((noreturn)) +#endif +; extern void uerror(char *); /* wait.c */ debian/copyright0000644000000000000000000000324111721761326011127 0ustar This is the Debian GNU/Linux prepackaged version of the rc shell. rc was written by Byron Rakitzis, and is currently maintained by Tim Goodwin . The package was originally downloaded from . While the site is no longer accessible, a copy of the site is available at . The source is also still available from . This package was maintained by: - Dale Scheetz (1998-1999); - Decklin Foster (2000-2006); - Jakub Wilk (since 2011). License: Copyright 1991 Byron Rakitzis. All rights reserved. This software is not subject to any license of the American Telephone and Telegraph Company or of the Regents of the University of California. Permission is granted to anyone to use this software for any purpose on any computer system, and to alter it and redistribute it freely, subject to the following restrictions: 1. The author is not responsible for the consequences of use of this software, no matter how awful, even if they arise from flaws in it. 2. The origin of this software must not be misrepresented, either by explicit claim or by omission. Since few users ever read sources, credits must appear in the documentation. 3. Altered versions must be plainly marked as such, and must not be misrepresented as being the original software. Since few users ever read sources, credits must appear in the documentation. 4. This notice may not be removed or altered. [this copyright notice is adapted from Henry Spencer's "awf" copyright notice.] debian/rc.docs0000644000000000000000000000003511721761326010450 0ustar AUTHORS EXAMPLES NEWS README debian/watch0000644000000000000000000000016711721761326010231 0ustar version=3 opts="uversionmangle=s/(?<=[0-9])b/~b/" \ ftp://ftp.sys.utoronto.ca/pub/rc/ rc-([0-9][.0-9a-z-]+)[.]tar[.]gz debian/changelog0000644000000000000000000002114512273541617011053 0ustar rc (1.7.1-5) unstable; urgency=low * Add patch (aclocal-quoting.diff) to fix underquoted calls to AC_DEFUN in acinclude.m4. * Add patch (configure-modernize-ac-init-automake.diff) to modernize the AM_INIT_AUTOMAKE call in the configure script. * Add “compile” to the list of ignored files in debian/source/options. * Add patch (panic-attribute-noreturn.diff) to mark the panic() function with attribute noreturn, in order to avoid false positive warnings about array bounds. * Build with -Werror=array-bounds. * Build with -fvisibility=hidden, in order to avoid false positive binary-file-built-without-LFS-support lintian tag. * Add patch (which-error-handling.diff) to improve error handling in the which() function. * Rebuild parse.c at build time. + Update debian/rules. + Add parse.c to the list of ignored files in debian/source/options. + Add byacc to Build-Depends. * Bump standards version to 3.9.5 (no changes needed). * Add patch (trip-secure-tmp.diff) to fix insecure use of /tmp in the test suite (closes: #737125). * Add patch (trip-hide-envvars.diff) to hide environment variables from the test suite output, so that they are not accidentally exposed in a build log. * Run tests at build time. + Update debian/rules. + Add procpc to Build-Depends. * Add DEP-8 tests. * Add patch (typos.diff) to fix a few spelling errors. * Add patch (manpage-typography.diff) to improve typography in the manual page. * Force gzip compression for .debian.tar. * Don't use dh_testdir; instead use target dependencies to ensure that debian/rules is run from the correct directory. * Run dh_clean as the first command in the clean target. * Use dh-buildinfo: + Update debian/rules. + Add the package to Build-Depends. -- Jakub Wilk Sun, 02 Feb 2014 23:15:42 +0100 rc (1.7.1-4) unstable; urgency=low * New maintainer (closes: #660508). Thanks to Decklin Foster for his past work. * Add ${misc:Depends} to Depends. * Rewrite debian/rules from scratch. + Pass --configure to the configure script only when cross-building. + Build out-of-tree. + Don't ignore ‘make distclean’ in the clean target; delete the whole build directory instead. + Don't pass --info-dir to the configure script, and don't call dh_installinfo, since there is no info documentation anyway. + Link using --as-needed, in order to avoid dependency on libtinfo. * Regerate autoconf files at build time: + Add build-dependency on autoconf, automake. + Add extend-diff-ignore to debian/source/options, to ignore regenerated files. + Update debian/rules. * Pass {C,CPP,LD}FLAGS acquired from dpkg-buildflags to the configure script: + Add build-dependency on dpkg-dev (>= 1.15.7), for dpkg-buildflags support. + Update debian/rules. * Bump debian/compat to 7. Bump build-dependency on debhelper to >= 7. * Remove debian/rc.dirs; it's not needed as upstream makefiles creates needed directories anyway. * Remove an article from the package synopsis. Re-wrap the long description. * Convert to source format 3.0 (quilt). + Add debian/source/format. * Bump standards version to 3.9.3. + Change menu sertion from “Apps/Shells” to “Applications/Shells”. * Don't ignore errors in maintainer scripts. * Don't hardcode paths to {add,remove}-shell in maintainer scripts. * Add watch file. * Rename debian/rc.copyright to debian/copyright. * Update the copyright file (closes: #367004). Thanks to Harri Haataja for the bug report. -- Jakub Wilk Fri, 24 Feb 2012 20:00:41 +0100 rc (1.7.1-3.1) unstable; urgency=low * Non-maintainer upload. * Build-depend on libreadline-dev instead of libreadline5-dev (closes: #553835). Thanks to Matthias Klose for the bug report. -- Jakub Wilk Sun, 07 Aug 2011 12:37:03 +0200 rc (1.7.1-3) unstable; urgency=low * Use add-shell and remove-shell. (Closes: #361547) * Bump Standards-Version to 3.6.2. -- Decklin Foster Tue, 11 Apr 2006 05:02:20 -0400 rc (1.7.1-2) unstable; urgency=low * Compile against libreadline5. * Remove period and leading capitalization from description in control file. -- Decklin Foster Sat, 25 Dec 2004 08:28:05 -0500 rc (1.7.1-1) unstable; urgency=low * New upstream release * Update to policy 3.6.1 and debhelper 4 -- Decklin Foster Sat, 20 Sep 2003 21:18:24 -0400 rc (1.7-1) unstable; urgency=low * New upstream release. 1.7 is finally done! -- Decklin Foster Fri, 21 Jun 2002 17:45:08 -0400 rc (1.6c7-1) unstable; urgency=low * New upstream release -- Decklin Foster Thu, 23 May 2002 15:25:46 -0400 rc (1.6c6-1) unstable; urgency=low * New upstream release -- Decklin Foster Sat, 9 Feb 2002 18:15:50 -0500 rc (1.6c5-1) unstable; urgency=low * New upstream release, another RC of rc (ha ha!) * Revert config.{sub,guess} stuff; these aren't even used upstream. -- Decklin Foster Thu, 22 Nov 2001 00:15:47 -0500 rc (1.6c4-1) unstable; urgency=low * New upstream release. This is a release candidate for rc 1.7, so file bugs if you got 'em. -- Decklin Foster Wed, 31 Oct 2001 17:08:33 -0500 rc (1.6b3-1) unstable; urgency=low * New upstream release: - Patches from #99603 and #80902 are now merged - Fixed premature exit and uninterruptible looping bugs - -I (noninteractive) option added, -V replaced with $version - Handling of ^A in lists improved * Fixed 'CFLAGS' typo in debian/rules * Use autotools-dev config.{sub,guess} files, and call ./configure with the proper architecture options. * Updated Standards-Version to 3.5.6 -- Decklin Foster Mon, 15 Oct 2001 20:25:50 -0400 rc (1.6b2-4) unstable; urgency=low * Updated to debhelper v3 and policy 3.5.4. - Since we're no longer using dh_installmanpages, history.1 (which documents an extra binary not included in the package) will not be installed. (Closes: #99603) - Added support for DEB_BUILD_OPTIONS. -- Decklin Foster Sat, 2 Jun 2001 16:17:52 -0400 rc (1.6b2-3) unstable; urgency=low * Applied patch to build on PPC (Closes: #80902) * debian/rules: added dh_testversion check. * install AUTHORS into /usr/share/doc/rc. -- Decklin Foster Wed, 3 Jan 2001 12:43:57 -0500 rc (1.6b2-2) unstable; urgency=low * Repackaged from scratch using debhelper. * Applied upstream patch for the "~ () '*'" bug (Closes: #62339) -- Decklin Foster Mon, 30 Oct 2000 01:29:38 -0500 rc (1.6b2-1) unstable; urgency=low * New upstream release. This incorporates the __va_copy patches, so they are no longer included in the Debian .diff.gz. * Incorporated menu file from /usr/lib/menu/default (Closes: #46611) * debian/control: added Build-Depends * debian/copyright: updated URL for upstream sources -- Decklin Foster Wed, 30 Aug 2000 11:25:06 -0400 rc (1.6-4) unstable; urgency=low * New maintainer * Recompile against libreadline4 (Closes: #65312) * Move /usr/doc/rc to /usr/share/doc/rc * Generate Section: and Priority: in control file * Fixed description field -- Decklin Foster Sun, 16 Jul 2000 12:51:20 -0500 rc (1.6-3) unstable; urgency=low * Now supply __va_copy macro when not present: fixes #41930 -- Dale Scheetz Thu, 19 Aug 1999 10:25:01 -0400 rc (1.6-2) unstable; urgency=low * Fixed rules clean target to remove .cach; fixes 41698 -- Dale Scheetz Wed, 21 Jul 1999 09:37:50 -0400 rc (1.6-1) unstable; urgency=low * New upstream source * Applied va_copy patch; fixes #28733 * build against glibc 2.1; fixes #34800 -- Dale Scheetz Mon, 19 Jul 1999 17:17:58 -0400 rc (1.5b6-1) unstable; urgency=low * New upstream source -- Dale Scheetz Mon, 17 May 1999 10:32:06 -0400 rc (1.5b5-1) unstable; urgency=low * New upstream source which fixes the "mksignal" bug: fixes 33506 -- Dale Scheetz Mon, 8 Mar 1999 15:20:50 -0500 rc (1.5b2-1) unstable; urgency=low * New maintainer release. * Compiled against libc6 2.0.7u-7 -- Dale Scheetz Wed, 2 Dec 1998 15:50:30 -0500 rc (1.5b2-0.1) unstable; urgency=low * Non-maintainer release * New upstream release * Compile with libc6 * New source format -- Mark Baker Mon, 17 Nov 1997 20:07:00 +0000 debian/source/0000755000000000000000000000000012273002321010456 5ustar debian/source/format0000644000000000000000000000001411721761326011702 0ustar 3.0 (quilt) debian/source/options0000644000000000000000000000063612273002321012101 0ustar compression = gzip extend-diff-ignore = "^INSTALL$" extend-diff-ignore = "^Makefile[.]in$" extend-diff-ignore = "^aclocal[.]m4$" extend-diff-ignore = "^compile$" extend-diff-ignore = "^config[.]h[.]in$" extend-diff-ignore = "^configure$" extend-diff-ignore = "^depcomp$" extend-diff-ignore = "^install-sh$" extend-diff-ignore = "^missing$" extend-diff-ignore = "^mkinstalldirs$" extend-diff-ignore = "^parse[.]c$" debian/rules0000755000000000000000000000311012273012634010241 0ustar #!/usr/bin/make -f DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) configure_flags = --build $(DEB_BUILD_GNU_TYPE) ifneq "$(DEB_BUILD_GNU_TYPE)" "$(DEB_HOST_GNU_TYPE)" configure_flags += --host $(DEB_HOST_GNU_TYPE) endif cflags = $(shell dpkg-buildflags --get CFLAGS) -Werror=array-bounds -fvisibility=hidden cppflags = $(shell dpkg-buildflags --get CPPFLAGS) ldflags = $(shell dpkg-buildflags --get LDFLAGS) -Wl,--as-needed configure_flags += \ --prefix=/usr \ --mandir='$${prefix}/share/man' \ --with-readline \ --with-addon \ CFLAGS='$(cflags)' \ CPPFLAGS='$(cppflags)' \ LDFLAGS='$(ldflags)' \ autoconf-stamp: debian/control autoreconf -vfi touch $(@) obj/config.status: autoconf-stamp mkdir -p $(dir $@) cd obj && ../configure $(configure_flags) parse.output: byacc -v -o parse.c parse.y obj/build-stamp: obj/config.status parse.output $(MAKE) -C obj ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),) cd obj && ./rc -p < ../trip.rc endif touch $(@) .PHONY: build build-arch build-indep build build-arch: obj/build-stamp .PHONY: binary binary-arch binary-indep binary binary-arch: obj/build-stamp dh_testroot dh_prep $(MAKE) -C obj DESTDIR=../debian/rc install dh_installdocs dh_installmenu dh_installman dh_installchangelogs dh_link dh_strip dh_buildinfo dh_compress dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb .PHONY: clean clean: dh_clean rm -rf obj/ autoconf-stamp rm -f parse.output .SECONDARY: .NOTPARALLEL: # vim:ts=4 sw=4 noet debian/rc.postrm0000644000000000000000000000013411721761326011044 0ustar #!/bin/sh set -e if [ "$1" = "remove" ]; then remove-shell /usr/bin/rc fi #DEBHELPER# debian/tests/0000755000000000000000000000000012271737556010347 5ustar debian/tests/tripping.pl0000644000000000000000000000063412271720251012523 0ustar #!/usr/bin/perl # Perl re-implementation of tripping.c use strict; use warnings; use Fcntl qw(F_GETFL F_SETFL O_NONBLOCK); my ($arg) = @ARGV; $arg //= ''; if ($arg =~ /^0/) { print "tr\0ue\n"; } elsif ($arg =~ /^a/) { print "a\001ab\002b\n"; } elsif ($arg =~ /^n/) { my $flags = fcntl(STDIN, F_GETFL, 0) or die $!; fcntl(STDIN, F_SETFL, $flags | O_NONBLOCK) or die $!; } # vim:ts=4 sw=4 et debian/tests/control0000644000000000000000000000007412271737556011753 0ustar Tests: tests Depends: rc, procps Restrictions: allow-stderr debian/tests/tests0000755000000000000000000000021112271720312011407 0ustar #!/bin/sh set -e -u cp trip.rc "$ADTTMP/" cp debian/tests/tripping.pl "$ADTTMP/tripping" cd "$ADTTMP" chmod u+x tripping rc -p < trip.rc