Skip to content
Permalink
Browse files

all: rename remaining occurrences of camput

Also removed misc/buildbot while at it (which contained camput
references) since we don't use it anymore at all.

TODO: the OSX app seems to be relying on finding a binary in ../bin,
which we do not use anymore. This will probably need fixing.

Updates #981

Change-Id: I14220fbad2e81181330fca4bb2d2e5fe170e1bd6
  • Loading branch information
mpl committed Apr 21, 2018
1 parent 86ee09b commit 2bb666ccf667023457c6720aaf4ebbe7aa70c630
@@ -8,5 +8,5 @@ To build Perkeep:

$ go run make.go

4) The compiled binaries should now be in the "bin" subdirectory:
perkeepd (the server), camget, camput, and camtool.
4) The compiled binaries should now be in the usual go install directory:
perkeepd (the server), pk, pk-put, and pk-get.
@@ -35,7 +35,7 @@ On Debian/Ubuntu, some deps to get started:

$ sudo apt-get install libsqlite3-dev sqlite3 pkg-config git

During development, rather than use the main binaries ("camput",
During development, rather than use the main binaries ("pk-put",
"camget", "camtool", "pk-mount", etc) directly, we instead use a
wrapper (devcam) that automatically configure the environment to use
the test server & test environment.
@@ -57,10 +57,10 @@ can just:

## Running devcam

The subcommands of devcam start the server or run camput/camget/etc:
The subcommands of devcam start the server or run pk-put/camget/etc:

$ devcam server # main server
$ devcam put # camput
$ devcam put # pk-put
$ devcam get # camget
$ devcam tool # camtool
$ devcam mount # pk-mount
@@ -1,6 +1,6 @@
# Copyright 2014 The Perkeep Authors.
# Generic purpose Perkeep image, that builds the server (perkeepd)
# and the command-line clients (camput, camget, camtool, and pk-mount).
# and the command-line clients (pk, pk-put, camget, and pk-mount).

# Use misc/docker/go to generate perkeep/go
FROM perkeep/go
2 TESTS
@@ -15,7 +15,7 @@ Tests needed
-- pkg/client --- test FetchVia against a server returning compressed content.
(fix in 3fa6d69405f036308931dd36e5070b2b19dbeadf without a new test)

-cmd/camput/
-cmd/pk-put/
-verify that stat caching works. verify that -filenodes does create the permanode even if the file was already uploaded (and cached) in a previous run.

-- blobserver/{remote,shard} have no tests. should be easier now that
8 TODO
@@ -145,9 +145,9 @@ Offline list:
-- tests for all cmd/* stuff, perhaps as part of some integration
tests.

-- move most of camput into a library, not a package main.
-- move most of pk-put into a library, not a package main.

-- server cron support: full syncs, camput file backups, integrity
-- server cron support: full syncs, pk-put file backups, integrity
checks.

-- status in top right of UI: sync, crons. (in-progress, un-acked
@@ -190,10 +190,10 @@ Offline list:
claim. or rather, TODO: verify we support "delete" claims to
delete any claim, and verify the share system and indexer all
support it. I think the indexer might, but not the share system.
Also TODO: "camput delete" or "rescind" subcommand.
Also TODO: "pk-put delete" or "rescind" subcommand.
Also TODO: document share claims in doc/schema/ and on website.

-- make the -transitive flag for "camput share -transitive" be a tri-state:
-- make the -transitive flag for "pk-put share -transitive" be a tri-state:
unset, true, false, and unset should then mean default to true for "file"
and "directory" schema blobs, and "false" for other things.

@@ -1,2 +1,2 @@
camput.arm
camput-version.txt
pk-put.arm
pk-put-version.txt
@@ -8,10 +8,10 @@
# mirror it all into a separate writable GOROOT under $CAMROOT/tmp and bootstrap
# it with "GOOS=linux GOARCH=arm make.bash".
all:
(cd ../../.. && go run make.go --os=linux --arch=arm --targets=camlistore.org/cmd/camput)
cp -p ../../../bin/linux_arm/camput camput.arm
../../../misc/gitversion > camput-version.txt
(cd ../../.. && go run make.go --os=linux --arch=arm --targets=camlistore.org/cmd/pk-put)
cp -p ../../../bin/linux_arm/pk-put pk-put.arm
../../../misc/gitversion > pk-put-version.txt
mkdir -p ../gen/org/camlistore
/bin/echo -n "package org.camlistore; public final class ChildProcessConfig { // " > ../gen/org/camlistore/ChildProcessConfig.java
openssl sha1 camput.arm >> ../gen/org/camlistore/ChildProcessConfig.java
openssl sha1 pk-put.arm >> ../gen/org/camlistore/ChildProcessConfig.java
/bin/echo "}" >> ../gen/org/camlistore/ChildProcessConfig.java
@@ -1 +1 @@
Put camput.arm here. It's in .gitignore because it's 6.5 MB.
Put pk-put.arm here. It's in .gitignore because it's 6.5 MB.
@@ -206,7 +206,7 @@ public void run() {
// reasonable upload size, so use units of 1KB instead.
progressBytes.setMax((int) (total / 1024L));
progressBytes.setProgress((int) (done / 1024L));
// TODO: renable once camput properly sends inflight information
// TODO: renable once pk-put properly sends inflight information
// progressBytes.setSecondaryProgress(progressBytes.getProgress() + inFlight / 1024);

StringBuilder bytesUploaded = new StringBuilder(40);
@@ -321,7 +321,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
ProfilesActivity.show(this);
break;
case MENU_VERSION:
Toast.makeText(this, "camput version: " + ((UploadApplication) getApplication()).getCamputVersion(), Toast.LENGTH_LONG).show();
Toast.makeText(this, "pk-put version: " + ((UploadApplication) getApplication()).getCamputVersion(), Toast.LENGTH_LONG).show();
break;
case MENU_UPLOAD_ALL:
Intent uploadAll = new Intent(UploadService.INTENT_UPLOAD_ALL);
@@ -42,7 +42,7 @@ private long getAPKModTime() {

private void copyGoBinary() {
long myTime = getAPKModTime();
String dstFile = getBaseContext().getFilesDir().getAbsolutePath() + "/camput.bin";
String dstFile = getBaseContext().getFilesDir().getAbsolutePath() + "/pk-put.bin";
File f = new File(dstFile);
Log.d(TAG, " My Time: " + myTime);
Log.d(TAG, "Bin Time: " + f.lastModified());
@@ -52,8 +52,8 @@ private void copyGoBinary() {
}
Log.d(TAG, "Go binary missing or modtime stale. Re-copying from APK.");
try {
InputStream is = getAssets().open("camput.arm");
FileOutputStream fos = getBaseContext().openFileOutput("camput.bin.writing", MODE_PRIVATE);
InputStream is = getAssets().open("pk-put.arm");
FileOutputStream fos = getBaseContext().openFileOutput("pk-put.bin.writing", MODE_PRIVATE);
byte[] buf = new byte[8192];
int offset;
while ((offset = is.read(buf)) > 0) {
@@ -115,7 +115,7 @@ public void onCreate() {
public String getCamputVersion() {
InputStream is = null;
try {
is = getAssets().open("camput-version.txt");
is = getAssets().open("pk-put-version.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
return br.readLine();
} catch (IOException e) {
@@ -532,7 +532,7 @@ void onUploadComplete(QueuedFile qf) {
if (mFileBytesRemain.isEmpty()) {
// Fill up the percentage bars, since we could get
// this event before the periodic stats event.
// And at the end, we could kill camput between
// And at the end, we could kill pk-put between
// getting the final "file uploaded" event and the final
// stats event.
mFilesUploaded = mFilesTotal;
@@ -76,7 +76,7 @@ public void stopUploads() {
}
try {
stdinWriter.close();
Log.d(TAG, "Closed camput's stdin");
Log.d(TAG, "Closed pk-put's stdin");
stdinWriter = null;
} catch (IOException e) {
p.destroy(); // force kill
@@ -139,7 +139,7 @@ public boolean enqueueFile(QueuedFile qf) {
stdinWriter.write(diskPath + "\n");
stdinWriter.flush();
} catch (IOException e) {
Log.d(TAG, "Failed to write " + diskPath + " to camput stdin: " + e);
Log.d(TAG, "Failed to write " + diskPath + " to pk-put stdin: " + e);
return false;
}
}
@@ -160,7 +160,7 @@ public void run() {
Process process = null;
try {
ProcessBuilder pb = new ProcessBuilder();
pb.command(binaryPath("camput.bin"), "--server=" + mHostPort.urlPrefix(), "file", "-stdinargs", "-vivify");
pb.command(binaryPath("pk-put.bin"), "--server=" + mHostPort.urlPrefix(), "file", "-stdinargs", "-vivify");
pb.redirectErrorStream(false);
pb.environment().put("CAMLI_AUTH", "userpass:" + mUsername + ":" + mPassword);
pb.environment().put("CAMLI_TRUSTED_CERT", mTrustedCert);
@@ -294,7 +294,7 @@ public long uploadedBytes() {
private class ParseCamputOutputThread extends Thread {
private final BufferedReader mBufIn;
private final UploadService mService;
private final static String TAG = UploadThread.TAG + "/camput-out";
private final static String TAG = UploadThread.TAG + "/pk-put-out";
private final static boolean DEBUG_CAMPUT_ACTIVITY = false;

public ParseCamputOutputThread(Process process, UploadService service) {
@@ -309,15 +309,15 @@ public void run() {
try {
line = mBufIn.readLine();
} catch (IOException e) {
Log.d(TAG, "Exception reading camput's stdout: " + e.toString());
Log.d(TAG, "Exception reading pk-put's stdout: " + e.toString());
return;
}
if (line == null) {
// EOF
return;
}
if (DEBUG_CAMPUT_ACTIVITY) {
Log.d(TAG, "camput: " + line);
Log.d(TAG, "pk-put: " + line);
}
if (line.startsWith("CHUNK_UPLOADED ")) {
CamputChunkUploadedMessage msg = new CamputChunkUploadedMessage(line);
@@ -348,7 +348,7 @@ public void run() {
}
continue;
}
Log.d(TAG, "camput said unknown line: " + line);
Log.d(TAG, "pk-put said unknown line: " + line);
}

}
@@ -363,20 +363,20 @@ public WaitForProcessThread(Process p) {

@Override
public void run() {
Log.d(TAG, "Waiting for camput process.");
Log.d(TAG, "Waiting for pk-put process.");
try {
mProcess.waitFor();
} catch (InterruptedException e) {
Log.d(TAG, "Interrupted waiting for camput");
Log.d(TAG, "Interrupted waiting for pk-put");
msgCh.offer(new ProcessExitedMessage(-1));
return;
}
Log.d(TAG, "Exit status of camput = " + mProcess.exitValue());
Log.d(TAG, "Exit status of pk-put = " + mProcess.exitValue());
msgCh.offer(new ProcessExitedMessage(mProcess.exitValue()));
}
}

// CopyToAndroidLogThread copies the camput child process's stderr
// CopyToAndroidLogThread copies the pk-put child process's stderr
// to Android's log and submits it to to the main activity in batches.
private static class CopyToAndroidLogThread extends Thread {
private static final int MAX_LINES = 6; // amount of lines to buffer before submission
@@ -415,7 +415,7 @@ private void handle(String line) {
Log.d(mTag, line);

mLines.add(line);
// Prevent accumulation of a large number of lines when camput produces a lot of
// Prevent accumulation of a large number of lines when pk-put produces a lot of
// logging output for some reason.
if (mLines.size() >= MAX_LINES) {
submitLines();
@@ -42,7 +42,7 @@ const appVersion = "0.7"
var (
camliDir = filepath.Join(os.Getenv("GOPATH"), "src/perkeep.org")
projectDir = filepath.Join(os.Getenv("GOPATH"), "src/perkeep.org/clients/android")
camputBin = filepath.Join(projectDir, "app/build/generated/assets/camput.arm")
pkputBin = filepath.Join(projectDir, "app/build/generated/assets/pk-put.arm")
assetsDir = filepath.Join(projectDir, "app/src/main/assets")
)

@@ -70,28 +70,28 @@ func buildApp() {
}

func writeVersion() {
if err := ioutil.WriteFile(filepath.Join(assetsDir, "camput-version.txt"), []byte(version()), 0600); err != nil {
if err := ioutil.WriteFile(filepath.Join(assetsDir, "pk-put-version.txt"), []byte(version()), 0600); err != nil {
log.Fatalf("Error writing app version file: %v", err)
}
}

func buildCamput() {
os.Setenv("GOARCH", "arm")
os.Setenv("GOARM", "7")
cmd := exec.Command("go", "build", "-o", camputBin, "perkeep.org/cmd/camput")
cmd := exec.Command("go", "build", "-o", pkputBin, "perkeep.org/cmd/pk-put")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
log.Fatalf("Error building camput for Android: %v", err)
log.Fatalf("Error building pk-put for Android: %v", err)
}

if err := os.Rename(camputBin, filepath.Join(assetsDir, "camput.arm")); err != nil {
log.Fatalf("Error moving camput to assets dir: %v", err)
if err := os.Rename(pkputBin, filepath.Join(assetsDir, "pk-put.arm")); err != nil {
log.Fatalf("Error moving pk-put to assets dir: %v", err)
}
}

func version() string {
return "app " + appVersion + " camput " + getVersion() + " " + goVersion()
return "app " + appVersion + " pk-put " + getVersion() + " " + goVersion()
}

func goVersion() string {
@@ -2,7 +2,7 @@
2. Install xcode.
3. From top-level directory:
$ go run make.go
(this will create bin/perkeepd, bin/pk-mount, and bin/camput)
(this will create perkeepd, pk-mount, and pk-put)
4. From this directory:
$ xcodebuild -target Perkeep.dmg
(this will create build/Release/Perkeep.app and Perkeep.dmg)
@@ -13,7 +13,7 @@
DAABA574186435DA000D62B6 /* perkeepd in Resources */ = {isa = PBXBuildFile; fileRef = DAABA572186435DA000D62B6 /* camlistored */; };
DAABA575186435DA000D62B6 /* pk-mount in Resources */ = {isa = PBXBuildFile; fileRef = DAABA573186435DA000D62B6 /* pk-mount */; };
DAABA57718643710000D62B6 /* Credits.html in Resources */ = {isa = PBXBuildFile; fileRef = DAABA57618643710000D62B6 /* Credits.html */; };
DAD59F8C1877CC250018193C /* camput in Resources */ = {isa = PBXBuildFile; fileRef = DAD59F8B1877CC250018193C /* camput */; };
DAD59F8C1877CC250018193C /* pk-put in Resources */ = {isa = PBXBuildFile; fileRef = DAD59F8B1877CC250018193C /* pk-put */; };
DAF109491863EDAF00F6A3F9 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DAF109481863EDAF00F6A3F9 /* Cocoa.framework */; };
DAF109531863EDAF00F6A3F9 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = DAF109511863EDAF00F6A3F9 /* InfoPlist.strings */; };
DAF109551863EDAF00F6A3F9 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DAF109541863EDAF00F6A3F9 /* main.m */; };
@@ -57,7 +57,7 @@
DAABA572186435DA000D62B6 /* perkeepd */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = camlistored; path = ../../bin/camlistored; sourceTree = "<group>"; };
DAABA573186435DA000D62B6 /* pk-mount */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = "pk-mount"; path = "../../bin/pk-mount"; sourceTree = "<group>"; };
DAABA57618643710000D62B6 /* Credits.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = Credits.html; sourceTree = "<group>"; };
DAD59F8B1877CC250018193C /* camput */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = camput; path = ../../bin/camput; sourceTree = "<group>"; };
DAD59F8B1877CC250018193C /* pk-put */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = pk-put; path = ../../bin/pk-put; sourceTree = "<group>"; };
DAF109451863EDAF00F6A3F9 /* Perkeep.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Perkeep.app; sourceTree = BUILT_PRODUCTS_DIR; };
DAF109481863EDAF00F6A3F9 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
DAF1094B1863EDAF00F6A3F9 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
@@ -110,7 +110,7 @@
DAF1093C1863EDAF00F6A3F9 = {
isa = PBXGroup;
children = (
DAD59F8B1877CC250018193C /* camput */,
DAD59F8B1877CC250018193C /* pk-put */,
DAABA572186435DA000D62B6 /* perkeepd */,
DAABA573186435DA000D62B6 /* pk-mount */,
DAF1094E1863EDAF00F6A3F9 /* Perkeep */,
@@ -301,7 +301,7 @@
DA31F9391866744D002E3F33 /* TimeTravelWindowController.xib in Resources */,
DAABA574186435DA000D62B6 /* perkeepd in Resources */,
DAABA575186435DA000D62B6 /* pk-mount in Resources */,
DAD59F8C1877CC250018193C /* camput in Resources */,
DAD59F8C1877CC250018193C /* pk-put in Resources */,
DAF109531863EDAF00F6A3F9 /* InfoPlist.strings in Resources */,
DAF109841863F1F900F6A3F9 /* menuicon-selected@2x.png in Resources */,
DAF109861863F1F900F6A3F9 /* menuicon@2x.png in Resources */,
@@ -144,7 +144,7 @@ - (void)createClientConfig
NSMutableString *launchPath = [NSMutableString string];
[launchPath appendString:[[NSBundle mainBundle] resourcePath]];
[put setCurrentDirectoryPath:launchPath];
[launchPath appendString:@"/camput"];
[launchPath appendString:@"/pk-put"];
NSDictionary *env = [NSDictionary dictionaryWithObjectsAndKeys:
NSHomeDirectory(), @"HOME",
NSUserName(), @"USER",

This file was deleted.

@@ -30,7 +30,7 @@ type chanWorker struct {
buf *list.List
}

// TODO: make it configurable if need be. Although so far in camput it wasn't.
// TODO: make it configurable if need be. Although so far in pk-put it wasn't.
const buffered = 16

// NewWorker starts nWorkers goroutines running fn on incoming
@@ -65,7 +65,7 @@ func IsLocalhost(req *http.Request) bool {
if err == nil {
if uid == connUID || connUID == 0 {
// If it's the same user who's running the server, allow it.
// Also allow root, so users can "sudo camput" files.
// Also allow root, so users can "sudo pk-put" files.
// Allowing root isn't a security problem because if root wants
// to mess with the local user, they already can. This whole mechanism
// is about protecting regular users from other regular users

This file was deleted.

0 comments on commit 2bb666c

Please sign in to comment.
You can’t perform that action at this time.