Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

[インデックス 11486] ファイルの概要

このコミットは、Go言語のツールチェインの一部である cmd/pack コマンドのエラーメッセージおよび使用法表示において、プログラム名として表示される文字列を gopack から pack へと変更するものです。これは、ツールの名称の統一とブランド変更の一環として行われたと考えられます。

コミット

  • Author: Rob Pike r@golang.org
  • Date: Mon Jan 30 15:44:27 2012 -0800
  • Commit Message:
    cmd/pack: change gopack to pack in error messages
    
    R=golang-dev, bradfitz
    CC=golang-dev
    https://golang.org/cl/5598051
    

GitHub上でのコミットページへのリンク

https://github.com/golang/go/commit/33b6d46afd3377d309e6db0126a20c7cc859e064

元コミット内容

cmd/pack: change gopack to pack in error messages

このコミットは、cmd/pack ツールが生成するエラーメッセージやヘルプメッセージ内で使用されるプログラム名を gopack から pack に変更することを目的としています。

変更の背景

この変更の背景には、Go言語のツールチェインにおけるコマンド名の標準化と統一性があります。初期のGo開発では、一部のツールに go プレフィックスが付与されていましたが、時間の経過とともに、より簡潔で一般的な名称に移行する傾向が見られました。gopack から pack への変更も、この標準化プロセスの一環であり、ユーザーエクスペリエンスの向上と、ツールのブランドイメージの明確化を意図しています。これにより、Goツールチェイン全体のコマンド体系がより一貫性のあるものになります。

前提知識の解説

ar (Archiver) コマンド

ar は、Unix系システムで広く使われているユーティリティで、複数のファイルを一つのアーカイブファイル(ライブラリファイルやオブジェクトファイルの集合体)にまとめるために使用されます。主に静的ライブラリ(.a ファイル)の作成や管理に用いられます。ar コマンドは、アーカイブ内のファイルの追加、削除、抽出、リスト表示などの操作を提供します。Go言語の cmd/pack は、この ar フォーマットを扱うためのツールであり、Goのコンパイルプロセスにおいて、コンパイルされたGoパッケージのオブジェクトファイルをアーカイブするために利用されます。

cmd/pack (旧 gopack)

cmd/pack は、Go言語のビルドシステムの一部として機能するコマンドラインツールです。その主な役割は、Goのコンパイル済みオブジェクトファイル(.o ファイル)を ar フォーマットのアーカイブファイル(通常は .a 拡張子を持つライブラリファイル)にまとめることです。これにより、複数のオブジェクトファイルを一つの論理的な単位として扱い、リンカがそれらを効率的に参照できるようになります。

このコミット以前は、このツールは内部的または外部的に gopack と呼ばれていた可能性があります。gopack という名称は、Go言語に関連するツールであることを明示していましたが、より一般的な pack という名称への変更は、その機能がアーカイブ操作というより汎用的なものであることを示唆し、Goツールチェイン全体の命名規則に合わせたものと考えられます。

fprintf 関数 (C言語)

fprintf はC言語の標準ライブラリ関数で、指定されたファイルストリームにフォーマットされた文字列を出力するために使用されます。

int fprintf(FILE *stream, const char *format, ...);
  • stream: 出力先のファイルストリームへのポインタ。通常、エラーメッセージは標準エラー出力 (stderr) に出力されるため、stderr を表すファイルディスクリプタ 2 を使用することが多いです。このコミットのコードでは 2 が直接使われていますが、これは stderr を指します。
  • format: 出力する文字列のフォーマットを指定する文字列リテラル。
  • ...: フォーマット文字列に対応する可変個の引数。

このコミットでは、fprintf(2, ...) の形式でエラーメッセージを出力しており、これは標準エラー出力にメッセージを書き込むことを意味します。

技術的詳細

このコミットの技術的な変更は非常にシンプルで、src/cmd/pack/ar.c ファイル内の文字列リテラルを置換することに限定されています。具体的には、エラーメッセージや使用法(usage)メッセージ内でハードコードされていた "gopack:" という文字列が "pack:" に変更されています。

これは、ソースコード内の文字列定数を変更するだけであり、プログラムのロジックや機能に影響を与えるものではありません。コンパイル後の実行ファイルでは、エラー発生時や不正な引数が渡された際に表示されるメッセージが変更されるだけです。

変更は主に fprintf 関数呼び出しの第2引数(フォーマット文字列)に対して行われています。例えば、fprintf(2, "gopack: bad option %c'\n", *cp);fprintf(2, "pack: bad option %c'\\n", *cp); に変更されています。同様に、usage() 関数内で表示されるヘルプメッセージも更新されています。

この種の変更は、ソフトウェアの国際化(i18n)やローカライゼーション(l10n)とは異なり、プログラムの内部的な識別子やブランド名を統一するためのものです。

コアとなるコードの変更箇所

変更は src/cmd/pack/ar.c ファイルに集中しており、gopack: という文字列を含む fprintf の呼び出しが pack: に変更されています。

--- a/src/cmd/pack/ar.c
+++ b/src/cmd/pack/ar.c
@@ -227,12 +227,12 @@ main(int argc, char *argv[])
 		case 'S':	Sflag = 1;  break;
 		case 'P':	Pflag = 1;  break;
 		default:
-			fprintf(2, "gopack: bad option `%c'\n", *cp);
+			fprintf(2, "pack: bad option `%c'\n", *cp);
 			exits("error");
 		}
 	}
 	if (aflag && bflag) {
-		fprintf(2, "gopack: only one of 'a' and 'b' can be specified\n");
+		fprintf(2, "pack: only one of 'a' and 'b' can be specified\n");
 		usage();
 	}
 	if(aflag || bflag) {
@@ -244,7 +244,7 @@ main(int argc, char *argv[])
 	}
 	if(Pflag) {
 		if(argc < 4) {
-			fprintf(2, "gopack: P flag requires prefix argument\n");
+			fprintf(2, "pack: P flag requires prefix argument\n");
 			usage();
 		}
 		prefix = argv[2];
@@ -253,7 +253,7 @@ main(int argc, char *argv[])
 	}
 	if(comfun == 0) {
 		if(uflag == 0) {
-			fprintf(2, "gopack: one of [%s] must be specified\n", man);
+			fprintf(2, "pack: one of [%s] must be specified\n", man);
 			usage();
 		}
 		setcom(rcmd);
@@ -267,7 +267,7 @@ main(int argc, char *argv[])
 	cp = 0;
 	while (argc--) {
 		if (*argv) {
-			fprintf(2, "gopack: %s not found\n", *argv);
+			fprintf(2, "pack: %s not found\n", *argv);
 			cp = "error";
 		}
 		argv++;
@@ -284,7 +284,7 @@ setcom(void (*fun)(char *, int, char**))\n {\n \n 	if(comfun != 0) {\
-		fprintf(2, "gopack: only one of [%s] allowed\n", man);
+		fprintf(2, "pack: only one of [%s] allowed\n", man);
 		usage();
 	}
 	comfun = fun;
@@ -345,7 +345,7 @@ rcmd(char *arname, int count, char **files)\
 		bfile = Bopen(file, OREAD);\
 		if (!bfile) {\
 			if (count != 0) {\
-				fprintf(2, "gopack: cannot open %s\n", file);
+				fprintf(2, "pack: cannot open %s\n", file);
 				errors++;
 			}
 			scanobj(&bar, ap, bp->size);
@@ -354,7 +354,7 @@ rcmd(char *arname, int count, char **files)\
 		}
 		d = dirfstat(Bfildes(bfile));
 		if(d == nil)
-			fprintf(2, "gopack: cannot stat %s: %r\n", file);
+			fprintf(2, "pack: cannot stat %s: %r\n", file);
 		if (uflag && (d==nil || d->mtime <= bp->date)) {
 			scanobj(&bar, ap, bp->size);
 			arcopy(&bar, ap, bp);
@@ -379,7 +379,7 @@ rcmd(char *arname, int count, char **files)\
 		files[i] = 0;
 		bfile = Bopen(file, OREAD);
 		if (!bfile) {\
-			fprintf(2, "gopack: cannot open %s\n", file);
+			fprintf(2, "pack: cannot open %s\n", file);
 			errors++;
 		} else {
 			mesg('a', file);
@@ -447,7 +447,7 @@ xcmd(char *arname, int count, char **files)\
 			mode = strtoul(bp->hdr.mode, 0, 8) & 0777;
 			f = create(file, OWRITE, mode);
 			if(f < 0) {
-				fprintf(2, "gopack: %s cannot create\n", file);
+				fprintf(2, "pack: %s cannot create\n", file);
 				skip(&bar, bp->size);
 			} else {
 				mesg('x', file);
@@ -541,7 +541,7 @@ mcmd(char *arname, int count, char **files)\
 	}
 	close(fd);
 	if (poname[0] && aend == 0)
-		fprintf(2, "gopack: %s not found - files moved to end.\n", poname);
+		fprintf(2, "pack: %s not found - files moved to end.\n", poname);
 	install(arname, astart, amiddle, aend, 0);
 }
 void
@@ -574,13 +574,13 @@ qcmd(char *arname, int count, char **files)\
 	Biobuf *bfile;
 
 	if(aflag || bflag) {
-		fprintf(2, "gopack: abi not allowed with q\n");
+		fprintf(2, "pack: abi not allowed with q\n");
 		exits("error");
 	}
 	fd = openar(arname, ORDWR, 1);
 	if (fd < 0) {
 		if(!cflag)
-			fprintf(2, "gopack: creating %s\n", arname);
+			fprintf(2, "pack: creating %s\n", arname);
 		fd = arcreate(arname);
 	}
 	Binit(&bar, fd, OREAD);
@@ -594,7 +594,7 @@ qcmd(char *arname, int count, char **files)\
 		files[i] = 0;
 		bfile = Bopen(file, OREAD);
 		if(!bfile) {
-			fprintf(2, "gopack: cannot open %s\n", file);
+			fprintf(2, "pack: cannot open %s\n", file);
 			errors++;
 		} else {
 			mesg('q', file);
@@ -680,13 +680,13 @@ scanobj(Biobuf *b, Arfile *ap, long size)\
 		}
 		
 		if (!gflag || strcmp(file, pkgdef) != 0) {  /* don't clear allobj if it's pkg defs */
-			fprintf(2, "gopack: non-object file %s\n", file);
+			fprintf(2, "pack: non-object file %s\n", file);
 			errors++;
 			allobj = 0;
 		}
 		d = dirfstat(Bfildes(b));
 		if (d != nil && d->length == 0) {
-			fprintf(2, "gopack: zero length file %s\n", file);
+			fprintf(2, "pack: zero length file %s\n", file);
 			errors++;
 		}
 		free(d);
@@ -709,7 +709,7 @@ scanobj(Biobuf *b, Arfile *ap, long size)\
 
 	Bseek(b, offset1, 0);
 	if(p == nil || strncmp(p, "go object ", 10) != 0) {
-		fprintf(2, "gopack: malformed object file %s\n", file);
+		fprintf(2, "pack: malformed object file %s\n", file);
 		errors++;
 		Bseek(b, offset, 0);
 		free(p);
@@ -717,7 +717,7 @@ scanobj(Biobuf *b, Arfile *ap, long size)\
 	}
 	
 	if (!matchhdr(p, &objhdr)) {
-		fprintf(2, "gopack: inconsistent object file %s: [%s] vs [%s]\n", file, p, objhdr);
+		fprintf(2, "pack: inconsistent object file %s: [%s] vs [%s]\n", file, p, objhdr);
 		errors++;
 		allobj = 0;
 		free(p);
@@ -727,7 +727,7 @@ scanobj(Biobuf *b, Arfile *ap, long size)\
 
 	// Old check.  Should be impossible since objhdrs match, but keep the check anyway.
 	if (lastobj >= 0 && obj != lastobj) {
-		fprintf(2, "gopack: inconsistent object file %s\n", file);
+		fprintf(2, "pack: inconsistent object file %s\n", file);
 		errors++;
 		allobj = 0;
 		return;
@@ -735,7 +735,7 @@ scanobj(Biobuf *b, Arfile *ap, long size)\
 	lastobj = obj;
 		
 	if (!readar(b, obj, offset+size, 0)) {
-		fprintf(2, "gopack: invalid symbol reference in file %s\n", file);
+		fprintf(2, "pack: invalid symbol reference in file %s\n", file);
 		errors++;
 		allobj = 0;
 		Bseek(b, offset, 0);
@@ -825,7 +825,7 @@ scanpkg(Biobuf *b, long size)\
 			continue;
 		goto foundstart;
 	}
-	// fprint(2, "gopack: warning: no package import section in %s\n", file);
+	// fprint(2, "pack: warning: no package import section in %s\n", file);
 	if(b != &bar || !pkgdefsafe)
 		safe = 0;	// non-Go file (C or assembly)
 	return;
@@ -875,7 +875,7 @@ foundstart:\
 		free(line);
 	}
 bad:
-	fprintf(2, "gopack: bad package import section in %s\n", file);
+	fprintf(2, "pack: bad package import section in %s\n", file);
 	errors++;
 	return;
 
@@ -885,7 +885,7 @@ foundend:\
 	if (end == 0)
 		goto bad;
 	if(importblock != nil) {
-		fprintf(2, "gopack: multiple Go object files\n");
+		fprintf(2, "pack: multiple Go object files\n");
 		errors++;
 		return;
 	}
@@ -893,7 +893,7 @@ foundend:\
 	data = armalloc(end - start + 1);
 	Bseek(b, start, 0);
 	if (Bread(b, data, pkgsize) != pkgsize) {
-		fprintf(2, "gopack: error reading package import section in %s\n", file);
+		fprintf(2, "pack: error reading package import section in %s\n", file);
 		errors++;
 		return;
 	}
@@ -993,11 +993,11 @@ openar(char *arname, int mode, int errok)\
 	fd = open(arname, mode);
 	if(fd >= 0){
 		if(read(fd, mbuf, SARMAG) != SARMAG || strncmp(mbuf, ARMAG, SARMAG)) {
-			fprintf(2, "gopack: %s not in archive format\n", arname);
+			fprintf(2, "pack: %s not in archive format\n", arname);
 			exits("error");
 		}
 	}else if(!errok){
-		fprintf(2, "gopack: cannot open %s: %r\n", arname);
+		fprintf(2, "pack: cannot open %s: %r\n", arname);
 		exits("error");
 	}
 	return fd;
@@ -1013,7 +1013,7 @@ arcreate(char *arname)\
 
 	fd = create(arname, OWRITE, 0664);
 	if(fd < 0){
-		fprintf(2, "gopack: cannot create %s: %r\n", arname);
+		fprintf(2, "pack: cannot create %s: %r\n", arname);
 		exits("error");
 	}
 	if(write(fd, ARMAG, SARMAG) != SARMAG)
@@ -1027,28 +1027,28 @@ arcreate(char *arname)\
 void
 wrerr(void)\
 {\
-	perror("gopack: write error");
+	perror("pack: write error");
 	exits("error");
 }
 
 void
 rderr(void)\
 {\
-	perror("gopack: read error");
+	perror("pack: read error");
 	exits("error");
 }
 
 void
 phaseerr(int offset)\
 {\
-	fprintf(2, "gopack: phase error at offset %d\n", offset);
+	fprintf(2, "pack: phase error at offset %d\n", offset);
 	exits("error");
 }
 
 void
 usage(void)\
 {\
-	fprintf(2, "usage: gopack [%s][%s][P prefix] archive files ...\n", opt, man);
+	fprintf(2, "usage: pack [%s][%s][P prefix] archive files ...\n", opt, man);
 	exits("error");
 }
 
@@ -1092,7 +1092,7 @@ armove(Biobuf *b, Arfile *ap, Armember *bp)\
 
 	d = dirfstat(Bfildes(b));
 	if (d == nil) {
-		fprintf(2, "gopack: cannot stat %s\n", file);
+		fprintf(2, "pack: cannot stat %s\n", file);
 		return;
 	}
 
@@ -1193,7 +1193,7 @@ install(char *arname, Arfile *astart, Arfile *amiddle, Arfile *aend, int createf\
 	rfork(RFNOTEG);
 
 	if(createflag)
-		fprintf(2, "gopack: creating %s\n", arname);
+		fprintf(2, "pack: creating %s\n", arname);
 	fd = arcreate(arname);
 
 	if(allobj)
@@ -1593,7 +1593,6 @@ page(Arfile *ap)\
 int
 getspace(void)\
 {\
-fprint(2, "IN GETSPACE\n");
 	if (astart && astart->head && page(astart))
 		return 1;
 	if (amiddle && amiddle->head && page(amiddle))
@@ -1638,7 +1637,7 @@ armalloc(int n)\
 			return cp;
 		}
 	} while (getspace());
-	fprintf(2, "gopack: out of memory\n");
+	fprintf(2, "pack: out of memory\n");
 	exits("malloc");
 	return 0;
 }

コアとなるコードの解説

上記の差分が示すように、変更は主に fprintf 関数呼び出しの第一引数(ファイルディスクリプタ 2、すなわち標準エラー出力)に続くフォーマット文字列内の "gopack:""pack:" に置き換えるものです。

例えば、以下の行: - fprintf(2, "gopack: bad option %c'\n", *cp);は、+ fprintf(2, "pack: bad option %c'\n", *cp); に変更されています。

これは、cmd/pack ツールが不正なオプションを受け取った際に表示するエラーメッセージのプレフィックスを、gopack: から pack: に変更することを意味します。同様の変更が、ファイルを開けない、ファイルが見つからない、メモリ不足などの様々なエラーメッセージや、usage 関数で表示されるコマンドの使用法説明にも適用されています。

この変更は、プログラムの動作には影響を与えず、ユーザーに表示されるメッセージの見た目のみを変更します。これにより、Goツールチェイン全体でのコマンド名の統一性が保たれ、ユーザーがより直感的にツールを理解できるようになります。

関連リンク

参考にした情報源リンク

[インデックス 11486] ファイルの概要

このコミットは、Go言語のツールチェインの一部である cmd/pack コマンドのエラーメッセージおよび使用法表示において、プログラム名として表示される文字列を gopack から pack へと変更するものです。これは、ツールの名称の統一とブランド変更の一環として行われたと考えられます。

コミット

  • Author: Rob Pike r@golang.org
  • Date: Mon Jan 30 15:44:27 2012 -0800
  • Commit Message:
    cmd/pack: change gopack to pack in error messages
    
    R=golang-dev, bradfitz
    CC=golang-dev
    https://golang.org/cl/5598051
    

GitHub上でのコミットページへのリンク

https://github.com/golang/go/commit/33b6d46afd3377d309e6db0126a20c7cc859e064

元コミット内容

cmd/pack: change gopack to pack in error messages

このコミットは、cmd/pack ツールが生成するエラーメッセージやヘルプメッセージ内で使用されるプログラム名を gopack から pack に変更することを目的としています。

変更の背景

この変更の背景には、Go言語のツールチェインにおけるコマンド名の標準化と統一性があります。初期のGo開発では、一部のツールに go プレフィックスが付与されていましたが、時間の経過とともに、より簡潔で一般的な名称に移行する傾向が見られました。gopack から pack への変更も、この標準化プロセスの一環であり、ユーザーエクスペリエンスの向上と、ツールのブランドイメージの明確化を意図しています。これにより、Goツールチェイン全体のコマンド体系がより一貫性のあるものになります。

前提知識の解説

ar (Archiver) コマンド

ar は、Unix系システムで広く使われているユーティリティで、複数のファイルを一つのアーカイブファイル(ライブラリファイルやオブジェクトファイルの集合体)にまとめるために使用されます。主に静的ライブラリ(.a ファイル)の作成や管理に用いられます。ar コマンドは、アーカイブ内のファイルの追加、削除、抽出、リスト表示などの操作を提供します。Go言語の cmd/pack は、この ar フォーマットを扱うためのツールであり、Goのコンパイルプロセスにおいて、コンパイルされたGoパッケージのオブジェクトファイルをアーカイブするために利用されます。

cmd/pack (旧 gopack)

cmd/pack は、Go言語のビルドシステムの一部として機能するコマンドラインツールです。その主な役割は、Goのコンパイル済みオブジェクトファイル(.o ファイル)を ar フォーマットのアーカイブファイル(通常は .a 拡張子を持つライブラリファイル)にまとめることです。これにより、複数のオブジェクトファイルを一つの論理的な単位として扱い、リンカがそれらを効率的に参照できるようになります。

このコミット以前は、このツールは内部的または外部的に gopack と呼ばれていた可能性があります。gopack という名称は、Go言語に関連するツールであることを明示していましたが、より一般的な pack という名称への変更は、その機能がアーカイブ操作というより汎用的なものであることを示唆し、Goツールチェイン全体の命名規則に合わせたものと考えられます。

fprintf 関数 (C言語)

fprintf はC言語の標準ライブラリ関数で、指定されたファイルストリームにフォーマットされた文字列を出力するために使用されます。

int fprintf(FILE *stream, const char *format, ...);
  • stream: 出力先のファイルストリームへのポインタ。通常、エラーメッセージは標準エラー出力 (stderr) に出力されるため、stderr を表すファイルディスクリプタ 2 を使用することが多いです。このコミットのコードでは 2 が直接使われていますが、これは stderr を指します。
  • format: 出力する文字列のフォーマットを指定する文字列リテラル。
  • ...: フォーマット文字列に対応する可変個の引数。

このコミットでは、fprintf(2, ...) の形式でエラーメッセージを出力しており、これは標準エラー出力にメッセージを書き込むことを意味します。

技術的詳細

このコミットの技術的な変更は非常にシンプルで、src/cmd/pack/ar.c ファイル内の文字列リテラルを置換することに限定されています。具体的には、エラーメッセージや使用法(usage)メッセージ内でハードコードされていた "gopack:" という文字列が "pack:" に変更されています。

これは、ソースコード内の文字列定数を変更するだけであり、プログラムのロジックや機能に影響を与えるものではありません。コンパイル後の実行ファイルでは、エラー発生時や不正な引数が渡された際に表示されるメッセージが変更されるだけです。

変更は主に fprintf 関数呼び出しの第2引数(フォーマット文字列)に対して行われています。例えば、fprintf(2, "gopack: bad option %c'\n", *cp);fprintf(2, "pack: bad option %c'\\n", *cp); に変更されています。同様に、usage() 関数内で表示されるヘルプメッセージも更新されています。

この種の変更は、ソフトウェアの国際化(i18n)やローカライゼーション(l10n)とは異なり、プログラムの内部的な識別子やブランド名を統一するためのものです。

コアとなるコードの変更箇所

変更は src/cmd/pack/ar.c ファイルに集中しており、gopack: という文字列を含む fprintf の呼び出しが pack: に変更されています。

--- a/src/cmd/pack/ar.c
+++ b/src/cmd/pack/ar.c
@@ -227,12 +227,12 @@ main(int argc, char *argv[])
 		case 'S':	Sflag = 1;  break;
 		case 'P':	Pflag = 1;  break;
 		default:
-			fprintf(2, "gopack: bad option `%c'\n", *cp);
+			fprintf(2, "pack: bad option `%c'\n", *cp);
 			exits("error");
 		}
 	}
 	if (aflag && bflag) {
-		fprintf(2, "gopack: only one of 'a' and 'b' can be specified\n");
+		fprintf(2, "pack: only one of 'a' and 'b' can be specified\n");
 		usage();
 	}
 	if(aflag || bflag) {
@@ -244,7 +244,7 @@ main(int argc, char *argv[])
 	}
 	if(Pflag) {
 		if(argc < 4) {
-			fprintf(2, "gopack: P flag requires prefix argument\n");
+			fprintf(2, "pack: P flag requires prefix argument\n");
 			usage();
 		}
 		prefix = argv[2];
@@ -253,7 +253,7 @@ main(int argc, char *argv[])
 	}
 	if(comfun == 0) {
 		if(uflag == 0) {
-			fprintf(2, "gopack: one of [%s] must be specified\n", man);
+			fprintf(2, "pack: one of [%s] must be specified\n", man);
 			usage();
 		}
 		setcom(rcmd);
@@ -267,7 +267,7 @@ main(int argc, char *argv[])
 	cp = 0;
 	while (argc--) {
 		if (*argv) {
-			fprintf(2, "gopack: %s not found\n", *argv);
+			fprintf(2, "pack: %s not found\n", *argv);
 			cp = "error";
 		}
 		argv++;
@@ -284,7 +284,7 @@ setcom(void (*fun)(char *, int, char**))\
 {\
 \
 	if(comfun != 0) {\
-		fprintf(2, "gopack: only one of [%s] allowed\n", man);
+		fprintf(2, "pack: only one of [%s] allowed\n", man);
 		usage();
 	}
 	comfun = fun;
@@ -345,7 +345,7 @@ rcmd(char *arname, int count, char **files)\
 		bfile = Bopen(file, OREAD);\
 		if (!bfile) {\
 			if (count != 0) {\
-				fprintf(2, "gopack: cannot open %s\n", file);
+				fprintf(2, "pack: cannot open %s\n", file);
 				errors++;
 			}
 			scanobj(&bar, ap, bp->size);
@@ -354,7 +354,7 @@ rcmd(char *arname, int count, char **files)\
 		}
 		d = dirfstat(Bfildes(bfile));
 		if(d == nil)
-			fprintf(2, "gopack: cannot stat %s: %r\n", file);
+			fprintf(2, "pack: cannot stat %s: %r\n", file);
 		if (uflag && (d==nil || d->mtime <= bp->date)) {
 			scanobj(&bar, ap, bp->size);
 			arcopy(&bar, ap, bp);
@@ -379,7 +379,7 @@ rcmd(char *arname, int count, char **files)\
 		files[i] = 0;
 		bfile = Bopen(file, OREAD);
 		if (!bfile) {\
-			fprintf(2, "gopack: cannot open %s\n", file);
+			fprintf(2, "pack: cannot open %s\n", file);
 			errors++;
 		} else {
 			mesg('a', file);
@@ -447,7 +447,7 @@ xcmd(char *arname, int count, char **files)\
 			mode = strtoul(bp->hdr.mode, 0, 8) & 0777;
 			f = create(file, OWRITE, mode);
 			if(f < 0) {
-				fprintf(2, "gopack: %s cannot create\n", file);
+				fprintf(2, "pack: %s cannot create\n", file);
 				skip(&bar, bp->size);
 			} else {
 				mesg('x', file);
@@ -541,7 +541,7 @@ mcmd(char *arname, int count, char **files)\
 	}
 	close(fd);
 	if (poname[0] && aend == 0)
-		fprintf(2, "gopack: %s not found - files moved to end.\n", poname);
+		fprintf(2, "pack: %s not found - files moved to end.\n", poname);
 	install(arname, astart, amiddle, aend, 0);
 }
 void
@@ -574,13 +574,13 @@ qcmd(char *arname, int count, char **files)\
 	Biobuf *bfile;
 
 	if(aflag || bflag) {
-		fprintf(2, "gopack: abi not allowed with q\n");
+		fprintf(2, "pack: abi not allowed with q\n");
 		exits("error");
 	}
 	fd = openar(arname, ORDWR, 1);
 	if (fd < 0) {
 		if(!cflag)
-			fprintf(2, "gopack: creating %s\n", arname);
+			fprintf(2, "pack: creating %s\n", arname);
 		fd = arcreate(arname);
 	}
 	Binit(&bar, fd, OREAD);
@@ -594,7 +594,7 @@ qcmd(char *arname, int count, char **files)\
 		files[i] = 0;
 		bfile = Bopen(file, OREAD);
 		if(!bfile) {
-			fprintf(2, "gopack: cannot open %s\n", file);
+			fprintf(2, "pack: cannot open %s\n", file);
 			errors++;
 		} else {
 			mesg('q', file);
@@ -680,13 +680,13 @@ scanobj(Biobuf *b, Arfile *ap, long size)\
 		}
 		
 		if (!gflag || strcmp(file, pkgdef) != 0) {  /* don't clear allobj if it's pkg defs */
-			fprintf(2, "gopack: non-object file %s\n", file);
+			fprintf(2, "pack: non-object file %s\n", file);
 			errors++;
 			allobj = 0;
 		}
 		d = dirfstat(Bfildes(b));
 		if (d != nil && d->length == 0) {
-			fprintf(2, "gopack: zero length file %s\n", file);
+			fprintf(2, "pack: zero length file %s\n", file);
 			errors++;
 		}
 		free(d);
@@ -709,7 +709,7 @@ scanobj(Biobuf *b, Arfile *ap, long size)\
 
 	Bseek(b, offset1, 0);
 	if(p == nil || strncmp(p, "go object ", 10) != 0) {
-		fprintf(2, "gopack: malformed object file %s\n", file);
+		fprintf(2, "pack: malformed object file %s\n", file);
 		errors++;
 		Bseek(b, offset, 0);
 		free(p);
@@ -717,7 +717,7 @@ scanobj(Biobuf *b, Arfile *ap, long size)\
 	}
 	
 	if (!matchhdr(p, &objhdr)) {
-		fprintf(2, "gopack: inconsistent object file %s: [%s] vs [%s]\n", file, p, objhdr);
+		fprintf(2, "pack: inconsistent object file %s: [%s] vs [%s]\n", file, p, objhdr);
 		errors++;
 		allobj = 0;
 		free(p);
@@ -727,7 +727,7 @@ scanobj(Biobuf *b, Arfile *ap, long size)\
 
 	// Old check.  Should be impossible since objhdrs match, but keep the check anyway.
 	if (lastobj >= 0 && obj != lastobj) {
-		fprintf(2, "gopack: inconsistent object file %s\n", file);
+		fprintf(2, "pack: inconsistent object file %s\n", file);
 		errors++;
 		allobj = 0;
 		return;
@@ -735,7 +735,7 @@ scanobj(Biobuf *b, Arfile *ap, long size)\
 	lastobj = obj;
 		
 	if (!readar(b, obj, offset+size, 0)) {
-		fprintf(2, "gopack: invalid symbol reference in file %s\n", file);
+		fprintf(2, "pack: invalid symbol reference in file %s\n", file);
 		errors++;
 		allobj = 0;
 		Bseek(b, offset, 0);
@@ -825,7 +825,7 @@ scanpkg(Biobuf *b, long size)\
 			continue;
 		goto foundstart;
 	}
-	// fprint(2, "gopack: warning: no package import section in %s\n", file);
+	// fprint(2, "pack: warning: no package import section in %s\n", file);
 	if(b != &bar || !pkgdefsafe)
 		safe = 0;	// non-Go file (C or assembly)
 	return;
@@ -875,7 +875,7 @@ foundstart:\
 		free(line);
 	}
 bad:
-	fprintf(2, "gopack: bad package import section in %s\n", file);
+	fprintf(2, "pack: bad package import section in %s\n", file);
 	errors++;
 	return;
 
@@ -885,7 +885,7 @@ foundend:\
 	if (end == 0)
 		goto bad;
 	if(importblock != nil) {
-		fprintf(2, "gopack: multiple Go object files\n");
+		fprintf(2, "pack: multiple Go object files\n");
 		errors++;
 		return;
 	}
@@ -893,7 +893,7 @@ foundend:\
 	data = armalloc(end - start + 1);
 	Bseek(b, start, 0);
 	if (Bread(b, data, pkgsize) != pkgsize) {
-		fprintf(2, "gopack: error reading package import section in %s\n", file);
+		fprintf(2, "pack: error reading package import section in %s\n", file);
 		errors++;
 		return;
 	}
@@ -993,11 +993,11 @@ openar(char *arname, int mode, int errok)\
 	fd = open(arname, mode);
 	if(fd >= 0){
 		if(read(fd, mbuf, SARMAG) != SARMAG || strncmp(mbuf, ARMAG, SARMAG)) {
-			fprintf(2, "gopack: %s not in archive format\n", arname);
+			fprintf(2, "pack: %s not in archive format\n", arname);
 			exits("error");
 		}
 	}else if(!errok){
-		fprintf(2, "gopack: cannot open %s: %r\n", arname);
+			fprintf(2, "pack: cannot open %s: %r\n", arname);
 		exits("error");
 	}
 	return fd;
@@ -1013,7 +1013,7 @@ arcreate(char *arname)\
 
 	fd = create(arname, OWRITE, 0664);
 	if(fd < 0){
-		fprintf(2, "gopack: cannot create %s: %r\n", arname);
+		fprintf(2, "pack: cannot create %s: %r\n", arname);
 		exits("error");
 	}
 	if(write(fd, ARMAG, SARMAG) != SARMAG)
@@ -1027,28 +1027,28 @@ arcreate(char *arname)\
 void
 wrerr(void)\
 {\
-	perror("gopack: write error");
+	perror("pack: write error");
 	exits("error");
 }
 
 void
 rderr(void)\
 {\
-	perror("gopack: read error");
+	perror("pack: read error");
 	exits("error");
 }
 
 void
 phaseerr(int offset)\
 {\
-	fprintf(2, "gopack: phase error at offset %d\n", offset);
+	fprintf(2, "pack: phase error at offset %d\n", offset);
 	exits("error");
 }
 
 void
 usage(void)\
 {\
-	fprintf(2, "usage: gopack [%s][%s][P prefix] archive files ...\n", opt, man);
+	fprintf(2, "usage: pack [%s][%s][P prefix] archive files ...\n", opt, man);
 	exits("error");
 }
 
@@ -1092,7 +1092,7 @@ armove(Biobuf *b, Arfile *ap, Armember *bp)\
 
 	d = dirfstat(Bfildes(b));
 	if (d == nil) {
-		fprintf(2, "gopack: cannot stat %s\n", file);
+		fprintf(2, "pack: cannot stat %s\n", file);
 		return;
 	}
 
@@ -1193,7 +1193,7 @@ install(char *arname, Arfile *astart, Arfile *amiddle, Arfile *aend, int createf\
 	rfork(RFNOTEG);
 
 	if(createflag)
-		fprintf(2, "gopack: creating %s\n", arname);
+		fprintf(2, "pack: creating %s\n", arname);
 	fd = arcreate(arname);
 
 	if(allobj)
@@ -1593,7 +1593,6 @@ page(Arfile *ap)\
 int
 getspace(void)\
 {\
-fprint(2, "IN GETSPACE\n");
 	if (astart && astart->head && page(astart))
 		return 1;
 	if (amiddle && amiddle->head && page(amiddle))
@@ -1638,7 +1637,7 @@ armalloc(int n)\
 			return cp;
 		}
 	} while (getspace());
-	fprintf(2, "gopack: out of memory\n");
+	fprintf(2, "pack: out of memory\n");
 	exits("malloc");
 	return 0;
 }